diff --git a/Makefile b/Makefile
index 70297cb..2e853a8 100644
--- a/Makefile
+++ b/Makefile
@@ -16,7 +16,7 @@ test: test-go ## Executing tests
test-go: deps
( set -o allexport && source .env && set +o allexport && go test -v -count=1 $(GOTEST_ARGS) ./... )
-build: build-desktop build-mobile build-client ## Build artefacts
+build: build-desktop build-android build-client ## Build artefacts
build-desktop: deps ## Build executable
CGO_ENABLED=0 go build \
@@ -30,12 +30,12 @@ build-client: deps ## Build executable
-o ./bin/client \
./cmd/client
-build-mobile: tools/gogio/bin/gogio deps ## Build executable
+build-android: tools/gogio/bin/gogio deps ## Build executable
mkdir -p dist
GOOS=android CGO_CFLAGS="-I${JDK_PATH}/include -I${JDK_PATH}/include/linux -w" tools/gogio/bin/gogio -target android -buildmode archive -o android/app/libs/mobile.aar -x ./cmd/mobile
( cd android && ./gradlew assembleDebug )
-install-android: build-mobile
+install-android: build-android
adb install android/app/build/outputs/apk/debug/app-debug.apk
adb shell monkey -p com.cadoles.arcast_player -c android.intent.category.LAUNCHER 1
diff --git a/android/app/libs/mobile.aar b/android/app/libs/mobile.aar
index 21aee58..f591fe0 100644
Binary files a/android/app/libs/mobile.aar and b/android/app/libs/mobile.aar differ
diff --git a/android/app/libs/safedata_android.jar b/android/app/libs/safedata_android.jar
new file mode 100644
index 0000000..8f6ee1f
Binary files /dev/null and b/android/app/libs/safedata_android.jar differ
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index c7be3e8..6f72f73 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -6,8 +6,11 @@
-
-
+
+
+
+
+
0 {
+ instanceID = string(instanceIDSecret.Data)
+ } else {
+ instanceID = server.NewRandomInstanceID()
+
+ instanceIDSecret.Identifier = instanceIDSecretIdentifier
+ instanceIDSecret.Data = []byte(instanceID)
+ instanceIDSecret.Description = "Arcast player instance identifier"
+
+ if err := safe.Set(instanceIDSecret); err != nil {
+ return "", errors.Wrapf(err, "could not save instance id secret")
+ }
+ }
+
+ return instanceID, nil
+}