1. Dropbox 연결하기
https://play.google.com/store/apps/details?id=os.devwom.smanager.dropbox
드랍박스 연결 애드온 어플을 설치합니다.
스크립트 매니저 초기화면에서 메뉴키를 누르고 맨 위에 있는 Home/Net 클릭합니다.
해당 애드론 어플들을 설치하면 드랍박스, 박스, FTP, SMB등이 가능합니다.
드랍박스를 클릭해서 본인 계정을 설정합니다.
제가 쓰는 2개의 계정이 맨위에 보입니다.
모자이크 처리는 저 부분에 유저 아이디가 숫자로만 보여집니다.
저 아이디 숫자를 알아야 스크립트에서 동작시킵니다.
** 첨부한 스크립트는 본인 폰에 있는 연락처, 일정, 문자, 최근기록, 환경설정, 알람 의 db 파일을 tar 파일로 백업하고 자동으로 드랍박스에 업로드 해주는 기능입니다.
언제나처럼 /sdcard/Download/modding 폴더에서 실행합니다.
반드시 스크립트 매니저를 통해서 실행해야 합니다.
터미널에서는 안됩니다.
실행하면 드랍박스 계정의 이름이 나옵니다.
(애드온 어플의 설정 xml 에서 가져오게 했습니다. 숫자를 외우고 있을 필요도 없고 그래서 ㅋ)
폰에 있는 db 들을 tar 파일로 묶어서 backup_db 라는 폴더에 먼저 저장합니다.
계정을 선택하면 해당 계정의 숫자 드랍박스 아이디를 가져옵니다.
드랍박스 계정에 backup_db 폴더를 만들고 tar 파일을 업로드 합니다.
같은 이름의 파일이 존재하면 덮어쓸지 물어봅니다.
업로드합니다.
드랍박스에 올라갔습니다.
** 참고 자료
Local files
In order to refer to your device local files you need to use the following uri format
file:///path/to/file
note 3 slash between scheme and the path
Boxnet files
In order to refer to your Boxnet files you need to use the following uri format
boxnet://usermail@domain.net/path/to/file
Where usermail@domain.net is your user mail at boxnet account
제 폰은 박스 연결에 문제가 있네요.
Dropbox files
In order to refer to your Dropbox files you need to use the following uri format
boxnet://userid/path/to/file
Where userid is your userid at dropbox account. You can get your userid from your SManager configured connections
Windows/samba, sftp/ssh ftp files
In order to refer to your Windows/samba, sftp/ssh ftp files you need to use the following uri format
shceme://user@host:port/path/to/file
Where scheme is
smb: for Windows/Samba connections
sftp: for sftp/ssh connections
ftp: for ftp connections
user@ and :port are optional
Packed files
- 압축파일도 관리가 되는가봐요 ㅋ
Packed filer refers to file tree that resides inside a single file like compressed files.
NOTE: Packed files are read only files
At this moment SManager supports following schemes for packed files.
zip: browse inside zip/apk and jar files
yaffs2: browse inside basic yaffs2 disk images
tar: browse inside tar files
tgz: browse inside gzip tar compressed files
tbz2: browse inside bzip2 tar compressed files
In order to refer to packed files you need to use the following uri format
scheme:REALFILE!//path/to/file
Where scheme is zip,yaffs2,tar,tgz or tbz
and REALFILE is a real packed uri, including packed files
For example
zip:file:///path/myfile.zip!//path/inside/zip/log.txt
Refers to file /path/inside/zip/log.txt inside /path/myfile.zip in your device file
tgz:sftp://user@myserver/path/myfile.tgz!//path/inside/tgz/to/directory/
Refers to /path/inside/tgz/to/directory/ inside /path/myfile.tgz file stored in myserver host using user user
NOTE: Packed directories always must end on slash character(/)
파일 관리 예제입니다.
Some examples
smc cp -a "dropbox://numeric_user_id/Photos" "file:///sdcard/photos_dropbox"
smc cp -r sftp://user@host:3567/home/user/kk/*a* file:///sdcard/kk/k2
smc mkdir "boxnet://user@domain.net/onefolder" && smc mv "boxnet://user@domain.net/onefolder" "boxnet://user@domain.net/newname"
smc cp "file:///ueventd.mako.rc" "boxnet://user@domain.net/newname/"
smc rm -r "boxnet://user@domain.net/newname"
smc cp -r "ftp://user@ip_dir/home/user/one/directory" file:///sdcard/one/file "boxnet://user@domain.net/newname" smb://guest@other_ip/other/dir sftp://user@mymachine/home/user/destdir/
smc cp -r zip:dropbox://user_id/zipfile.zip!//directory/* sftp://user@host:1234/home/user/directory/
스크립트 매니저 내장된 GUI 팝업 창들입니다.
Implemented dialogs
화면 아래부분에 팝업창 띄우는거 2개
showToastShort
Shows a Toast with short time.
Arguments: Desired message to show
Return value: none
showToastLong
Shows a Toast with long time.
Arguments: Desired message to show
Return value: none
에스/노 대화창 띄우기
showYesNoDialog
Shows a yes/no dialog.
Arguments:
Number of allowed arguments 1 or 2
1 argument => only shows message
2 arguments => first argument title. Second argument is the message
Return value: y , n or empty string if the dialog was cancelled.
확인 대화창 띄우기
showOkDialog
Available from SManager 2.7.0 version
Shows a dialog only with Ok button.
IMPORTANT: when Ok is pressed, new line is written to SM_GUIFD stream, so always is needed read from it
Example always add these two lines
echo showOkDialog "This is my title" "This is my message" >&$SM_GUIFD
read res <&$SM_GUIFD
Arguments:
Number of allowed arguments 1 or 2
1 argument => only shows message
2 arguments => first argument title. Second argument is the message
Return value: y , n or empty string if the dialog was cancelled.
입력창 및 패쓰워드 입력창 띄우기
showInputDialog and showInputPasswordDialog
Shows an input box dialog. if action is showInputPasswordDialog the typed text will be hidden.
Arguments:
Optional arguments [ -d "default_value" ] adds default value for Input field, not requiring 4 arguments. Available from SManager 2.7.0 version
Number of allowed arguments 1, 2, 3 or 4
1 argument
only shows message
2 arguments
first argument title
Second argument message
3 arguments
first argument title.
Second argument message.
Third argument hint text
4 arguments
first argument title.
Second argument message.
Third argument hint text
Fourth default text
return value: typed string or empty string if dialog was cancelled
선택창 (단수 및 복수 선택창 2개)
showSpinnerDialog (single select option)
Shows a dialog with an array of options. Only is possible select one option.
Arguments:
Optional arguments [ -s "default_selection_index" ] set as checked default_selection_index item, starting at 1. Available from SManager 2.7.0 version
Number or arguments 2 or more
First argument: title
Rest of arguments: options
return value: selected index option. (First option is 1)
Empty string if dialog was cancelled
showSpinnerMultiselectDialog (multiple select option)
Shows a dialog with an array of options. It is possible select multiple options.
Arguments:
Optional arguments [ -s "default_selection_index" ] [ -s "default_selection_index" ] …
Set checked default_selection_indexes item or items, starting at 1. Available from SManager 2.7.0 version
Number or arguments 2 or more
First argument: title
Rest of arguments: options
return value: space separate selected options. (First option is 1)
Empty string for no selections or cancelled dialog.