android proguard makes the youtube api oauth disabled?

流过昼夜 提交于 2019-12-23 03:25:48

问题


I use the youtube java api client here http://code.google.com/p/google-api-java-client/

when I finish coding, the app goes well when unsigned. When I signed it, the Android signed it with proguard, which makes the signed apk. I installed it, the app goes wrong. When I try to login, it cann't call the right method(I guess), unlike when it's unsigned, it goes perfected well.

here is the 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.**

here is proguard-flurry.txt (I made it)

# 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.**

here is the 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

I add another jar, so I add the proguard-flurry.txt

来源:https://stackoverflow.com/questions/14731859/android-proguard-makes-the-youtube-api-oauth-disabled

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!