使用 Google 云保存的 Proguard 配置

Proguard configuration with Google cloud save

我无法使用 android 的云保存示例。收集所有的星星在调试模式下工作正常,但是当启用混淆器时,我得到一个抽象方法错误。

请某人 post 整个 progaurd 属性文件和清单。 我的在这里:

proguard-project.txt:

# 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 *;
#}
-keep class com.android.vending.billing.**
-dontwarn com.google.**
-renamesourcefileattribute SourceFile
-keepattributes SourceFile,LineNumberTable



# Needed by google-api-client to keep generic types and @Key annotations accessed via reflection
-keepclassmembers class * { 
  @com.google.api.client.util.Key <fields>; 
} 
-keepattributes Signature,RuntimeVisibleAnnotations,AnnotationDefault

# Play Services
-dontwarn com.google.android.gms.**
-dontwarn com.google.common.cache.**
-dontwarn com.google.common.primitives.**
-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 *;
}

清单:

<?xml version="1.0" encoding="utf-8"?>

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.package.catt"
    android:versionCode="2"
    android:versionName="1.0"  >

     <uses-sdk
        android:minSdkVersion="11"
        android:targetSdkVersion="22" />

    <uses-permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >

        <meta-data android:name="com.google.android.gms.games.APP_ID"
            android:value="@string/app_id" />
        <meta-data android:name="com.google.android.gms.version"
                   android:value="@integer/google_play_services_version"/>

        <activity
            android:name="com.package.catt2.MainActivity"
            android:label="@string/app_name"
            android:screenOrientation="portrait"
            >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name="com.package.catt2.SelectSnapshotActivity"
                  android:label="@string/select_conflicted_game">
        </activity>
    </application>

</manifest>

崩溃日志:

07-18 00:38:26.945: E/ALSAModule(201): s_standby handle h 0xb8299830
07-18 00:38:27.105: E/ALSAModule(201): Number of modifiers 0
07-18 00:38:27.105: E/ALSAModule(201): usecase_type is 0
07-18 00:38:27.225: E/SMD(189): DCD ON
07-18 00:38:27.225: E/Watchdog(732): !@Sync 58
07-18 00:38:27.746: E/DatabaseUtils(732): Writing exception to parcel
07-18 00:38:27.746: E/DatabaseUtils(732): java.lang.SecurityException: Permission Denial: get/set setting for user asks to run as user -2 but is calling from user 0; this requires android.permission.INTERACT_ACROSS_USERS_FULL
07-18 00:38:27.746: E/DatabaseUtils(732):   at com.android.server.am.ActivityManagerService.handleIncomingUser(ActivityManagerService.java:15174)
07-18 00:38:27.746: E/DatabaseUtils(732):   at android.app.ActivityManager.handleIncomingUser(ActivityManager.java:2492)
07-18 00:38:27.746: E/DatabaseUtils(732):   at com.android.providers.settings.SettingsProvider.call(SettingsProvider.java:688)
07-18 00:38:27.746: E/DatabaseUtils(732):   at android.content.ContentProvider$Transport.call(ContentProvider.java:325)
07-18 00:38:27.746: E/DatabaseUtils(732):   at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:275)
07-18 00:38:27.746: E/DatabaseUtils(732):   at android.os.Binder.execTransact(Binder.java:404)
07-18 00:38:27.746: E/DatabaseUtils(732):   at dalvik.system.NativeStart.run(Native Method)
07-18 00:38:27.816: E/qdmemalloc(196): heap_msk=3000000 flags=1
07-18 00:38:27.816: E/qdmemalloc(196):  
07-18 00:38:27.826: E/qdmemalloc(196): heap_msk=40000000 flags=1
07-18 00:38:27.826: E/qdmemalloc(196):  
07-18 00:38:27.906: E/dalvikvm(11666): >>>>> Normal User
07-18 00:38:27.906: E/dalvikvm(11666): >>>>> com.package.catt [ userId:0 | appId:10462 ]
07-18 00:38:28.297: E/AndroidRuntime(11666): FATAL EXCEPTION: main
07-18 00:38:28.297: E/AndroidRuntime(11666): Process: com.package.catt, PID: 11666
07-18 00:38:28.297: E/AndroidRuntime(11666): java.lang.AbstractMethodError: abstract method not implemented
07-18 00:38:28.297: E/AndroidRuntime(11666):    at com.google.android.gms.d.d.ad.onViewAttachedToWindow(Unknown Source)
07-18 00:38:28.297: E/AndroidRuntime(11666):    at android.view.View.dispatchAttachedToWindow(View.java:13372)
07-18 00:38:28.297: E/AndroidRuntime(11666):    at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2673)
07-18 00:38:28.297: E/AndroidRuntime(11666):    at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2680)
07-18 00:38:28.297: E/AndroidRuntime(11666):    at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2680)
07-18 00:38:28.297: E/AndroidRuntime(11666):    at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1514)
07-18 00:38:28.297: E/AndroidRuntime(11666):    at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1251)
07-18 00:38:28.297: E/AndroidRuntime(11666):    at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6540)
07-18 00:38:28.297: E/AndroidRuntime(11666):    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:813)
07-18 00:38:28.297: E/AndroidRuntime(11666):    at android.view.Choreographer.doCallbacks(Choreographer.java:613)
07-18 00:38:28.297: E/AndroidRuntime(11666):    at android.view.Choreographer.doFrame(Choreographer.java:583)
07-18 00:38:28.297: E/AndroidRuntime(11666):    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:799)
07-18 00:38:28.297: E/AndroidRuntime(11666):    at android.os.Handler.handleCallback(Handler.java:733)
07-18 00:38:28.297: E/AndroidRuntime(11666):    at android.os.Handler.dispatchMessage(Handler.java:95)
07-18 00:38:28.297: E/AndroidRuntime(11666):    at android.os.Looper.loop(Looper.java:146)
07-18 00:38:28.297: E/AndroidRuntime(11666):    at android.app.ActivityThread.main(ActivityThread.java:5593)
07-18 00:38:28.297: E/AndroidRuntime(11666):    at java.lang.reflect.Method.invokeNative(Native Method)
07-18 00:38:28.297: E/AndroidRuntime(11666):    at java.lang.reflect.Method.invoke(Method.java:515)
07-18 00:38:28.297: E/AndroidRuntime(11666):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
07-18 00:38:28.297: E/AndroidRuntime(11666):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
07-18 00:38:28.297: E/AndroidRuntime(11666):    at dalvik.system.NativeStart.main(Native Method)

对于 gms,您需要将其添加到混淆器中:

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