From 352967c8b8b308785bb3232448b13e263c09df7b Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Thu, 26 Sep 2024 22:40:17 +0800 Subject: [PATCH] update proguard, fix expected stack map table for method with non-linear control flow --- CONTRIBUTING.md | 62 +++++++--------------------------- forge-gui-android/pom.xml | 18 ---------- forge-gui-android/proguard.cfg | 9 ++--- forge-gui-desktop/pom.xml | 2 +- 4 files changed, 18 insertions(+), 73 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f10cf418bab..57db4c66287 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,7 +7,7 @@ Dev instructions here: [Getting Started](https://github.com/Card-Forge/forge/wik ## Requirements / Tools - you favourite Java IDE (IntelliJ, Eclipse, VSCodium, Emacs, Vi...) -- Java JDK 8 or later (some IDEs such as Eclipse require JDK11+, whereas the Android build currently only works with JDK8) +- Java JDK 17 or later - Git - Git client (optional) - Maven @@ -46,9 +46,9 @@ At this time, Eclipse is not the recommended IDE for Forge development. - Clone your forked repo to your local machine. -- Make sure the Java SDK is installed -- not just the JRE. Java 8 or newer required. If you execute `java -version` at the shell or command prompt, it should report version 1.8 or later. +- Make sure the Java SDK is installed -- not just the JRE. Java 17 or newer required. If you execute `java -version` at the shell or command prompt, it should report version 17 or later. -- Install Eclipse 2018-12 or later for Java. Launch it. +- Install Eclipse 2021-12 or later for Java. Launch it. - Create a workspace. Go to the workbench. Right-click inside of Package Explorer > Import... > Maven > Existing Maven Projects > Navigate to root path of the local forge repo and ensure everything is checked > Finish. @@ -79,7 +79,7 @@ This is the configuration used for doing mobile development using the Windows / ### Eclipse / Android SDK Integration -Google no longer supports Android SDK releases for Eclipse. That said, it is still possible to build and debug Android platforms. +Google no longer supports Android SDK releases for Eclipse. use IntelliJ. #### Android SDK @@ -96,68 +96,30 @@ TBD #### Android Plugin for Eclipse -Google's last plugin release does not work completely with target's running Android 7.0 or later. Download the ADT-24.2.0-20160729.zip plugin -from: https://github.com/khaledev/ADT/releases - -In Eclipse go to: Help > Install New Software... > Add > Name: ADT Update, Click on the "Archive:" button and navigate to the downloaded ADT-24.2.0-20160729.zip file > Add. Install all "Developer Tools". Eclipse -should restart and prompt you to run the SDK Manager. Launch it and continue to the next steps below. +TBD #### Android Platform -In Eclipse, if the SDK Manager is not already running, go to Window > Android SDK Manager. Install the following options / versions: +In Intellij, if the SDK Manager is not already running, go to Tools > Android > Android SDK Manager. Install the following options / versions: -- Android SDK Build-tools 26.0.1 -- Android 8.0.0 (API 26) SDK Platform -- Google USB Driver (in case your phone is not detected by ADB) - -Note that this will populate additional tools in the Android SDK install path extracted above. +- Android SDK Build-tools 34.0.0 +- Android 14 (API 34) SDK Platform #### Proguard update -The Proguard included with the Android SDK Build-tools is outdated and does not work with Java 1.8. Download Proguard 6.0.3 or later (last tested with 7.0.1) from https://github.com/Guardsquare/proguard -- Go to the Android SDK install path. Rename the tools/proguard/ path to tools/proguard-4.7/. - -- Extract your Proguard version to the Android SDK install path under tools/. You will need to either rename the dir proguard- to proguard/ or, if your filesystem supports it, use a symbolic link (the later is highly recommended), such as `ln -s proguard proguard-`. +Proguard 7.5.0 is included with the project (proguard.jar) under forge-gui-android > tools and supports Java 17. #### Android Build -The Eclipse plug-ins do NOT support building things for Android. They do however allow you to use the debugger so you can still set breakpoints and trace -things out. The steps below show how to generate a debug Android build. - -1) Create a Maven build for the forge top-level project. Right-click on the forge project. Run as.. > Maven build... - - On the Main tab, set Goals: clean install - -2) Run forge Maven build. If everything built, you should see "BUILD SUCCESS" in the Console View. - -3) Right-click on the forge-gui-android project. Run as.. > Maven build... - - - On the Main tab, set Goals: install, Profiles: android-debug - - On the Environment tab, you may need to define the variable ANDROID_HOME with the value containing the path to your Android SDK installation. For example, Variable: ANDROID_HOME, Value: Your Android SDK install path here. - -4) Run the forge-gui-android Maven build. This may take a few minutes. If everything worked, you should see "BUILD SUCCESS" in the Console View. - -Assuming you got this far, you should have an Android forge-android-[version].apk in the forge-gui-android/target path. +TBD #### Android Deploy -You'll need to have the Android SDK install path platform-tools/ path in your command search path to easily deploy builds. - -- Open a command prompt. Navigate to the forge-gui-android/target/ path. - -- Connect your Android device to your dev machine. - -- Ensure the device is visible using `adb devices` - -- Remove the old Forge install if present: `adb uninstall forge.app` - -- Install the new apk: `adb install forge-android-[version].apk` +TBD #### Android Debugging -Assuming the apk is installed, launch it from the device. - -In Eclipse, launch the DDMS. Window > Perspective > Open Perspective > Other... > DDMS. You should see the forge app in the list. Highlight the app, click on the green debug button and a -green debug button should appear next to the app's name. You can now set breakpoints and step through the source code. +TBD ### Windows / Linux SNAPSHOT build diff --git a/forge-gui-android/pom.xml b/forge-gui-android/pom.xml index 06292584dd2..35395f44770 100644 --- a/forge-gui-android/pom.xml +++ b/forge-gui-android/pom.xml @@ -74,24 +74,6 @@ system ${pom.basedir}/libs/relinker.jar - - - org.apache.httpcomponents - httpclient - 4.5.14 - - - commons-codec - commons-codec - - - - - - commons-codec - commons-codec - 1.17.1 - forge forge-core diff --git a/forge-gui-android/proguard.cfg b/forge-gui-android/proguard.cfg index e4109c95444..cd7a0392e29 100644 --- a/forge-gui-android/proguard.cfg +++ b/forge-gui-android/proguard.cfg @@ -1,9 +1,10 @@ -dontobfuscate --optimizationpasses 3 +#-optimizationpasses 3 -dontusemixedcaseclassnames -dontskipnonpubliclibraryclasses --dontpreverify +#-dontpreverify -verbose +-android # https://stackoverflow.com/a/32615580 -optimizations !code/simplification/*,!field/*,!class/merging/*,!code/allocation/variable,!library/gson,!class/unboxing/enum @@ -104,7 +105,7 @@ -keep public class com.android.vending.licensing.ILicensingService -keep public class * extends com.badlogic.gdx.Application --keepclasseswithmembernames class * { +-keepclasseswithmembernames,includedescriptorclasses class * { native ; } @@ -129,4 +130,4 @@ public static final android.os.Parcelable$Creator *; } --keepattributes LineNumberTable,SourceFile +-keepattributes *Annotation*,EnclosingMethod,InnerClasses,LineNumberTable,Signature,SourceFile diff --git a/forge-gui-desktop/pom.xml b/forge-gui-desktop/pom.xml index 7c4f5f5d6f7..e6f878d0038 100644 --- a/forge-gui-desktop/pom.xml +++ b/forge-gui-desktop/pom.xml @@ -332,7 +332,7 @@ com.sipgate mp3-wav - 1.0.3 + 1.0.4 com.googlecode.soundlibs