1.Function. 2

2.Sync Task. 3

2.1.Sync Task option. 3

2.2.SMB Folder option. 6

2.3.Local Folder option. 7

2.4.ZIP Folder option. 8

2.5.File selection filter. 10

2.6.Directory selection filter. 11

2.7.How to allow access to SDCARD/USB media. 12

3.Schedule. 13

3.1.Schedule option. 13

4.Description of the Menu. 15

4.1.Sync. 15

4.2.Export task. 15

4.3.Import task. 15

4.4.Manage log file. 15

4.5.Maintaince Admin files. 15

4.6.Settings. 15

4.6.1.Sync. 15

4.6.2.User interface. 16

4.6.3.SMB Settings. 16

4.6.4.Security. 16

4.6.4.1.Security settings. 17

4.6.5.Miscellaneous. 17

4.9.Kill the application. 17

4.10.About SMBSync3. 17

4.11.System Information. 17

5.Starting from other applications. 18

5.1.Starting from other applications. 18

5.1.1.Example for Tasker. 18

5.2.Notification of synchronization start and end. 19

5.3.Sample code for start SMBSync3 by Application. 21

6.Library. 22

7.About collecting and sending data in the app. 23

8. Acknowledgments. 24

1.Function

SMBSync 3 is a tool for synchronizing files via wireless LAN using SMB1, SMB2 or SMB3 protocol between the internal storage of Android terminal, SDCARD and PC/NAS. Synchronization is a one-way from the source to the destination, mirror, move, copy, archive can be used. (Internal storage,  SMB,  ZIP combination is possible)

You can start the synchronization by external application (Tasker, AutoMagic etc) or SMBSync2 schedule. Please refer to the Starting from other applications for interface with an external application.

 

*         Mirror

If source and destination files are different(*1), to copied files from source to the destination directory. To delete destination files and directories if does not exist in the source.

*         Move

If source and destination files are different(*1), to copied files from source to the destination directory. To delete the source directories and files copied to the destination.

However, the source and destination same name, same file modification time and file size, to delete the file on the source without copying files.

*         Copy

If source and destination files are different(*1), to copied files from source to the destination directory. However, the same file modification time and file size with the same name does not copy the source and destination.

*         Archive

Move photos and videos in the directory on the source side to the destination under conditions such as shooting date/time than the date and time of archive execution, such as 7 days or earlier or 30 days or earlier. (However, ZIP can not be used for destination)

 

*1 Copy or move when any of the following three conditions are satisfied. However, you can ignore the file size and last update time in the sync task options.

*         File does not exist

*         Different file sizes

*         Different over when last updated 3 seconds

 

2.Sync Task

2.1.Sync Task option

*        Test mode

It does not perform overwrite and delete the file if you check. Please be tested when you create a synchronization task, files that are copied or deleted can be found in the message tab.

*        Auto sync task

If checked the task to the automatic. Tasks that are set to automatic synchronization will start when you press the sync button.

*        Task name

The name of the synchronization task cannot be a duplicate name. Names are  case insensitive.

*        Sync type

The sync method is selected from mirror, copy, move, archive. Sync is done from Source to Destination one direction.

*      Mirror

*      Move

*      Copy

*      Archive

*        Swap the source and destination

Swap the contents of the source folder and the destination folder

*        Source folder

Tap the button to edit source folder

*        Destination folder

Tap the button to edit destination folder

*        Select files for sync

If you do not check and then sync all of the file. If you check to see details.

*         Sync audio files

If you check to synchronize the files of the following extensions.

aac, aif, aifc, aiff, kar, flac, m3u, m4a, mid, midi, mp2, mp3, mpga,

ogg, ra, ram, wav

*         Sync image files

If you check to synchronize the files of the following extensions.

bmp, cgm, djv, djvu, gif, ico, ief, jpe, jpeg, jpg, pbm, pgm, png, tif, tiff

*         Sync video files

If you check to synchronize the files of the following extensions.

avi, m4u, mov, mp4, movie, mpe, mpeg, mpg, mxu, qt, wmv

*        File filter

You can select the name and extension of the file you want to synchronize with other than the above.(Refer to 2.5.File selection filter)

*        Select sub directories for sync

If you do not check and then sync all of the sub directory. If you check to show directory filter button.

*         Directory filter

You can select the name of the directory you want to synchronize.

(Refer to 2.6.Directory selection filter)

*        Execute sync task only when charging

If checked, you can start sync only while charging. If sync is started when not charging it will result in an error.

*        Confirm before override copy or delete

It will display a confirmation dialog when you want to overwrite and delete the file if you have checked.

*        Network

*         Run even when off

You can always start syncing

*         Conn to any AP

Sync can start if the wireless LAN is connected to the any access point.

*         Access point list

You can start synchronization when the connected access point is registered. Click the " Access Point List" button to register an access point.

*         Has private address

You can start synchronization when a private IP address is assigned.

*         IP Address List

You can start synchronization when an assigned IP address is registered. Click the "IP address list" button to register the access point.

*        If it is not connected to the specified access point Skip the task and start the next task

In any of the following cases, the subsequent task is executed without an error.

*       Access point is not registered

*       IP address is not registered

*        Allow sync with global IP addresses

If checked, allows synchronization even if the network address is a global address.

*        Stop syncing when an error occurs

If it is not checked, sync continue when sync task ended with error.

*        Sync subdirectory

If checked, sync the subdirectory.

*        Sync a empty directory

If checked, sync the empty directory .(Create a empty directory on the destination)

*        Sync a hidden directory

If checked, sync the hidden directory.(The name of the hidden directory starts from "." In Android, since it is represented by a bit in the directory and not the name of the directory on Samba and Windows, the directory that was created will not be in a hidden directory)

*        Sync a hidden file

If checked, sync the hidden file.( The name of the hidden file begins with "." In Android, since it is represented by a bit in the directory and not the name of the file with Samba and Windows, the file that is created will not be hidden files)

*        Overwrite detination file(s)

If checked, overwrite the file if same file exists.

*        Retry on network error

Retry the sync only error on the remote side. Retry is done up to three times, is carried out after 30 seconds from the error occurred retry each.

*        Delete files prior to sync(Mirror method only)

If checked, delete the destination file that does not exist on the source, and then copy the difference file with the source.

*        Do not set the last update time of destination file to match source file

If checked, the last update time of the file copied from the source will be the time the file was copied. The difference judgment is judged by the existence of the existence of the file and the file size.

*        Limit the SMB I/O write buffer to 16KB

If you check to limit the IO buffer at the time of remote file writing to 16KB.

*        Use file size to determine file difference

If checked, if the last update time of the file is different, it is determined as a difference file.

*       Files are different only when the source is larger than the destination

If checked, the file is overwritten only when the source file is newer than the destination file, even if the file size and last update time are different.

*        Minimum age period(in seconds) between sourceand destination file for synchronization

No change within the specified time difference.

*        Do not overwrite destination file if newer than source file

If checked, the file will be overwritten only when the source file is newer than the destination file even if the file size and the last update time are different.

*        Skipping directories or files name that contain invalid characters (", :, \, *, <, >, |)

If checked, it will display a warning message without processing directories/files containing unusable characters and process the following directories/files.

*        (Syc type only moves) Delete the source directory when the source drectory is empty

If the source directory is empty after moving from the source directory to the destination directory, delete the source directory.

*        If the date and time cannot be determined by EXIF data, a comfirmation message is displated

Display a confirmation message when the taken date and time cannot be obtained from Exif.

*        Ignore source files that are larger than 4 GB when sync to external storage

If checked, ignore source files larger than 4GB in size when syncing to local storage, preventing I/O errors when syncing to a MicroSD card.

 

*        Ignore files whose file names exceed 255 bytes

If checked, ignore files whose destination file name exceeds 255 bytes. If not checked, synchronization will be terminated with an error.

 

2.2.SMB Folder option

*        Find and configure the SMB server

Scan the network and select from the SMB server list to configure.

The following figure is an example of the setting screen.

*        Edit SMB server parameters

Manually set the parameters for the SMB server.

*        Server host name/IP address

To specify SMB server name or IP address

*         SMBProtocol

You can specify SMB protocol.

*       Use SMB V1

*       Use SMB V2/3(2.12)

*        Use port number

Specify if the port number of the standard is not available. The standard port number is 139/tcp and 445/tcp.

*        Use Account name and password

It specifies whether to use the SMB server account name and password

*        Account name

To specify account name for SMB server.

*        Password

To specify password for SMB server.

*        List share

Show share name for SMB server.

*        List Directories

Show SMB server directory list.

*        Directory

To specify directory for SMB host.If the destination directory does not exist, it will be created at the time of synchronization.

Note: Under the following conditions, it becomes a circular reference and loops. Specify a directory filter or specify a directory on the source side that is different from the destination.

*       No directory specified when the same SMB server is specified for source and destination

*       No directory filter specified

 

The following is only displayed when the synchronization type is Archive.

*         Save all files in the destination directory without creating subdirectories

If checked, the destination directory will not have any sub-directories included in the source directory.

*        To archive the

Select a file with a shooting date and time older than the archive execution date and time. (Regardless of the shooting date and time, the shooting date is 7 days or older, the shooting date is 30 days or older, the shooting date is 60 days or older, the shooting date is 90 days or older, the shooting date is 180 days or older, the shooting date is You can choose from more than one year old)

*        Sequence number

You can add a sequence number to the file name.

*        Edit file name parameter

To include the date and time in the file name, tap the button and edit.

2.3.Local Folder option

*        Local storage

Select the storage to use.

*        Allow use external storage

Request permission to use external storage. If you format the MicroSD card, the UUID will change, so request permission to use it.

(Refer to 2.7. How to allow access to SDCARD/USB media)

*        List Files

Show directory list for local storage.

*        Directory

To specify directory for local storage. If the destination directory does not exist, it will be created at the time of synchronization.

Note: Under the following conditions, it becomes a circular reference and loops. Specify a directory filter or specify a directory on the source side that is different from the destination.

*       No directory specified for source and destination

*       No directory filter specified

The following is only displayed when the synchronization type is Archive.

*         Save all files in the destination directory without creating subdirectories

If checked, the destination directory will not have any sub-directories included in the source directory.

*        To archive the

Select a file with a shooting date and time older than the archive execution date and time. (Regardless of the shooting date and time, the shooting date is 7 days or older, the shooting date is 30 days or older, the shooting date is 60 days or older, the shooting date is 90 days or older, the shooting date is 180 days or older, the shooting date is You can choose from more than one year old)

*        Sequence number

You can add a sequence number to the file name.

*        Edit file name parameter

To include the date and time in the file name, tap the button and edit.

 

2.4.ZIP Folder option

*        Local storage

Select the storage to use.

*        Allow use external storage

Request permission to use external storage. If you format the MicroSD card, the UUID will change, so request permission to use it.

(Refer to 2.7. How to allow access to SDCARD/USB media)

*        List files

Show file lists.

*        ZIP File name

Specify ZIP file name.

*        Compression level

Select compression level.

*         Fastest

*         Fast

*         Normal

*         Maximum

*        Encryption method

*         None

*         ZipCrypto

*         AES128 Bit

*         AES256 Bit

*        Password

Specify password for encryption.

*        Confirm

Re-enter password for confirmation.


 

2.5.File selection filter

File selection filter is used to select the files you want to synchronize.

You can choose the selection and exclusion. If you enter both the selection and exclusion is a priority excluded.

If you enter two or more filters to select the file under the conditions OR.

*        Include/Exclude

Specifying selection or exclusion filters

*        Add

Add the contents entered in the filter field as a filter

*        Filter

Filter value. Enter DSC * .JPG etc.

Do not enter file selection filters with regular expressions.


 

2.6.Directory selection filter

Directory selection filter is used to select the directories you want to synchronize.(You can choose the selection and exclusion. Exclusion takes precedence If you enter both the selection and exclusion filters.)

If you enter two or more filters to select the file under the conditions OR.

*        Include/Exclude

Specifying selection or exclusion filters

*        Add

Add the contents entered in the filter field as a filter

*        Filter

Filter value. Enter DIR/USB etc.

Do not enter file selection filters with regular expressions.

*        Matches from beginning of subdirectory path

Selects and excludes matches from the beginning of the subdirectory path.

If not checked, those with matching subdirectory names will be selected / excluded.

1.    When "Match from the beginning of subdirectory path" is checked

*       If you specify "DIR_A". "MASTER_DIR/DIR_A" will be selected / excluded.

*       If you specify "DIR_A/SUBDIR_A", "MASTER_DIR/DIR_A/SUBDIR_A" will be selected and excluded.

2.    When "Match from the beginning of directory path" is not checked

If "CACHE_DIR" is specified, "MASTER_DIR/CACHE_DIR" and "MASTER_DIR/DIR_A/CACHE_DIR" will be selected / excluded.

 


 

2.7.How to allow access to SDCARD/USB media

You can grant permissions from the Source/Destination folder or menu. Press the "Allow use external storage" button.

1.Screen example of Android8/8.1/9.0

2.Screen example of Android 10

 

3.Schedule

3.1.Schedule option

*         Enable schedule

Enable/disable schedule

 

*         Schedule type

The schedule can be specified as follows

*       Every hour (eg, every 10 minutes)

*       Every day (Every day at 20:00)

*       Every month (executed at 10:30 on the 10th of every month)

*       Specify day of the week (executed at 21:00 on Monday and Friday)

*       Interval (Every 10 minutes, for example, every 10 minutes after the terminal is restarted)

 

*         Reset interval schedule time

Set the synchronization start time to the interval time. (If the interval time is set to 5 minutes and the save button is pressed at 1:10:20, the task starts at 1: 15: 0)

 

*         It will make the first sync with the next minute

The first time to be performed in the interval schedule is set to be a minute ahead of the current time. (If the save button is pressed at 1:10:20, it will be 1: 11: 0)

 

*         Execute all auto sync tasks

If unchecked, you can select a synchronization task

 

*         Edit Sync List

Press the button to display the edit sync task screen. Select tasks to sync.

 

*         Turn on Wi-Fi when Wi-Fi is off at the start of sync (Not available on Android   10 or later)

If Wi-Fi is off at the start of synchronization, turn on Wi-Fi.

 

*         Delay period before sync after WIFI enable (Not available on Android 10 or later)

Wait time before starting synchronization after turning on Wi-Fi.

 

*         If you turn on Wi-Fi at the start of sync, turn off Wi-Fi after the end of sync(Not available on Android 10 or later)

If you turned on Wi-Fi at the start of synchronization, turn off Wi-Fi at the end of synchronization.

 

*         Sync only starts while charging

You can change the synchronization task options.

4.Description of the Menu

4.1.Sync

To start auto sync task. (Displayed as an icon at the top of the screen)

4.2.Export task

Writes sync task to the file.

 

4.3.Import task

Load the sync task from the file.

 

4.4.Manage log file

Delete or send a log file.

 

4.5.Maintaince Admin files

Remove the management data of SMBSync3 that are no longer needed.

 

4.6.Settings

Configure the following items.

*         Sync

*         User interface

*         SMB settings

*         Security

*         Miscellaneous

4.6.1.Sync

*         Wi-Fi lock

If checked, acquire Wi-Fi lock during synchronization.

*         Sync history

If checked, save the detailed record of synchronization. You can also see details by tapping the history on the history tab.

*         Prevent delay of start sync during sleep

If checked, turn on the screen at the start of synchronization to ensure resume from sleep.

*         Do not warn when location service disabled

Show/hide warning message.

*         Notification of adding external storage

Show/hide notification message.

*         Uncompressed file types

File extension not compressed when writing to ZIP folder.

4.6.2.User interface

*         Notification Messages

Playback default notification sound when sync ended

*         Notification Sounds

Set the conditions for displaying the message in the notification area.

*         Notification Sound Volume

Set whether to play the default notification sound at the end of synchronization.

*         Notification Vibration

Vibrate your device when sync ended

*         Force Portrait Orientation

Fix the screen orientation to portrait.

*         Screen theme

You can chose Dark/Light/Black theme.

4.6.3.SMB Settings

*         Restore default value

Restore default value

*         lmCompatibility

JCIFS LM Compatibility(Initial value:3)

*         Client response timeout

30000 milli sec

*         Disable plain text passwords

Do not encrypt password(Not checked)

*         useExtendedSecurity

Use extended security(Checkked)

 

4.6.4.Security

*         Security

Tap to display the detailed setting screen. If you are creating an application password, the password authentication screen will be displayed and you will not be able to proceed unless the correct password is entered.

 

4.6.4.1.Security settings

*         Application Password

*         CREATE PASSWORD

Create application password

*         REMOVE PASSWORD

Remove application password

*         CHANGE PASSWORD

Change application password

*         Items to protect

Not enabled unless an application password is created

*         Set the validity time of password authentication to 30 minutes

If you do not check it, re-authentication will not be performed until the application is terminated. However, when displaying the security detail setting screen, always re-authenticate.

*         Perform application password authentication when “Launch application”

The application can not be started until the correct password is entered. However, the sync task runs without a password.

*         Perform application password authentication when “Edit task”

You can not edit until the correct password is entered.

*         Perform application password authentication when “Export task list”

You can not “Export task list” until the correct password is entered.

*         Hide the saved account name and password when editing the SMB folder

When checked, the saved account name and password will be blank, so please enter your account name and password again.

4.6.5.Miscellaneous

*         Exit cleanly

Check to kill the process at the end of the app.

*         Text processing of sync messages

Check to make the Android standard word wrap.

 

4.9.Kill the application

Kill the SMBSync3.

 

4.10.About SMBSync3

Load the profile from the file.

 

4.11.System Information

Show system information and send to developer.

5.Starting from other applications

5.1.Starting from other applications

You can initiate synchronization by issuing an intent with “com.sentaroh.android.SMBSync3.ACTION_START_SYNC” from application to action.

Intent Extra allows you to specify the tasks to synchronize.

Synchronizes the autosync task when Extra is not specified.

Code Example 1 (start synchronous tasks test1 and test2)

Intent in=new Intent("com.sentaroh.android.SMBSync3.ACTION_START_SYNC");

String prof= "test1,test2";

in.putExtra("SyncProfile", prof);

startActivity(in);

Code Example 2 (Start all auto-sync tasks)

Intent in=new Intent("com.sentaroh.android.SMBSync3.ACTION_START_SYNC");

startActivity(in);

5.1.1.Example for Tasker

Action:com.sentaroh.android.SMBSync3.ACTION_START_STNC

Extra: SyncProfile:”prof1, prof2”

Target:   Activity

 

Sample task is here

https://drive.google.com/file/d/102YpRq_BsaB39npTAFds5l8D01-3OxXZ/view?usp=sharing

 

5.2.Notification of synchronization start and end

*         Issues a broadcast intent at the start and end of synchronization.

*         Start      :com.sentaroh.android.SMBSync3.ACTION_SYNC_STARTED

End       :com.sentaroh.android.SMBSync3.ACTION_SYNC_ENDED

*         If you want the app to detect the timing of synchronization start and end, please receive the intent on the broadcast receiver.

*         The exit status string is stored in ExtraData of Intent. The key is SYNC_RESULT.

*         SUCCESS

*         ERROR

*         CANCEL

*         WARNING

*         Sample

*         Tasker

Event:System->Intent received

Action:com.sentaroh.android.SMBSync3.ACTIO_SYNC_ENDED

Action:Notify

Text:%sync_result

https://drive.google.com/file/d/1tsK8P167Wirq13RILt7OYISVyhuxkmzi/view?usp=sharing

 

 

 

 

 


5.3.Sample code for start SMBSync3 by Application

The following code sample to start SMBSync3 from Activity.

 

public class MainActivity extends Activity {

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_main);

Intent in=new Intent("com.sentaroh.android.SMBSync3.ACTION_START_SYNC");

String prof= "S-PGMS,S-Pictures,INTERNAL-TO-SDCARD";

in.putExtra("SyncProfile", prof);

sendBroadcast(in,null);

}

 

OR

 

public class MainActivity extends Activity {

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_main);

Intent in=new Intent("com.sentaroh.android.SMBSync3.ACTION_START_SYNC");

String prof= "S-PGMS,S-Pictures,INTERNAL-TO-SDCARD";

in.putExtra("SyncProfile", prof);

startActivity(in);

}

6.Library

*         jcifs-ng 2.1 SNAPSHOT Client Library

*         jcifs-1.3.17

*         Zip4j 2.2.3

*         Apache Commons Compress 1.20

*         XZ-1.8

*         Xmpcore-5.1.3

*         Metadata-extractor

 

 

 

 

7.About collecting and sending data in the app

The app collects the following data and saves it in a file to verify the synchronization result and to identify the cause of the error.

*         Directory name, file name, file size and last modified date of file

*         Network interface name, IP address

*         User settings other than password

*         Error information in the app

*         In addition to the above when using SMB, the account name, account password and host name (if used)

Information that is collected is not sent outside in the app. However, except when sending by user operation. (Log management, Share a history and send a system information)

See “Privacy Policy”.

8. Acknowledgments

Thank you for translating it into English for volunteers.