diff --git a/project/java/Settings.java b/project/java/Settings.java index fb0be675f..c878fcf14 100644 --- a/project/java/Settings.java +++ b/project/java/Settings.java @@ -643,7 +643,7 @@ public class Settings Log.i("SDL", "libSDL: setting envvar LANGUAGE to '" + lang + "'"); nativeSetEnv( "LANG", lang ); nativeSetEnv( "LANGUAGE", lang ); - // TODO: get current user name and set envvar USER, the API is not availalbe on Android 1.6 so I don't bother with this + nativeSetEnv( "ARCH", android.os.Build.CPU_ABI ); nativeSetEnv( "APPDIR", p.getFilesDir().getAbsolutePath() ); nativeSetEnv( "SECURE_STORAGE_DIR", p.getFilesDir().getAbsolutePath() ); nativeSetEnv( "LIBDIR", p.getApplicationInfo().nativeLibraryDir ); diff --git a/project/jni/application/xserver-debian/AndroidAppSettings.cfg b/project/jni/application/xserver-debian/AndroidAppSettings.cfg index a13acf8ed..87721d201 100644 --- a/project/jni/application/xserver-debian/AndroidAppSettings.cfg +++ b/project/jni/application/xserver-debian/AndroidAppSettings.cfg @@ -7,10 +7,10 @@ AppName="Debian" AppFullName=com.cuntubuntu # Application version code (integer) -AppVersionCode=191224 +AppVersionCode=200106 # Application user-visible version name (string) -AppVersionName="19.12.24" +AppVersionName="20.01.06" # Specify path to download application data in zip archive in the form 'Description|URL|MirrorURL^Description2|URL2|MirrorURL2^...' # If you'll start Description with '!' symbol it will be enabled by default, '!!' will also hide the entry from the menu, so it cannot be disabled @@ -20,7 +20,7 @@ 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^!!Loading image|:loading.gif:loading.gif^!!System overlay|:overlay.tar.xz:overlay-.tar.xz" +AppDataDownloadUrl="!!Library mapping|bin-map.zip^!!Data files|:data.tar.gz:data-2.tgz^!!Data files|:DroidSansMono.ttf:DroidSansMono.ttf^!!Loading image|:logo.png:logo.png^!!System overlay|:overlay.tar.xz:overlay-.tar.xz" # Reset SDL config when updating application to the new version (y) / (n) ResetSdlConfigForThisVersion=y @@ -269,7 +269,8 @@ APP_PLATFORM= # Specify architectures to compile, 'all' or 'y' to compile for all architectures. # Available architectures: armeabi-v7a arm64-v8a x86 x86_64 -MultiABI='x86_64' +#MultiABI='x86_64' +MultiABI='arm64-v8a' # Optional shared libraries to compile - removing some of them will save space # MP3 patents are expired, but libmad license is GPL, not LGPL @@ -298,7 +299,7 @@ AppSubdirsBuild='' AppBuildExclude='' # Application command line parameters, including app name as 0-th param -AppCmdline='XSDL -nohelp -screenbuttons -warndiskspacemb 1200 -exec $SECURE_STORAGE_DIR/usr/bin/xloadimage -onroot -fullscreen $UNSECURE_STORAGE_DIR/loading.gif ; logwrapper $SECURE_STORAGE_DIR/img/proot.sh bin/sh -c /startx.sh' +AppCmdline='XSDL -nohelp -screenbuttons -warndiskspacemb 1200 -exec $SECURE_STORAGE_DIR/usr/bin/xloadimage -onroot -fullscreen $UNSECURE_STORAGE_DIR/logo.png ; logwrapper $SECURE_STORAGE_DIR/img/proot.sh /startx.sh' # Screen size is used by Google Play to prevent an app to be installed on devices with smaller screens # Minimum screen size that application supports: (s)mall / (m)edium / (l)arge diff --git a/project/jni/application/xserver-debian/AndroidData/overlay-arm64-v8a.tar.xz b/project/jni/application/xserver-debian/AndroidData/overlay-arm64-v8a.tar.xz index 4873578d1..7f8b86c07 100644 Binary files a/project/jni/application/xserver-debian/AndroidData/overlay-arm64-v8a.tar.xz and b/project/jni/application/xserver-debian/AndroidData/overlay-arm64-v8a.tar.xz differ 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 index 676fcf846..b1b5f2135 100644 Binary files a/project/jni/application/xserver-debian/AndroidData/overlay-x86_64.tar.xz 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 8ec82a543..05f8dad31 100755 --- a/project/jni/application/xserver-debian/AndroidData/postinstall.sh +++ b/project/jni/application/xserver-debian/AndroidData/postinstall.sh @@ -7,6 +7,8 @@ echo "Extracting data files" cd $SECURE_STORAGE_DIR echo "./busybox tar xvJf $ANDROID_OBB_DIR/main.$OBB_VERSION.$ANDROID_PACKAGE_NAME.obb" ./busybox tar xvJf $ANDROID_OBB_DIR/main.$OBB_VERSION.$ANDROID_PACKAGE_NAME.obb +echo "./busybox unzip -p $ANDROID_PACKAGE_PATH assets/dist-debian-buster-$ARCH.tar.xz | ./busybox tar xvJ" +./busybox unzip -p $ANDROID_PACKAGE_PATH assets/dist-debian-buster-$ARCH.tar.xz | ./busybox tar xvJ echo "Extracting overlay data files" echo "./busybox tar xvJf $DATADIR/overlay.tar.xz" ./busybox tar xvJf $DATADIR/overlay.tar.xz @@ -15,11 +17,9 @@ cd $SECURE_STORAGE_DIR/img echo "Installation path: $SECURE_STORAGE_DIR/img" rm -f ./postinstall-img.sh ./proot.sh -ln -s ../usr/bin/postinstall-img.sh . -ln -s ../usr/bin/proot.sh . - -# ls -l . +ln -s $SECURE_STORAGE_DIR/usr/bin/postinstall-img.sh ./ +ln -s $SECURE_STORAGE_DIR/usr/bin/proot.sh ./ echo "Running postinstall-img.sh:" -./postinstall-img.sh +logwrapper ./postinstall-img.sh diff --git a/project/jni/application/xserver-debian/debian-image b/project/jni/application/xserver-debian/debian-image index c4a0dddd0..775db9342 160000 --- a/project/jni/application/xserver-debian/debian-image +++ b/project/jni/application/xserver-debian/debian-image @@ -1 +1 @@ -Subproject commit c4a0dddd033f0720f20ec6dba93accf3bdee7360 +Subproject commit 775db9342ec50adf61830ae6ad595df5b0d0f652 diff --git a/project/jni/application/xserver-debian/project-target-android-p.patch b/project/jni/application/xserver-debian/project-target-android-p.patch new file mode 100644 index 000000000..67a67e674 --- /dev/null +++ b/project/jni/application/xserver-debian/project-target-android-p.patch @@ -0,0 +1,19 @@ +diff --git a/project/app/build-template.gradle b/project/app/build-template.gradle +index 2953ce993..c0250f801 100644 +--- a/project/app/build.gradle ++++ b/project/app/build.gradle +@@ -1,12 +1,12 @@ + apply plugin: 'com.android.application' + + android { +- compileSdkVersion 29 ++ compileSdkVersion 28 + + defaultConfig { + applicationId "com.cuntubuntu" + minSdkVersion 16 // Must match version numbers in project/AndroidManifestTemplate.xml +- targetSdkVersion 29 ++ targetSdkVersion 28 + } + + buildTypes { diff --git a/project/jni/application/xserver-debian/project.patch b/project/jni/application/xserver-debian/project.patch deleted file mode 120000 index 7b70e7761..000000000 --- a/project/jni/application/xserver-debian/project.patch +++ /dev/null @@ -1 +0,0 @@ -../xserver/project.patch \ No newline at end of file diff --git a/project/jni/application/xserver-debian/readme.txt b/project/jni/application/xserver-debian/readme.txt index 405f32eb4..1462dec81 100644 --- a/project/jni/application/xserver-debian/readme.txt +++ b/project/jni/application/xserver-debian/readme.txt @@ -2,17 +2,18 @@ To build system image, download repo: https://github.com/pelya/debian-noroot -Install dependencies described in it's readme, -then launch commands: - -cd debian-noroot/img -./img-debian-jessie-armhf.sh -./img-debian-jessie-x86.sh -./img-debian-jessie--prepare-obb.sh - -This will create Debian system image dist-debian-jessie.tar.xz -Upload resulting system image somewhere, and change download URL inside -AndroidAppSettings.cfg, then recompile .apk file. +Follow it's readme to build system image. Then follow instructions here: https://github.com/pelya/commandergenius/tree/sdl_android/project/jni/application/xserver + +If you are releasing the app to Play Store, upload dist-debian-buster-arm64-v8a.tar.xz as 'main' OBB asset. + +If you are releasing standalone APK, copy dist-debian-buster-arm64-v8a.tar.xz to assets directory inside .apk zip archive: + +``` +mkdir assets +cp src/debian-image/img/dist-debian-buster-arm64-v8a.tar.xz assets/ +zip project/app/build/outputs/apk/release/app-release.apk assets/dist-debian-buster-arm64-v8a.tar.xz +apksigner sign --ks ~/.android/debug.keystore --ks-key-alias androiddebugkey --ks-pass pass:android project/app/build/outputs/apk/release/app-release.apk +``` diff --git a/project/jni/application/xserver/AndroidBuild.sh b/project/jni/application/xserver/AndroidBuild.sh index 69c89a5b3..b68df0dc5 100755 --- a/project/jni/application/xserver/AndroidBuild.sh +++ b/project/jni/application/xserver/AndroidBuild.sh @@ -85,6 +85,7 @@ cp -f $CURDIR/pulseaudio/$1/install/lib/pulseaudio/*.so ./ cp -f $CURDIR/pulseaudio/$1/install/lib/pulse-*/modules/*.so ./ cp -f $CURDIR/pulseaudio/$1/*/install/lib/*.so ./ cp -f $CURDIR/debian-image/proot-prebuilt/$1/* ./ +#cp -f $CURDIR/debian-image/dist-$1/* ./ cp -f $CURDIR/debian-image/dist/proot.sh ./ cp -f $CURDIR/debian-image/dist/postinstall-img.sh ./ cp -f $CURDIR/AndroidData/postinstall.sh ./ @@ -93,8 +94,6 @@ rm -f ../AndroidData/binaries-$1.zip rm -rf ../AndroidData/lib/$1 mkdir -p ../AndroidData/lib/$1 -#cp -a . ../AndroidData/lib/$1 - rm -r bin-map-$1.txt IDX=0 for BIN in *; do diff --git a/project/jni/application/xserver/readme.txt b/project/jni/application/xserver/readme.txt index a72eb446f..2da4bde47 100644 --- a/project/jni/application/xserver/readme.txt +++ b/project/jni/application/xserver/readme.txt @@ -17,3 +17,6 @@ git clone git@github.com:pelya/commandergenius.git sdl-android cd sdl-android git submodule update --init --recursive ./build.sh xserver + +Busybox is precompiled, taken from this repository: +https://github.com/pelya/busybox-android