deptofdefense / AndroidTacticalAssaultKit-CIV

Other
35 stars 17 forks source link

Updated ATAK to java 11 #280

Closed krish0902 closed 1 month ago

krish0902 commented 1 year ago

The changes in this PR is for the issue #237 ATAK update to java 11. Before upgrading to Java 11: 1) Javah is used for generating native headers 2) Used default implementation of proguard rules available with AGP < 7 which is enabled with minifyEnabled flag is used and R8 was disabled by default in gradle.properties 3) Minify with Proguard generated single jar file in build/intermediates folder

After upgrading to Java 11: 1) Javac is used for generating native headers. Had to upgrade javah gradle to javac gradle file, and made sure that we can still use the javah.properties (renamed as javac.properties). Need to add @Native to generate header files for some of the java classes as they don't contain any native method. 2) In AGP > 7 , we cannot use proguard rules as before and when minifyEnabled flag is true, we cannot disable R8 by setting it to false in gradle.properties. We have to use new proguard plugin which generates the jar files. https://www.guardsquare.com/blog/using-proguard-with-the-android-gradle-plugin In this way we achieve the same functionality of proguard even after AGP > 7 and disable R8. 3) The transformClassesAndResourcesWithProguardTransformForCivBuildType task which generates multiple jar files, these are combined in combineJarsBuildType tasks to create a single jar as before. Verified that the contents of the new jar are same as the one generated in the old implementation. This changes helped MSI Android devices to run ATAK build using Java 11

bisgroves commented 1 year ago

4.9 and later makes use of AGP > 7. This intent of this patch should now be considered resolved.