Upgrade SyncthingNative to v2.0.0

This commit is contained in:
Catfriend1 2025-08-12 10:38:09 +02:00
parent 2a9c898fe5
commit cbab4ec64c
6 changed files with 17 additions and 12 deletions

View File

@ -234,7 +234,7 @@ public class Constants {
/**
* Name of the folder containing the index database.
*/
private static final String INDEX_DB_FOLDER = "index-v0.14.0.db";
private static final String INDEX_DB_FOLDER = "index-v2";
public static File getIndexDbFolder(Context context) {
return new File(context.getFilesDir(), INDEX_DB_FOLDER);

View File

@ -106,19 +106,19 @@ public class SyncthingRunnable implements Runnable {
mUseRoot = mPreferences.getBoolean(Constants.PREF_USE_ROOT, false) && Shell.SU.available();
switch (command) {
case deviceid:
mCommand = new String[]{mSyncthingBinary.getPath(), "--home=" + mContext.getFilesDir().toString(), "--device-id"};
mCommand = new String[]{mSyncthingBinary.getPath(), "device-id"};
break;
case generate:
mCommand = new String[]{mSyncthingBinary.getPath(), "--generate=" + mContext.getFilesDir().toString(), "--no-default-folder", "--logflags=0"};
mCommand = new String[]{mSyncthingBinary.getPath(), "generate"};
break;
case main:
mCommand = new String[]{mSyncthingBinary.getPath(), "--home=" + mContext.getFilesDir().toString(), "--no-browser"};
mCommand = new String[]{mSyncthingBinary.getPath(), "serve", "--no-browser"};
break;
case resetdatabase:
mCommand = new String[]{mSyncthingBinary.getPath(), "--home=" + mContext.getFilesDir().toString(), "--reset-database"};
mCommand = new String[]{mSyncthingBinary.getPath(), "debug", "reset-database"};
break;
case resetdeltas:
mCommand = new String[]{mSyncthingBinary.getPath(), "--home=" + mContext.getFilesDir().toString(), "--reset-deltas"};
mCommand = new String[]{mSyncthingBinary.getPath(), "serve", "--debug-reset-delta-idxs"};
break;
default:
throw new InvalidParameterException("Unknown command option");
@ -484,11 +484,16 @@ public class SyncthingRunnable implements Runnable {
// Set home directory to data folder for web GUI folder picker.
targetEnv.put("HOME", FileUtils.getSyncthingTildeAbsolutePath());
// Set config, key and database directory.
targetEnv.put("STHOMEDIR", mContext.getFilesDir().toString());
targetEnv.put("STTRACE", TextUtils.join(" ",
mPreferences.getStringSet(Constants.PREF_DEBUG_FACILITIES_ENABLED, new HashSet<>())));
targetEnv.put("STMONITORED", "1");
targetEnv.put("STNOUPGRADE", "1");
// Since Syncthing v2+: purge deletes from database after 1 year.
targetEnv.put("STDBDELETERETENTIONINTERVAL", "8766h");
// Workaround SyncthingNativeCode denied to read gatewayIP by Android 14+ restriction.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
final String gatewayIpV4 = getGatewayIpV4(mContext);

View File

@ -1,2 +1 @@
## What's Changed
* Fixed UI crash if index sequence number for a folder exceeds a limit. This affected a minority of users, especially Syncthing-Lite users. But if it happened, users were unable to export config and could no longer open the app.
Please read https://github.com/syncthing/syncthing/releases/tag/v2.0.0 to see details on the v2.0.0 milestone.

View File

@ -5,8 +5,8 @@ min-sdk = "21"
target-sdk = "36"
# App version
version-code = "1300003"
version-name = "1.30.0.3"
version-code = "2000000"
version-name = "2.0.0.0"
aboutLibraries = "12.2.4"
activity = "1.10.1"

View File

@ -332,12 +332,13 @@ for target in BUILD_TARGETS:
target['cc'].format(min_sdk),
)
# See why "-checklinkname=0" is required: https://github.com/wlynxg/anet?tab=readme-ov-file#how-to-build-with-go-1230-or-later
environ = os.environ.copy()
environ.update({
'GOPATH': module_dir,
'GO111MODULE': 'on',
'CGO_ENABLED': '1',
'EXTRA_LDFLAGS': '-buildid=',
'EXTRA_LDFLAGS': '-checklinkname=0',
})
subprocess.check_call([go_bin, 'mod', 'download'], cwd=syncthing_dir)

@ -1 +1 @@
Subproject commit 0945304a79d6bbaeac7fc2cc1b06f57d3cf66622
Subproject commit 5d8033343fd31963286395b009fa7ff0b18ee461