Debian: updated postinstall script

This commit is contained in:
Sergii Pylypenko
2019-12-31 19:52:28 +02:00
parent 12a164f19c
commit ae4e375c8e
7 changed files with 20 additions and 38 deletions

View File

@@ -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() )
{

View File

@@ -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-<ARCH>.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/

View File

@@ -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

View File

@@ -1,3 +1,5 @@
*.o
AndroidData/binaries-*
tmp-*
/AndroidData/binaries-*
/AndroidData/bin-map.zip
/AndroidData/lib

View File

@@ -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);