2022-03-19

How can I prevent proguard from keeping some of my method names

I have been testing my apk against an online apk decompiler and I've noticed that some of my method names are there in clear text.

For example on one of my activities I have a suspend method called `mySuspendMethod' and this is what I will find when the code is decompiled:

@C0463c(mo2892c = "mypackage.MyActivity$mySuspendMethod$2", mo2893f = "MyActivity.kt", mo2894l = {304}, mo2895m = "invokeSuspend")
    /* renamed from: mypackage.MyActivity$j */
    /* compiled from: MyActivity.kt */
    static final class C2963j extends w02 implements rb0<C5499yq, C0328iq<? super Boolean>, Object> {

MyActivity has to have an exclusion with -keep class because it is an Activity but I still want most of the methods to be totally obfuscated.

I only have this on keepattributes:

-keepattributes *Annotation*,Signature

I also have this, can't remember why:

-repackageclasses ''

Any idea how to prevent that type of stuff from showing up when decompiling the apk?

Edit: I think this is where the decompiler is getting it from (this is from the smali file.

.annotation runtime Lkotlin/coroutines/jvm/internal/c;
    c = "mypackage.MyActivity$cmySuspendMethod$2"
    f = "MyActivity.kt"
    l = {
        0x136
    }
    m = "invokeSuspend"
.end annotation


No comments:

Post a Comment