diff --git a/make-all.bash b/make-all.bash index 6813b543..6bf5a82d 100755 --- a/make-all.bash +++ b/make-all.bash @@ -8,3 +8,5 @@ ./make-go.bash 386 ./make-syncthing.bash 386 +./make-go.bash arm64 +./make-syncthing.bash arm64 diff --git a/make-go.bash b/make-go.bash index 79c80d14..34cfeeb7 100755 --- a/make-go.bash +++ b/make-go.bash @@ -27,17 +27,18 @@ case "$1" in export GOARCH=arm export GOARM=5 ;; + arm64) + export GOOS=linux + export GOARCH=arm64 + export GOARM=8 + ;; 386) export GOOS=linux export GOARCH=386 export GO386=387 ;; - amd64) - export GOOS=linux - export GOARCH=amd64 - ;; *) - echo "Must specify either arm or 386 or amd64" + echo "Invalid architecture" exit 1 esac diff --git a/make-syncthing.bash b/make-syncthing.bash index d4b50188..303e89ba 100755 --- a/make-syncthing.bash +++ b/make-syncthing.bash @@ -13,6 +13,13 @@ case "$1" in export GOARM=5 export TARGETDIR=$MYDIR$JNIDIR/armeabi ;; + arm64) + export CGO_ENABLED=0 + export GOOS=linux + export GOARCH=arm64 + export GOARM=8 + export TARGETDIR=$MYDIR$JNIDIR/arm64-v8a + ;; 386) export CGO_ENABLED=0 export GOOS=linux @@ -20,14 +27,8 @@ case "$1" in export GO386=387 export TARGETDIR=$MYDIR$JNIDIR/x86 ;; - amd64) - export CGO_ENABLED=0 - export GOOS=linux - export GOARCH=amd64 - export TARGETDIR=$MYDIR$JNIDIR/x86_64 - ;; *) - echo "Must specify either arm or 386 or amd64" + echo "Invalid architecture" exit 1 esac diff --git a/src/main/java/com/nutomic/syncthingandroid/service/SyncthingRunnable.java b/src/main/java/com/nutomic/syncthingandroid/service/SyncthingRunnable.java index dfbfee6f..494ba60e 100644 --- a/src/main/java/com/nutomic/syncthingandroid/service/SyncthingRunnable.java +++ b/src/main/java/com/nutomic/syncthingandroid/service/SyncthingRunnable.java @@ -37,10 +37,7 @@ public class SyncthingRunnable implements Runnable { private static final String TAG_NICE = "SyncthingRunnableIoNice"; private static final String TAG_KILL = "SyncthingRunnableKill"; public static final String UNIT_TEST_PATH = "was running"; - /** - * Path to the native, integrated syncthing binary, relative to the data folder - */ - public static final String BINARY_NAME = "lib/libsyncthing.so"; + public static final String BINARY_NAME = "libsyncthing.so"; private static final int LOG_FILE_MAX_LINES = 1000; private static final AtomicReference mSyncthing = new AtomicReference<>(); @@ -63,7 +60,7 @@ public class SyncthingRunnable implements Runnable { */ public SyncthingRunnable(Context context, Command command) { mContext = context; - mSyncthingBinary = mContext.getApplicationInfo().dataDir + "/" + BINARY_NAME; + mSyncthingBinary = mContext.getApplicationInfo().nativeLibraryDir + "/" + BINARY_NAME; mLogFile = new File(mContext.getExternalFilesDir(null), "syncthing.log"); switch (command) { case generate: @@ -87,7 +84,7 @@ public class SyncthingRunnable implements Runnable { */ public SyncthingRunnable(Context context, String[] manualCommand) { mContext = context; - mSyncthingBinary = mContext.getApplicationInfo().dataDir + "/" + BINARY_NAME; + mSyncthingBinary = mContext.getApplicationInfo().nativeLibraryDir + "/" + BINARY_NAME; mCommand = manualCommand; mLogFile = new File(mContext.getExternalFilesDir(null), "syncthing.log"); }