From 51fa993fc1042e53407c937dfd0aab1f6cb1a089 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Thu, 28 Nov 2024 21:42:13 +1100 Subject: [PATCH] Make it at least compile again --- .github/workflows/build_android.yml | 4 ++-- android/app/src/main/java/com/classicube/MainActivity.java | 4 +++- src/Window_Android.c | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_android.yml b/.github/workflows/build_android.yml index f2018661c..db90b98fd 100644 --- a/.github/workflows/build_android.yml +++ b/.github/workflows/build_android.yml @@ -79,8 +79,8 @@ jobs: $TOOLS_ROOT/aapt add -f obj/cc-unsigned.apk classes.dex lib/armeabi/libclassicube.so lib/armeabi-v7a/libclassicube.so lib/arm64-v8a/libclassicube.so lib/x86/libclassicube.so lib/x86_64/libclassicube.so # sign the apk with debug key (https://stackoverflow.com/questions/16711233/) cp obj/cc-unsigned.apk obj/cc-signed.apk - #jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore debug.keystore -storepass android -keypass android obj/cc-signed.apk androiddebugkey - $TOOLS_ROOT/apksigner sign --ks debug.keystore --ks-pass pass:android obj/cc-signed.apk + jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore debug.keystore -storepass android -keypass android obj/cc-signed.apk androiddebugkey + #$TOOLS_ROOT/apksigner sign --ks debug.keystore --ks-pass pass:android obj/cc-signed.apk # jarsigner -verbose # create aligned .apk file $TOOLS_ROOT/zipalign -f 4 obj/cc-signed.apk $ROOT_DIR/src/cc.apk diff --git a/android/app/src/main/java/com/classicube/MainActivity.java b/android/app/src/main/java/com/classicube/MainActivity.java index 51cd50876..81f00a674 100644 --- a/android/app/src/main/java/com/classicube/MainActivity.java +++ b/android/app/src/main/java/com/classicube/MainActivity.java @@ -432,7 +432,9 @@ public class MainActivity extends Activity try { CCMotionListener listener = new CCMotionListener(this); view.setOnGenericMotionListener(listener); - } catch { + } catch (Exception ex) { + // Unsupported on android 12 + } catch (NoClassDefFoundError ex) { // Unsupported on android 12 } } diff --git a/src/Window_Android.c b/src/Window_Android.c index 9942c4b76..32ad33b4e 100644 --- a/src/Window_Android.c +++ b/src/Window_Android.c @@ -10,6 +10,7 @@ #include #include #include +#include static ANativeWindow* win_handle; static cc_bool winCreated;