Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7933333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T21:18:02+00:00 2026-06-03T21:18:02+00:00

I want to use Proguard to obfuscate an app’s code. I don’t need optimisations,

  • 0

I want to use Proguard to obfuscate an app’s code. I don’t need optimisations, and I don’t need Proguard to strip any classes or methods out. All I want is obfuscation. The app uses several library projects.

I’ve been banging my head against the wall trying to make it happen and it’s not working the way I want. I am seeing NoSuchMethodExceptions thrown in the app when executed, even though I thought I had turned off Proguard’s shrinking options.

What are the magic settings to have Proguard JUST obfuscate, and not optimise away ANY code?

UPDATE. I’ve confirmed through trial and error that it is the obfuscation process (not the optimisation or shrinking) that is causing the NoSuchMethodExceptions.

Proguard.cfg

-dontpreverify
-repackageclasses ''
-allowaccessmodification
-optimizations !code/simplification/arithmetic
-keepattributes *Annotation*
-dontshrink
-keep public class * extends Object
-keep class com.myapp.** { *; }
-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class com.myapp.activity.Splash
-keep public class com.myapp.alarm.AlarmsViewer
-keep public class com.myapp.activity.About
-keep public class com.myapp.activity.Base
-keep public class com.myapp.activity.BaseWithMenu
-keep public class com.myapp.alarm.Alarm
-keep public class com.myapp.alarm.AlarmFragment
-keep public class com.myapp.alarm.AlarmPagerAdapter
-keep public class com.myapp.alarm.AlarmStore
-keep public class com.myapp.app.App
-keep public class com.myapp.preferences.Preferences
-keep public class com.myapp.preferences.PreferencesStore

-keep public class * extends android.view.View {
    public <init>(android.content.Context);
    public <init>(android.content.Context, android.util.AttributeSet);
    public <init>(android.content.Context, android.util.AttributeSet, int);
    public void set*(...);
}

-keepclasseswithmembers class * {
    public <init>(android.content.Context, android.util.AttributeSet);
}

-keepclasseswithmembers class * {
    public <init>(android.content.Context, android.util.AttributeSet, int);
}

-keepclassmembers class * implements android.os.Parcelable {
    static android.os.Parcelable$Creator CREATOR;
}

-keepclassmembers class **.R$* {
    public static <fields>;
}

-keep class android.support.v4.app.** { *; }
-keep interface android.support.v4.app.** { *; }
-keep class com.actionbarsherlock.** { *; }
-keep interface com.actionbarsherlock.** { *; }

-keepattributes *Annotation*

-keep public interface com.android.vending.licensing.ILicensingService

-dontwarn android.support.**
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T21:18:04+00:00Added an answer on June 3, 2026 at 9:18 pm

    I had similar problems a while back and solved it for me by brute force and luck. My proguard.cfg is similar but I have the lines:

    -dontshrink
    -optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
    

    I can’t remember from where I got the idea for these optimization options, but they seem to work for me.

    There is always the catch all switch

    -dontoptimize
    

    (Specifies not to optimize the input class files. By default, optimization is enabled; all methods are optimized at a bytecode level.)

    which might be more appropriate.

    Finally I have methods which are only referenced in xml files (click handlers) which needed to be explicitly kept with

    -keepclassmembers class * extends android.app.Activity {
        public void myClickHandler(android.view.View );
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to use HTML comments to store specific data, but I don't want
So I want use Leaks to find the leaks in my app. In Xcode,
I don't want use ajax to load data in my grid. Theres a way
In a Java source, I don't want use some package. For instance, I don't
i want use XmlSampleGenerator API in my project. i don't know how to add
in my app i want use the camera for capturing image and send to
How to obfuscate code quickly. I have a very small Java App and I
I want use glassfish as the solr search server, but I don't know how
I use codeigniter and i want make uniqid code with php as following code(by
I want use math operations in XAML code but I dont know how?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.