diff --git a/project/java/Settings.java b/project/java/Settings.java index 7fc8c4b4f..fb0be675f 100644 --- a/project/java/Settings.java +++ b/project/java/Settings.java @@ -75,6 +75,7 @@ import android.widget.Toast; import android.content.pm.PackageManager; import android.os.Build; import android.content.Intent; +import android.content.pm.PackageInfo; // TODO: too much code here, split into multiple files, possibly auto-generated menus? @@ -667,6 +668,12 @@ public class Settings try { nativeSetEnv( "ANDROID_APP_NAME", p.getString(p.getApplicationInfo().labelRes) ); } catch (Exception eeeeee) {} + try { + PackageInfo pInfo = p.getPackageManager().getPackageInfo(p.getPackageName(), 0); + nativeSetEnv( "ANDROID_PACKAGE_VERSION_NAME", pInfo.versionName ); + nativeSetEnv( "ANDROID_PACKAGE_VERSION_CODE", String.valueOf(pInfo.versionCode) ); + } catch (PackageManager.NameNotFoundException eeeeeeee) { + } Log.d("SDL", "libSDL: Is running on OUYA: " + p.isRunningOnOUYA()); if( p.isRunningOnOUYA() ) { diff --git a/project/jni/application/xserver-debian/AndroidAppSettings.cfg b/project/jni/application/xserver-debian/AndroidAppSettings.cfg index ff4b9f321..388d283c4 100644 --- a/project/jni/application/xserver-debian/AndroidAppSettings.cfg +++ b/project/jni/application/xserver-debian/AndroidAppSettings.cfg @@ -20,13 +20,13 @@ AppVersionName="19.12.24" # You can specify Google Play expansion files in the form 'obb:main.12345' or 'obb:patch.12345' where 12345 is the app version for obb file # You can use .zip.xz archives for better compression, but you need to add 'lzma' to CompiledLibraries # Generate .zip.xz files like this: zip -0 -r data.zip your-data/* ; xz -8 data.zip -AppDataDownloadUrl="!!Library mapping|bin-map.zip^!!Data files|:data.tar.gz:data-2.tgz^!!Data files|:DroidSansMono.ttf:DroidSansMono.ttf^!!Postinstall script|:postinstall.sh:postinstall.sh^!!Loading image|:loading.gif:loading.gif" +AppDataDownloadUrl="!!Library mapping|bin-map.zip^!!Data files|:data.tar.gz:data-2.tgz^!!Data files|:DroidSansMono.ttf:DroidSansMono.ttf^!!Postinstall script|:postinstall.sh:postinstall.sh^!!Loading image|:loading.gif:loading.gif^!!System overlay|:overlay.tar.xz:overlay-.tar.xz" # Reset SDL config when updating application to the new version (y) / (n) ResetSdlConfigForThisVersion=y # Delete application data files when upgrading (specify file/dir paths separated by spaces) -DeleteFilesOnUpgrade="%" +DeleteFilesOnUpgrade="busybox usr tmp pulseaudio.conf libsdl-DownloadFinished-0.flag libsdl-DownloadFinished-1.flag libsdl-DownloadFinished-2.flag libsdl-DownloadFinished-3.flag libsdl-DownloadFinished-4.flag libsdl-DownloadFinished-5.flag" # Here you may type readme text, which will be shown during startup. Format is: # Text in English, use \\\\n to separate lines (that's four backslashes)^de:Text in Deutsch^ru:Text in Russian^button:Button that will open some URL:http://url-to-open/ diff --git a/project/jni/application/xserver-debian/AndroidData/overlay-x86_64.tar.xz b/project/jni/application/xserver-debian/AndroidData/overlay-x86_64.tar.xz new file mode 100644 index 000000000..9190a1c2c Binary files /dev/null and b/project/jni/application/xserver-debian/AndroidData/overlay-x86_64.tar.xz differ diff --git a/project/jni/application/xserver-debian/AndroidData/postinstall.sh b/project/jni/application/xserver-debian/AndroidData/postinstall.sh index 8903ef354..51b218672 100755 --- a/project/jni/application/xserver-debian/AndroidData/postinstall.sh +++ b/project/jni/application/xserver-debian/AndroidData/postinstall.sh @@ -1,40 +1,13 @@ #!/system/bin/sh +#OBB_VERSION=191224 +OBB_VERSION=$ANDROID_PACKAGE_VERSION_CODE + echo "Extracting data files" cd $SECURE_STORAGE_DIR -./busybox tar xzf $UNSECURE_STORAGE_DIR/data-1.tar.gz -rm -f $UNSECURE_STORAGE_DIR/data-1.tar.gz -ARCH=`getprop ro.product.cpu.abi` -echo "Detected architecture $ARCH" -# We only support armeabi-v7a and x86 -case $ARCH in - armeabi-v7a) - ;; - x86) - ;; - arm64-v8a) - ARCH=armeabi-v7a - ;; - arm64_v8a) - ARCH=armeabi-v7a - ;; - x86_64) - ARCH=x86 - ;; - x86-64) - ARCH=x86 - ;; - *) - echo "=== ERROR ERROR ERROR ===" - echo "Unsupported architecture: $ARCH" - sleep 10000 - exit 1 - ;; -esac -echo "Copying files for architecture $ARCH" -./busybox cp -af img-$ARCH/. img/ -echo "Removing files for other architectures" -./busybox rm -rf img-armeabi-v7a img-x86 +./busybox tar xvJf $ANDROID_OBB_DIR/main.$OBB_VERSION.$ANDROID_PACKAGE_NAME.obb +echo "Extracting overlay data files" +./busybox tar xvJf $DATADIR/overlay.tar.xz cd $SECURE_STORAGE_DIR/img echo "Installation path: $SECURE_STORAGE_DIR/img" ./postinstall.sh diff --git a/project/jni/application/xserver-debian/debian-image b/project/jni/application/xserver-debian/debian-image index 7adcd0b94..542f8256a 160000 --- a/project/jni/application/xserver-debian/debian-image +++ b/project/jni/application/xserver-debian/debian-image @@ -1 +1 @@ -Subproject commit 7adcd0b949a91b56d90062975f684d38463e39a8 +Subproject commit 542f8256ae540b058cf31e20a1875447f604c38b diff --git a/project/jni/application/xserver/.gitignore b/project/jni/application/xserver/.gitignore index 8b4cf3c1c..8faaf6159 100644 --- a/project/jni/application/xserver/.gitignore +++ b/project/jni/application/xserver/.gitignore @@ -1,3 +1,5 @@ *.o -AndroidData/binaries-* tmp-* +/AndroidData/binaries-* +/AndroidData/bin-map.zip +/AndroidData/lib diff --git a/project/jni/application/xserver/gfx.c b/project/jni/application/xserver/gfx.c index 360ddb305..e7fe2e6f5 100644 --- a/project/jni/application/xserver/gfx.c +++ b/project/jni/application/xserver/gfx.c @@ -237,7 +237,7 @@ static int unpackFiles(const char *archive, const char *script, const char *dele break; if( strchr(buf, '\n') != NULL ) strchr(buf, '\n')[0] = 0; - __android_log_print(ANDROID_LOG_INFO, "XSDL", "> %s", buf); + __android_log_print(ANDROID_LOG_VERBOSE, "XSDL", "> %s", buf); strncpy(unpackLog[3], unpackLog[2], sizeof(unpackLog[0]) - 4); strncpy(unpackLog[2], unpackLog[1], sizeof(unpackLog[0]) - 4); strncpy(unpackLog[1], unpackLog[0], sizeof(unpackLog[0]) - 4);