Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions build-extras.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@ android {
packagingOptions {
pickFirst 'META-INF/versions/9/OSGI-INF/MANIFEST.MF'
}
buildTypes {
release {
//might cause ClassNotFoundException errors
//to fix those errors you need to either put @Keep on the class/feild or add a entry in progrud rules file
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
Comment thread
RohitKushvaha01 marked this conversation as resolved.
}
}
}

configurations {
Expand Down
5 changes: 5 additions & 0 deletions config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,11 @@
<hook type="before_prepare" src="hooks/restore-cordova-resources.js" />
<hook type="before_prepare" src="hooks/modify-java-files.js" />
<hook type="after_prepare" src="hooks/post-process.js" />



<resource-file src="build-extras.gradle" target="app/build-extras.gradle" />
<resource-file src="proguard-rules.pro" target="app/proguard-rules.pro" />
</platform>
<preference name="AndroidBlacklistSecureSocketProtocols" value="SSLv3,TLSv1" />
</widget>
27 changes: 27 additions & 0 deletions proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Keep Cordova classes
-keep class org.apache.cordova.** { *; }

# Cordova discovers plugins by class name from config.xml and instantiates them
# reflectively, and plugins can dispatch actions by method name through
# reflection too (e.g. Ftp.execute() uses
# getClass().getDeclaredMethod(action, JSONArray, CallbackContext)).
# Without keeping the members, R8 strips methods such as connect()/listDirectory()
# and those plugin calls fail at runtime with NoSuchMethodException.
-keep public class * extends org.apache.cordova.CordovaPlugin { *; }

# WebView JS bridge methods are invoked by name from JavaScript.
-keepclassmembers class * {
@android.webkit.JavascriptInterface <methods>;
}

# cordova-plugin-buildinfo resolves the app's BuildConfig reflectively:
# Class.forName(packageName + ".BuildConfig") and c.getField(fieldName).
-keep class **.BuildConfig { *; }

# maverick-synergy (SSH/SFTP) references java.lang.management from
# Utils.generateThreadDump(), which does not exist on Android. That method is
# never reached on Android, so ignore the missing Java SE classes.
-dontwarn java.lang.management.**

# Keep Javascript Interface attributes
-keepattributes *Annotation*,EnclosingMethod,InnerClasses,Signature