1

我在这里使用 youtube java api 客户端http://code.google.com/p/google-api-java-client/

当我完成编码时,应用程序在未签名时运行良好。当我签署它时,Android 用 proguard 签署了它,这使得签署的 apk。我安装了它,应用程序出错了。当我尝试登录时,它无法调用正确的方法(我猜),与未签名时不同,它运行良好。

这是 proguard-google-api-client.txt

# ProGuard Configuration file
#
# See http://proguard.sourceforge.net/index.html#manual/usage.html

# Needed to keep generic types and @Key annotations accessed via reflection

-keepattributes Signature,RuntimeVisibleAnnotations,AnnotationDefault

-keepclassmembers class * {
  @com.google.api.client.util.Key <fields>;
}

# Needed by Guava
# See https://groups.google.com/forum/#!topic/guava-discuss/YCZzeCiIVoI

-dontwarn sun.misc.Unsafe
-dontwarn com.google.common.collect.MinMaxPriorityQueue

# Needed by google-http-client-android when linking against an older platform version

-dontwarn com.google.api.client.extensions.android.**

# Needed by google-api-client-android when linking against an older platform version

-dontwarn com.google.api.client.googleapis.extensions.android.**

这是proguard-flurry.txt(我做到了)

# ProGuard Configuration file
#
-keep class com.flurry.** { *; }
-keepattributes Signature,RuntimeVisibleAnnotations,AnnotationDefault

-keepclassmembers class * {
  @com.google.api.client.util.Key <fields>;
}

-dontwarn com.flurry.**

-dontwarn com.google.api.client.googleapis.extensions.android.gms.auth.**

-dontwarn com.google.common.cache.**

-dontwarn com.google.common.primitives.**

这是project.properties

# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system edit
# "ant.properties", and override values to adapt the script to your
# project structure.
#
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt:proguard-google-api-client.txt

# FlurryAgent
proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt:proguard-flurry.txt

# Project target.
target=Amazon:Kindle Fire (2nd Generation):15
android.library.reference.1=../gridlayout_v7

我添加了另一个罐子,所以我添加了 proguard-flurry.txt

4

0 回答 0