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

Thread.UncaughtExceptionHandler.uncaughtException(...) is not deobfuscated #432

Open
pplithium opened this issue Nov 23, 2023 · 1 comment

Comments

@pplithium
Copy link

When an obfuscated exception is thrown using Thread.UncaughtExceptionHandler.uncaughtException() method, the exception is not decoded. Due to limitations, we cannot use throw new ObfuscatedException("msg")

To reproduce:

Build a project with:

public class ObfuscatedException extends RuntimeException{
    public ObfuscatedException(String msg) {
        super(msg);
    }
}

an obfuscated exception class, and throw this exception using:

Thread.UncaughtExceptionHandler handler = Thread.getDefaultUncaughtExceptionHandler();
ObfuscatedException obfuscatedException = new ObfuscatedException("message");
handler.uncaughtException(Thread.currentThread(), obfuscatedException);

Provide the mapping file and crash log to retrace:

retrace mapping.txt crash.txt

Actual result:

2023-11-23 12:11:44.418 31080-31080 AndroidRuntime          pid-31080                            E  FATAL EXCEPTION: main
                                                                                                    Process: com.example, PID: 31080
                                                                                                    p2.a: message
                                                                                                    	at com.example.MainActivity.onCreate(MainActivity.java:18)
                                                                                                    	at android.app.Activity.performCreate(Activity.java:8944)
                                                                                                    	at android.app.Activity.performCreate(Activity.java:8913)
                                                                                                    	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1456)
                                                                                                    	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4146)
                                                                                                    	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4322)
                                                                                                    	at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103)
                                                                                                    	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:139)
                                                                                                    	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:96)
                                                                                                    	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2685)
                                                                                                    	at android.os.Handler.dispatchMessage(Handler.java:106)
                                                                                                    	at android.os.Looper.loopOnce(Looper.java:230)
                                                                                                    	at android.os.Looper.loop(Looper.java:319)
                                                                                                    	at android.app.ActivityThread.main(ActivityThread.java:8893)
                                                                                                    	at java.lang.reflect.Method.invoke(Method.java)
                                                                                                    	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:608)
                                                                                                    	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)

Expected Result:

2023-11-23 12:11:44.418 31080-31080 AndroidRuntime          pid-31080                            E  FATAL EXCEPTION: main
                                                                                                    Process: com.example, PID: 31080
                                                                                                    com.example.ObfuscatedException: message
                                                                                                    	at com.example.MainActivity.onCreate(MainActivity.java:18)
                                                                                                    	at android.app.Activity.performCreate(Activity.java:8944)
                                                                                                    	at android.app.Activity.performCreate(Activity.java:8913)
                                                                                                    	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1456)
                                                                                                    	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4146)
                                                                                                    	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4322)
                                                                                                    	at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103)
                                                                                                    	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:139)
                                                                                                    	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:96)
                                                                                                    	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2685)
                                                                                                    	at android.os.Handler.dispatchMessage(Handler.java:106)
                                                                                                    	at android.os.Looper.loopOnce(Looper.java:230)
                                                                                                    	at android.os.Looper.loop(Looper.java:319)
                                                                                                    	at android.app.ActivityThread.main(ActivityThread.java:8893)
                                                                                                    	at java.lang.reflect.Method.invoke(Method.java)
                                                                                                    	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:608)
                                                                                                    	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)
@pplithium
Copy link
Author

anyone?

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