ProGuard kommentiert Methoden aus

  • 0 Antworten
  • Letztes Antwortdatum
D

Droidspirit

App-Anbieter (In-App)
50
Hallo,

ich habe eben meine App dekompiliert und da ist mir aufgefallen, dass ProGuard in 2 Klassen Methoden auskommentiert und oben drüber // ERROR // über die Methoden schreibt.

Die Methoden scheinen aber in der App, wenn ich sie installiert habe, aufgerufen und ohne Fehler verwendet zu werden.

Ich habe Google bemüht, aber leider nichts dazu gefunden. Daher wollte ich hier mal in die Runde fragen, ob das jemand kennt bzw. mir sagen kann, was da los ist.

Ich habe in der ProGuard-Konfiguration bereits die beiden Klassen ausgeschlossen mit keep public class... Aber die Methoden werden am Ende dennoch von ProGuard auskommentiert.

Hier meine ProGuard-Konfiguration:
Code:
# To enable ProGuard in your project, edit project.properties
# to define the proguard.config property as described in that file.
#
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in ${sdk.dir}/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the ProGuard
# include property in project.properties.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
#   public *;
#}
-dontwarn android.support.v4.**

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

-keepattributes *Annotation*


-keepclassmembers enum * {
    public static **[] values();
    public static ** valueOf(java.lang.String);
}

-keep class * implements android.os.Parcelable {
  public static final android.os.Parcelable$Creator *;
}


-keepnames class * implements java.io.Serializable

-keepclassmembers class * implements java.io.Serializable {
    static final long serialVersionUID;
    private static final java.io.ObjectStreamField[] serialPersistentFields;
    !static !transient <fields>;
    !private <fields>;
    !private <methods>;
    private void writeObject(java.io.ObjectOutputStream);
    private void readObject(java.io.ObjectInputStream);
    java.lang.Object writeReplace();
    java.lang.Object readResolve();
}

-keep class com.android.vending.billing.**

-keep public class * extends android.app.Service

Und hier eine der dekompilierten Klassen:
Code:
package de.crimescenetracker.helper;

import android.app.Service;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.IBinder;
import com.android.vending.billing.IInAppBillingService;

public class PCS extends Service
{
  private IInAppBillingService a;
  private ServiceConnection b = new j(this);

  // ERROR //
  public final void a()
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 22	de/crimescenetracker/helper/PCS:a	Lcom/android/vending/billing/IInAppBillingService;
    //   4: iconst_3
    //   5: aload_0
    //   6: invokevirtual 30	de/crimescenetracker/helper/PCS:getPackageName	()Ljava/lang/String;
    //   9: ldc 32
    //   11: aconst_null
    //   12: invokeinterface 37 5 0
    //   17: astore_2
    //   18: aload_2
    //   19: ifnull +255 -> 274
    //   22: aload_2
    //   23: ldc 39
    //   25: invokevirtual 45	android/os/Bundle:getInt	(Ljava/lang/String;)I
    //   28: ifne +194 -> 222
    //   31: aload_2
    //   32: ldc 47
    //   34: invokevirtual 51	android/os/Bundle:getStringArrayList	(Ljava/lang/String;)Ljava/util/ArrayList;
    //   37: astore 4
    //   39: aload_2
    //   40: ldc 53
    //   42: invokevirtual 51	android/os/Bundle:getStringArrayList	(Ljava/lang/String;)Ljava/util/ArrayList;
    //   45: astore 5
    //   47: aload 4
    //   49: invokevirtual 59	java/util/ArrayList:size	()I
    //   52: ifne +223 -> 275
    //   55: aload 5
    //   57: invokevirtual 59	java/util/ArrayList:size	()I
    //   60: ifne +215 -> 275
    //   63: invokestatic 64	de/crimescenetracker/helper/m:a	()Lde/crimescenetracker/helper/m;
    //   66: aload_0
    //   67: invokevirtual 68	de/crimescenetracker/helper/PCS:getApplicationContext	()Landroid/content/Context;
    //   70: invokevirtual 72	de/crimescenetracker/helper/m:c	(Landroid/content/Context;)V
    //   73: goto +201 -> 274
    //   76: iload 6
    //   78: aload 5
    //   80: invokevirtual 59	java/util/ArrayList:size	()I
    //   83: if_icmplt +39 -> 122
    //   86: iload 7
    //   88: ifne +186 -> 274
    //   91: invokestatic 64	de/crimescenetracker/helper/m:a	()Lde/crimescenetracker/helper/m;
    //   94: aload_0
    //   95: invokevirtual 68	de/crimescenetracker/helper/PCS:getApplicationContext	()Landroid/content/Context;
    //   98: invokevirtual 72	de/crimescenetracker/helper/m:c	(Landroid/content/Context;)V
    //   101: getstatic 77	de/crimescenetracker/activities/MainActivity:a	Landroid/widget/Button;
    //   104: ifnull +170 -> 274
    //   107: getstatic 77	de/crimescenetracker/activities/MainActivity:a	Landroid/widget/Button;
    //   110: iconst_0
    //   111: invokevirtual 83	android/widget/Button:setVisibility	(I)V
    //   114: goto +160 -> 274
    //   117: astore 12
    //   119: goto +155 -> 274
    //   122: aload 5
    //   124: ifnull +19 -> 143
    //   127: aload 5
    //   129: invokevirtual 59	java/util/ArrayList:size	()I
    //   132: ifle +11 -> 143
    //   135: aload 5
    //   137: iload 6
    //   139: invokevirtual 87	java/util/ArrayList:get	(I)Ljava/lang/Object;
    //   142: pop
    //   143: aload 4
    //   145: ifnull +123 -> 268
    //   148: aload 4
    //   150: invokevirtual 59	java/util/ArrayList:size	()I
    //   153: ifle +115 -> 268
    //   156: aload 4
    //   158: iload 6
    //   160: invokevirtual 87	java/util/ArrayList:get	(I)Ljava/lang/Object;
    //   163: checkcast 89	java/lang/String
    //   166: astore 8
    //   168: aload 8
    //   170: ifnull +91 -> 261
    //   173: aload_0
    //   174: invokevirtual 68	de/crimescenetracker/helper/PCS:getApplicationContext	()Landroid/content/Context;
    //   177: aload 8
    //   179: invokestatic 94	de/crimescenetracker/helper/k:a	(Landroid/content/Context;Ljava/lang/String;)Z
    //   182: ifeq +79 -> 261
    //   185: invokestatic 64	de/crimescenetracker/helper/m:a	()Lde/crimescenetracker/helper/m;
    //   188: aload_0
    //   189: invokevirtual 68	de/crimescenetracker/helper/PCS:getApplicationContext	()Landroid/content/Context;
    //   192: invokevirtual 96	de/crimescenetracker/helper/m:b	(Landroid/content/Context;)V
    //   195: iconst_1
    //   196: istore 9
    //   198: getstatic 77	de/crimescenetracker/activities/MainActivity:a	Landroid/widget/Button;
    //   201: ifnull +11 -> 212
    //   204: getstatic 77	de/crimescenetracker/activities/MainActivity:a	Landroid/widget/Button;
    //   207: bipush 8
    //   209: invokevirtual 83	android/widget/Button:setVisibility	(I)V
    //   212: iinc 6 1
    //   215: iload 9
    //   217: istore 7
    //   219: goto -143 -> 76
    //   222: invokestatic 64	de/crimescenetracker/helper/m:a	()Lde/crimescenetracker/helper/m;
    //   225: aload_0
    //   226: invokevirtual 68	de/crimescenetracker/helper/PCS:getApplicationContext	()Landroid/content/Context;
    //   229: invokevirtual 72	de/crimescenetracker/helper/m:c	(Landroid/content/Context;)V
    //   232: getstatic 77	de/crimescenetracker/activities/MainActivity:a	Landroid/widget/Button;
    //   235: ifnull +39 -> 274
    //   238: getstatic 77	de/crimescenetracker/activities/MainActivity:a	Landroid/widget/Button;
    //   241: iconst_0
    //   242: invokevirtual 83	android/widget/Button:setVisibility	(I)V
    //   245: goto +29 -> 274
    //   248: astore_3
    //   249: goto +25 -> 274
    //   252: astore_1
    //   253: goto +21 -> 274
    //   256: astore 10
    //   258: goto -46 -> 212
    //   261: iload 7
    //   263: istore 9
    //   265: goto -53 -> 212
    //   268: aconst_null
    //   269: astore 8
    //   271: goto -103 -> 168
    //   274: return
    //   275: iconst_0
    //   276: istore 6
    //   278: iconst_0
    //   279: istore 7
    //   281: goto -205 -> 76
    //
    // Exception table:
    //   from	to	target	type
    //   101	114	117	java/lang/Exception
    //   232	245	248	java/lang/Exception
    //   0	101	252	android/os/RemoteException
    //   101	114	252	android/os/RemoteException
    //   127	195	252	android/os/RemoteException
    //   198	212	252	android/os/RemoteException
    //   222	232	252	android/os/RemoteException
    //   232	245	252	android/os/RemoteException
    //   198	212	256	java/lang/Exception
  }

  public IBinder onBind(Intent paramIntent)
  {
    return null;
  }

  public void onCreate()
  {
    super.onCreate();
  }

  public void onDestroy()
  {
    if (this.b != null);
    try
    {
      unbindService(this.b);
      label15: super.onDestroy();
      return;
    }
    catch (Exception localException)
    {
      break label15;
    }
  }

  public void onStart(Intent paramIntent, int paramInt)
  {
    super.onStart(paramIntent, paramInt);
    bindService(new Intent("com.android.vending.billing.InAppBillingService.BIND"), this.b, 1);
  }
}

Viele Grüße

Der ursprüngliche Beitrag von 12:12 Uhr wurde um 12:51 Uhr ergänzt:

Ich habe das eben nochmal genau geprüft:

Die Methoden der betroffenen Klassen werden aufgerufen und funktionieren. Aber wieso Kommentiert ProGuard dann mit diesem // ERROR // Tag aus?

Ich verstehs nicht.

Der ursprüngliche Beitrag von 12:51 Uhr wurde um 13:23 Uhr ergänzt:

Ich habe den Tipp bekommen, dass es nicht an ProGuard, sondern am Dekompiler liegen könnte, dass die Methoden auskommentiert werden. Sonst würden sie ja schließlich nicht funktionieren.
 
Zurück
Oben Unten