Hi @paulhsu ,
you should only need to change the following:
- disable R8 in
gradle.properties
- add the ProGuard plugin to the buildscripts dependencies in the root
build.gradle
- you can also ignore the warnings in the
omniNotes/proguard-rules.txt
file as if you don’t add this the build will fail telling you to correct the warnings
diff --git a/build.gradle b/build.gradle
index 1d186908..8465e4fe 100644
--- a/build.gradle
+++ b/build.gradle
@@ -26,6 +26,7 @@ buildscript {
classpath 'com.android.tools.build:gradle:4.1.1'
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:3.0"
classpath 'com.adarshr:gradle-test-logger-plugin:2.1.0'
+ classpath 'com.guardsquare:proguard-gradle:7.0.1'
}
// Exclude the version that the android plugin depends on.
configurations.classpath.exclude group: 'com.android.tools.external.lombok'
diff --git a/gradle.properties b/gradle.properties
index c640714a..68a18599 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -42,3 +42,6 @@ CRASH_REPORTING_URL=
VERSION_CHECK_URL=
# Google Maps API key to provide addresses autocompletion feature
MAPS_API_KEY=
+
+android.enableR8=false
+android.enableR8.libraries=false
diff --git a/omniNotes/proguard-rules.txt b/omniNotes/proguard-rules.txt
index 3b37fb6c..3ad677c7 100644
--- a/omniNotes/proguard-rules.txt
+++ b/omniNotes/proguard-rules.txt
@@ -5,6 +5,7 @@
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
+-ignorewarnings
# The -optimizations option disables some arithmetic simplifications that Dalvik 1.0 and 1.5 can't handle.
-optimizations !code/simplification/arithmetic