我正在尝试在我的应用程序中实现图标包支持,以便与 Apex、Nova、ADW 等一起使用的相同图标包也适用于我的应用程序。 使用这段代码,找到 appfilter xml 文件,然后解析它以获取可绘制名称,我已经能够使用免费主题来实现它:
Context context = createPackageContext(packageName, Context.CONTEXT_IGNORE_SECURITY);
Resources res = context.getResources();
String str = "";
res.getAssets().list(str);
但是对于付费图标包,这是行不通的。返回的 Assets 为 0。我相信这是因为 JB+ 上的付费应用程序存在前向锁定,这使得 Assets 私有(private)化。 (此处概述:Accessing assets of other Android app on Jelly Bean)
我无法找到有关如何支持图标包和反编译图标包 apk 的任何信息我看不到任何内容提供程序,所以我只能假设这些启动器应用程序正在使用类似于我的方法来检索 Assets 。
有没有人能给我任何关于如何做到这一点的信息或为我指明正确的方向?
最佳答案
不是官方来源,而是Apex Launcher Theme Tutorial注意到
Next, open the appfilter.xml file under the res/xml directory. (Note: This file used to be located under the assets directory, but the new app encryption feature in JellyBean made it impossible for the theme engine to access assets of paid themes.)
所以看起来好像没有使用特殊的内容提供者 - 该机制必须简单地适应 Jelly Bean 上引入的安全机制。
关于java - Android - 实现图标包支持,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17317352/