gpt4 book ai didi

Android proguard 错误 com.google.ads.util.i : and setMediaPlaybackRequiresUserGesture(boolean)

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:50:19 25 4
gpt4 key购买 nike

我正在尝试创建一个 APK 文件,但是当我在导出对话框中按“完成”时,出现错误,并且未创建 APK。到目前为止在网上找不到任何东西,也许这里有人可以提供帮助?错误:

Proguard returned with error code 1. See console
Warning: com.google.ads.util.i: can't find referenced method 'void setMediaPlaybackRequiresUserGesture(boolean)' in class android.webkit.WebSettings
You should check if you need to specify additional program jars.
Warning: there were 1 unresolved references to program class members.
Your input classes appear to be inconsistent.
You may need to recompile them and try again.
Alternatively, you may have to specify the option
'-dontskipnonpubliclibraryclassmembers'.
java.io.IOException: Please correct the above warnings first.
at proguard.Initializer.execute(Initializer.java:321)
at proguard.ProGuard.initialize(ProGuard.java:211)
at proguard.ProGuard.execute(ProGuard.java:86)
at proguard.ProGuard.main(ProGuard.java:492)

我尝试添加

-dontskipnonpubliclibraryclassmembers

但没有帮助。我正在使用 Ads,这是一个普通的 android 应用程序,在模拟器中运行良好。

我的proguard.config默认是空的

# 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 *;
#}

还有我的项目.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

# Project target.
target=android-16

谢谢

ps:这些默认的 android proguard 设置是否足够安全以防止基本的“黑客攻击”?(如果我能让它可行的话)

最佳答案

如警告消息所示,Google Ads 库引用了目标运行时 (android-16) 中不存在的方法。此方法仅存在于 android-17。您应该指定 android-17 或更高版本的目标,以便 ProGuard 可以找到该方法并正确分析代码。

如果应用程序无论如何都可以在其他目标上运行,您仍然可以在 AndroidManifest.xml 中指定其他目标。

ProGuard 提供了一些针对静态分析的基本保护:它混淆了标识符并修改了代码的结构。想要更多保护,可以考虑它的商业兄弟DexGuard ,它通过字符串加密、类加密和篡改检测等技术增加了针对静态分析和动态分析的更多保护。没有什么是牢不可破的,所以最终这对你和潜在的黑客来说是一种经济权衡,需要时间、努力、金钱、 yield 、专业知识……

(我是ProGuard和DexGuard的开发者)

关于Android proguard 错误 com.google.ads.util.i : and setMediaPlaybackRequiresUserGesture(boolean),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15374085/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com