diff --git a/android/launcher/app/build.gradle b/android/launcher/app/build.gradle index 910c2132..e4a40446 100644 --- a/android/launcher/app/build.gradle +++ b/android/launcher/app/build.gradle @@ -3,6 +3,7 @@ plugins { } android { + namespace 'com.revc.game' compileSdk 35 @@ -13,36 +14,81 @@ android { versionCode 1 versionName "reVC-0.0.1" + ndkVersion '27.2.12479018' + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - externalNativeBuild { - cmake { - cppFlags '-std=c++11' - } + + ndk { + abiFilters "armeabi-v7a"/*, "arm64-v8a"*/ } } buildTypes { release { - minifyEnabled false + signingConfig signingConfigs.debug + + externalNativeBuild { + cmake { + cppFlags '-O3', '-fvisibility=hidden' + } + } + + debuggable false + minifyEnabled true + shrinkResources true + jniDebuggable false + renderscriptDebuggable false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } + + debug { + signingConfig signingConfigs.debug + + externalNativeBuild { + cmake { + cppFlags '-g', '-DDEBUG' + } + } + + debuggable true + minifyEnabled false + jniDebuggable true + renderscriptDebuggable true + } } + + packagingOptions { + jniLibs.excludes += ['META-INF/*'] + resources.excludes += ['META-INF/*'] + } + compileOptions { sourceCompatibility JavaVersion.VERSION_11 targetCompatibility JavaVersion.VERSION_11 } + externalNativeBuild { cmake { path file('CMakeLists.txt') version '3.22.1' } } + buildFeatures { viewBinding true + buildConfig = true + } + + sourceSets { + main { + jniLibs.srcDir 'jniLibs' + } } } dependencies { + implementation fileTree(dir: "libs", include: ["*.jar"]) implementation libs.appcompat implementation libs.material diff --git a/android/launcher/app/proguard-rules.pro b/android/launcher/app/proguard-rules.pro index 481bb434..69fef618 100644 --- a/android/launcher/app/proguard-rules.pro +++ b/android/launcher/app/proguard-rules.pro @@ -14,8 +14,48 @@ # Uncomment this to preserve the line number information for # debugging stack traces. -#-keepattributes SourceFile,LineNumberTable +# -keepattributes SourceFile,LineNumberTable # If you keep the line number information, uncomment this to # hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file +-renamesourcefileattribute SourceFile + +-dontusemixedcaseclassnames +-dontskipnonpubliclibraryclasses +-verbose + +# If you want to enable optimization, you should include the comenta o proguard pra ve +# following: + -optimizations !code/simplification/arithmetic,!code/simplification/cast,!field/*,!class/merging/* + -optimizationpasses 5 + -allowaccessmodification + +# Specify the package name to apply string encryption + -keeppackagenames com.revc.game + +-keepattributes Signature +-keepattributes *Annotation* + + -dontwarn com.revc.game.MainActivity* + -keep class com.revc.game.MainActivity { *; } + + -dontwarn androidx.** + -keep class androidx.** { *; } + + -dontwarn org.ini4j.** + -keep class org.ini4j.** { *; } + + -repackageclasses 'a' + + -keepattributes Exceptions, InnerClasses, Signature, Deprecated, SourceFile, + LineNumberTable, *Annotation*, EnclosingMethod + -dontwarn android.webkit.JavascriptInterface + + -dontwarn org.jetbrains.annotations.** + +-assumenosideeffects class android.util.Log { + public static *** d(...); + public static *** v(...); + public static *** w(...); + public static *** i(...); +} diff --git a/android/launcher/app/src/main/AndroidManifest.xml b/android/launcher/app/src/main/AndroidManifest.xml index 6d17f060..faf2b805 100644 --- a/android/launcher/app/src/main/AndroidManifest.xml +++ b/android/launcher/app/src/main/AndroidManifest.xml @@ -1,8 +1,59 @@ + xmlns:tools="http://schemas.android.com/tools" + tools:ignore="MissingLeanbackLauncher"> + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -21,6 +75,20 @@ + + + + + + \ No newline at end of file diff --git a/android/launcher/app/src/main/java/com/revc/game/MainActivity.java b/android/launcher/app/src/main/java/com/revc/game/MainActivity.java index 15a3b43b..1b8558ee 100644 --- a/android/launcher/app/src/main/java/com/revc/game/MainActivity.java +++ b/android/launcher/app/src/main/java/com/revc/game/MainActivity.java @@ -11,7 +11,7 @@ public class MainActivity extends AppCompatActivity { // Used to load the 'game' library on application startup. static { - System.loadLibrary("revc"); + //System.loadLibrary("revc"); } private ActivityMainBinding binding; @@ -25,12 +25,12 @@ public class MainActivity extends AppCompatActivity { // Example of a call to a native method TextView tv = binding.sampleText; - tv.setText(stringFromJNI()); + // tv.setText(stringFromJNI()); } /** * A native method that is implemented by the 'game' native library, * which is packaged with this application. */ - public native String stringFromJNI(); + //public native String stringFromJNI(); } \ No newline at end of file diff --git a/android/launcher/app/src/main/res/xml/provider_paths.xml b/android/launcher/app/src/main/res/xml/provider_paths.xml new file mode 100644 index 00000000..fe11ab25 --- /dev/null +++ b/android/launcher/app/src/main/res/xml/provider_paths.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/cmake/android/AndroidConfig.cmake b/cmake/android/AndroidConfig.cmake new file mode 100644 index 00000000..e69de29b