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

Error when using proguard #24

Closed
mwinters-stuff opened this issue Nov 8, 2014 · 6 comments
Closed

Error when using proguard #24

mwinters-stuff opened this issue Nov 8, 2014 · 6 comments

Comments

@mwinters-stuff
Copy link

I am getting the following errors witth either (its random) the RootTools.isAccessGiven() or RootTools.exists(...) functions, this works fine when the application is run in debug, but when built for release with proguard e.t.c, the following occurs, on a stock (except root) nexus 10 and nexus 5, doesnt appear specific to those devices. This happens with 3.5 and with the master from git.

root tools is excluded from proguard, and i am using the very latest build tools and sdk.

11-08 16:03:00.783 10200-10315/? E/RootTools v3.5﹕ Waiting for a command to be executed in a shell that is not executing and not reading!
Command: id
11-08 16:03:00.783 10200-10315/? W/System.err﹕ java.lang.Exception
11-08 16:03:00.783 10200-10315/? W/System.err﹕ at dalvik.system.VMStack.getThreadStackTrace(Native Method)
11-08 16:03:00.783 10200-10315/? W/System.err﹕ at java.lang.Thread.getStackTrace(Thread.java:579)
11-08 16:03:00.783 10200-10315/? W/System.err﹕ at com.stericson.RootTools.internal.RootToolsInternalMethods.commandWait(SourceFile:1484)
11-08 16:03:00.783 10200-10315/? W/System.err﹕ at com.stericson.RootTools.internal.RootToolsInternalMethods.exists(SourceFile:430)
11-08 16:03:00.783 10200-10315/? W/System.err﹕ at com.stericson.RootTools.RootTools.exists(SourceFile:202)
11-08 16:03:00.783 10200-10315/? W/System.err﹕ at nz.org.winters.android.gnfastcharge.r.b(SourceFile:115)
11-08 16:03:00.783 10200-10315/? W/System.err﹕ at nz.org.winters.android.gnfastcharge.IntentReceiver_.onHandleIntent(SourceFile:91)
11-08 16:03:00.783 10200-10315/? W/System.err﹕ at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
11-08 16:03:00.783 10200-10315/? W/System.err﹕ at android.os.Handler.dispatchMessage(Handler.java:102)
11-08 16:03:00.783 10200-10315/? W/System.err﹕ at android.os.Looper.loop(Looper.java:136)
11-08 16:03:00.783 10200-10315/? W/System.err﹕ at android.os.HandlerThread.run(HandlerThread.java:61)

@mwinters-stuff mwinters-stuff changed the title Error when Error when using proguard Nov 8, 2014
@Fusion
Copy link
Collaborator

Fusion commented Nov 10, 2014

Silly question, I know: do you see the same error if you completely disable proguard?

@mwinters-stuff
Copy link
Author

I would have hit my head on the keyboard if my cat had not been between it and me, for not thinking of doing that, Just have done so, with the proguard off, it worked fine, proguard on, its doing the above..

in my build.gradle,

 buildTypes {
    release {
      minifyEnabled true
      shrinkResources true
      proguardFile getDefaultProguardFile('proguard-android-optimize.txt')
      proguardFile "proguard-project.txt"
      signingConfig signingConfigs.myConfig
    }

the proguard-project.txt is


-keepattributes SourceFile,LineNumberTable,*Annotation*
-renamesourcefileattribute SourceFile
-dontwarn com.google.ads.**,org.springframework.**,org.ietf.**,com.jcraft.jzlib.**,javax.naming.**,sun.misc.Unsafe,com.google.common.collect.MinMaxPriorityQueue
-dontwarn com.squareup.okhttp.**,com.google.appengine.api.**,com.google.apphosting.api.**

-dontwarn libcore.icu.ICU

-dontwarn com.google.vending.licensing.**
-dontwarn com.android.vending.licensing.**
-dontwarn com.google.analytics.tracking.android.AdMobInfo
-dontwarn sun.misc.Unsafe


-keep class com.google.analytics.** {*;}
-keep interface  com.google.analytics.** {*;}
-keep class com.google.tagmanager.** {*;}
-keep interface  com.google.tagmanager.** {*;}

-keep class com.google.android.gms.** {*;}
-keep interface  com.google.android.gms.**{*;}
-dontwarn com.google.android.gms.**

-keep class com.google.ads.** {*;}
-keep interface  com.google.ads.** {*;}

-keep class org.androidannotations.** {*;}
-keep interface  org.androidannotations.** {*;}


-keep class android.support.** {*;}
-keep interface  android.support.** {*;}


-dontwarn com.google.analytics.tracking.android.**
-dontwarn com.google.vending.licensing.**
-dontwarn com.android.vending.licensing.**
-dontwarn rx.**

-keep class org.acra.** {*;}
-keep interface org.acra.** {*;}

-keep class retrofit.** {*;}
-keep interface retrofit.** {*;}
-keepnames class * implements retrofit.** {*;}

-keep class com.stericson.RootTools.** { *; }
-keep interface com.stericson.RootTools.** { *; }

-keep class com.google.gson.** { *; }
-keep interface com.google.gson.** { *; }

-keep class com.doomonafireball.betterpickers.** { *; }
-keep interface com.doomonafireball.betterpickers.** { *; }

-keep class nz.org.winters.android.unlockchecker.gson.** { *; }
-keep class nz.org.winters.android.gnfastcharge.gson.** { *; }
-keep interface nz.org.winters.android.gnfastcharge.gson.** { *; }

#-keep class org.spongycastle.** { *; }
#-keep interface org.spongycastle.** { *; }
#-dontwarn javax.naming.**
#-keep class net.schmizz.concurrent.** { *; }

-dontskipnonpubliclibraryclassmembers

# Google play services
-keep class * extends java.util.ListResourceBundle {
    protected Object[][] getContents();
}

-keep public class com.google.android.gms.common.internal.safeparcel.SafeParcelable {
    public static final *** NULL;
}

-keepnames @com.google.android.gms.common.annotation.KeepName class *
-keepclassmembernames class * {
    @com.google.android.gms.common.annotation.KeepName *;
}

-keepnames class * implements android.os.Parcelable {
    public static final ** CREATOR;
}
#-assumenosideeffects class android.util.Log {
#    public static boolean isLoggable(java.lang.String, int);
#    public static int v(...);
#    public static int i(...);
#    public static int w(...);
#    public static int d(...);
#    public static int e(...);
#}

-keep class com.google.gson.** { *; }
-keep class com.google.inject.* { *; }
-keep class org.apache.http.* { *; }
-keep class org.apache.james.mime4j.* { *; }
-keep class javax.inject.* { *; }
-keep class retrofit.* { *; }
-dontwarn rx.*
-keepattributes Signature
-keep class sun.misc.Unsafe { *; }


# should be copied to application proguard rules config
-keep class com.android.vending.billing.**

-assumenosideeffects class org.solovyev.android.checkout.Billing {
    public static void debug(...);
    public static void warning(...);
    public static void error(...);
}

-assumenosideeffects class org.solovyev.android.checkout.Check {
        *;
}

@Stericson
Copy link
Owner

Chris,

Do you know why proguard might be causing issues here?

@mwinters-stuff
Copy link
Author

No idea, I couldn't figure it out, have moved to using libsuperuser and
have not had a problem with that..

On 25 November 2014 at 12:41, Stephen notifications@github.com wrote:

Chris,

Do you know why proguard might be causing issues here?


Reply to this email directly or view it on GitHub
#24 (comment).

Mathew Winters
See my other apps
https://play.google.com/store/apps/developer?id=Mathew+Winters
https://play.google.com/store/apps/developer?id=Mathew+Winters

@Stericson
Copy link
Owner

Would you be willing to try a new version?

https://drive.google.com/file/d/0B5Amguus3csDQW1zV04waEhXNkE/view?usp=sharing

I think I fixed one of the issues that MIGHT have caused this. I saw a RootDenied exception being thrown in some cases and tracked it down to an issue with ProcessBuilder.

Even if you don't use the library in your application, it would be very helpful to know if this resolved the issue.

@mwinters-stuff
Copy link
Author

I can give it a go let you know in a couple of days..

:)

On 25 November 2014 at 12:56, Stephen notifications@github.com wrote:

Would you be willing to try a new version?

https://drive.google.com/file/d/0B5Amguus3csDQW1zV04waEhXNkE/view?usp=sharing

I think I fixed one of the issues that MIGHT have caused this. I saw a
RootDenied exception being thrown in some cases and tracked it down to an
issue with ProcessBuilder.

Even if you don't use the library in your application, it would be very
helpful to know if this resolved the issue.


Reply to this email directly or view it on GitHub
#24 (comment).

Mathew Winters
See my other apps
https://play.google.com/store/apps/developer?id=Mathew+Winters
https://play.google.com/store/apps/developer?id=Mathew+Winters

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

3 participants