Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Compatibility] Obfucation/ProGuard Android #325

Open
Clemon-R opened this issue Feb 20, 2025 · 0 comments
Open

[Compatibility] Obfucation/ProGuard Android #325

Clemon-R opened this issue Feb 20, 2025 · 0 comments

Comments

@Clemon-R
Copy link

Clemon-R commented Feb 20, 2025

Hello everyone,

I use the package on huge scale (around 1millions devices) i have a big problem, for months about the obfucation on Android, where some stuff related to FileProvider was missing.

The consequence, was that when i tried opening a file, the app just crashed without any warning or error in flutter.
Sometimes it didn't even report in Firebase.

Here the error message :
Fatal Exception: java.lang.IncompatibleClassChangeError: Class 'android.content.res.XmlBlock$Parser' does not implement interface 'n8.a' in call to 'int n8.a.next()' (declaration of 'androidx.core.content.FileProvider' appears in base.apk) at androidx.core.content.FileProvider.parsePathStrategy(FileProvider.java:19) at androidx.core.content.FileProvider.getPathStrategy(FileProvider.java:11) at androidx.core.content.FileProvider.getUriForFile(FileProvider.java:1) at com.crazecoder.openfile.utils.FileUtil.getFileUri(FileUtil.java:48) at com.crazecoder.openfile.OpenFilePlugin.startActivity(OpenFilePlugin.java:24)

After tons of trouble, and the help of Gemini, i found the rules to add to pro guards to have it just now (i trieds tons of rules before, but here the one that work in my case)

`-keep public class androidx.core.content.FileProvider { *; }
-keepnames class * implements android.os.Parcelable
-keepclassmembers class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}

-keep class android.content.res.XmlBlock { ; }
-keep class android.content.res.XmlBlock$Parser { ; }
-keep class org.xmlpull.
{ ; }
-keep class android.content.res.XmlResourceParser {
;}

-keepclassmembers class **.R$xml {
public static ;
}
-keep public class **.R$xml`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant