proguard
proguard copied to clipboard
Filename is retraced incorrectly.
We have FragmentManagerImpl:moveToState method in FragmentManager.java file https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/app/FragmentManager.java#1485
If we have stackrace like
java.lang.RuntimeException: Unable to resume activity {com.example.com/com.example.com.llp.activity.OnlineSessionActivity}: android.util.AndroidRuntimeException: requestFeature() must be called before adding content
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4228)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4330)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1867)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:7422)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Caused by: android.util.AndroidRuntimeException: requestFeature() must be called before adding content
at com.android.internal.policy.PhoneWindow.requestFeature(PhoneWindow.java:411)
at android.app.Dialog.requestWindowFeature(Dialog.java:1491)
at is.setupDialog(DialogFragment.java:353)
at is.onGetLayoutInflater(DialogFragment.java:333)
at androidx.fragment.app.Fragment.performGetLayoutInflater(Fragment.java:1308)
at ix.a(FragmentManager.java:1460)
at ix.f(FragmentManager.java:1784)
at ix.a(FragmentManager.java:1852)
at ir.g(BackStackRecord.java:802)
at ix.b(FragmentManager.java:2625)
at ix.a(FragmentManager.java:2411)
at ix.b(FragmentManager.java:2366)
at ix.h(FragmentManager.java:2273)
at iu.m(FragmentController.java:391)
at androidx.fragment.app.FragmentActivity.onResume(FragmentActivity.java:517)
...
and in particular line
at ix.a(FragmentManager.java:1460) it deobfuscated as androidx.fragment.app.FragmentManagerImpl(FragmentManagerImpl.java:1460)
While expected behaviour is androidx.fragment.app.FragmentManagerImpl(FragmentManager.java:1460)
We tested this on 6.0.3, 6.2.2, 6.3.0-beta1 and on all of these versions bug is reproduced.
The retracing of the sourcefile information is simply a heuristic. There is no information stored in the mapping file to correctly retrace this information.
The sourcefile is simply set by to classname.java
This would be a useful enhancement though, as especially with the emerging use of kotlin this heuristic is flawed, unfortunately, updating the mapping file make break a lot of tools.
Having a second though on this issue: from your stacktrace it looks like that you keep the original SourceFile attribute, but retrace overrides the correct original sourcefile with the heuristic.
In general why do you keep the SourceFile while enabling obfuscation of cassnames? From the sourcefile the original classname can be deduced most of the time.