Adem
Adem

Reputation: 9429

keep only function names when obfuscation for proguard

I use proguard for obfuscation. How can I keep only function names while obfuscation. class names must be obfuscated but function names.

if I use,

-keep class * {
     void somefunction();
}

and it keeps function of somefunction, but it doesnt change classes names.

But, I want to change classes names but somefunction

Upvotes: 6

Views: 6781

Answers (2)

user12438479
user12438479

Reputation: 51

With Proguard, you can use -keepclassmembernames

In JNI, the class name is part of name of the function name in the native environment.

If you rename the class, you will get the java.lang.UnsatisfiedLinkError.

You must keep both the class name and the member function name.

Upvotes: 0

Eric Lafortune
Eric Lafortune

Reputation: 45676

You can use -keepclassmembers or -keepclassmembernames.

Cfr. ProGuard manual > Usage > Overview of Keep Options

Upvotes: 10

Related Questions