I currently have an Android App that is using Firebase Auth. After google login, I get a FirebaseUser object. If I set a breakpoint and look at the object. I see obfuscated objects and values. See image:
Proguard is disabled for debug so I'm guessing that is not the issue:
buildTypes {
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
Anyone know what I might be doing wrong? Any help is much appreciated!
Firebase library files are obsuscated themselves. You cannot really do anything about it. I guess Google does not want to make everything from their libraries public due to security reasons or using the library incorrectly.
Related
I got this warning message:
This App Bundle contains Java/Kotlin code, which might be obfuscated. We recommend you upload a deobfuscation file to make your crashes and ANRs easier to analyze and debug
what does it mean? what is the shortest solution for this?
Seems like it's a warning message coming from the new play console, you can solve it just by setting your minimum api level to 29 or even better by uploading the retrace mapping file as described here.
Enable minify :
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
After building apk/app bundle you can find /app/build/outputs/mapping/release/mapping.txt file . New console will allow you to upload mapping.txt along with your apk or bundle. You can find this option from App bundles and APKs menus.(According to this)
Just changing minifyEnabled to true worked for me
You can solve this by just enabling minify in your build. gradle(app) file:
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
Just enable minify in your build.gradle(app) file:
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
proguard-android-optimize.txt sometimes is unsupported so using the following is safer (see this):
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
So iv'e been enabling Pro-Guard to a project and after building the apk i decompiled it to make sure Pro-Guard did he's job and notices that it adds, for example, to the BaseAdapter class -
/* compiled from: BaseAdapter */
See picture -
Now I'm asking, doesn't it lose the point of the Pro-Guard if it says what class that was?
Is there any way to tell the Pro-Guard not to add this info line at all the classes?
My code where i added Pro-Guard -
buildTypes {
debug {
debuggable true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
shrinkResources true
}
release {
signingConfig signingConfigs.somethingsomething
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
shrinkResources true
}
}
Thanks.
Proguard is not adding this line.
/* compiled from: BaseAdapter */
The decompiler is doing mapping of obfuscated name with original name. You are seeing it as you might be using jadx or online service like this
You can try using dex2jar and jd-gui to look at decompiled code. This line will not be present there.
Make sure that 'proguard-rules.pro' file does not have following attributes in it.
-keepattributes SourceFile
If you add this statement no decompiler will be able make this mapping.
Before I release the app, I am trying to test whether there will be any changes(methods, variables removed) if I code shrink with Instant run the app. I am following this Enable code shrinking with Instant Run but it does not show any signs in my code that was removed or changed.
android {
buildTypes {
debug {
minifyEnabled true
useProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
}
Is there any way to check if there are changes made?
You should use Shrinking options -printUsage and it will tell you dead code, which eventually will be removed during shrinking.
-printusage [filename]
Specifies to list dead code of the input class files. The list is printed to the standard output or to the given file. For example, you can list the unused code of an application. Only applicable when shrinking.
android {
...
buildTypes {
release {
shrinkResources true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
}
This question might seem like a "duplicate question" but I've been looking at the same issue in S.O. and Google and I haven't found anything so before downvoting please read the question closely.
Inside my buildTypes (build.gradle) I want to enable proguard only for release mode, so I set inside debug block minifyEnabled false but if I put a breakpoint in debug mode it's skipped, otherwise if I set minifyEnabled false also inside release block all works fine.
Just tried clean, rebuild, invalidate cache. Nothing seem to works.
This is my buildTypes block:
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
Has someone encountered the same problem?
Thank you very much for your time and assistance in this matter.
Flag minifyEnabled stays for ProGuard, and it's turned off by default. So, in default setup both debug and release builds aren't using ProGuard, and parameter proguardFiles is effectively ignored
I activated the resouce shrinking in my build.gradle but now my embeded wearable app is stripped out. How can I avoid that my micro app is removed, because it is unused?
Skipped unused resource res/raw/android_wear_micro_apk.apk: 382310 bytes
Since I want to shrink the other not used resouces I'm using this DSL:
buildTypes {
release {
shrinkResources true
// ...
}
}
I would guess that I need to use proguard but I have no idea how to achieve that. I checked of cause the documentation, but I didn't get it how protect a single member variable.
Are you referencing the R.raw.apkpath? Looking at the Packaging Wearable Apps training mentions rawPathResId in the res/xml/wearable_app_desc.xml
On a side note enabling proGuard is simple with Gradle
buildTypes {
release {
runProguard true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}
This is Bug 78620 and was fixed in the gradle build tools 0.14.1.