gpt4 book ai didi

android - 我想在 android 中加密或混淆我的资源(XML 布局文件、字符串等)

转载 作者:行者123 更新时间:2023-11-29 02:25:32 38 4
gpt4 key购买 nike

我主要担心的是,当我提取 APK 时,我可以看到所有布局文件和字符串等,甚至是 list 。使用 proguard 我已经使用

混淆了所有 java 文件
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-verbose

# If you want to enable optimization, you should include the
# following:
-optimizations !code/simplification/arithmetic,!code/simplification/cast,!field/*,!class/merging/*
-optimizationpasses 5
-allowaccessmodification

# The support library contains references to newer platform versions.
# Don't warn about those in case this app is linking against an older
# platform version. We know about them, and they are safe.
-dontwarn android.support.**

我在想的是,如果我们能够以语法方式加密布局文件,并在应用程序开始解密它们时或使用任何其他方法来确保它们不会被误用

提前致谢

最佳答案

不太确定是否通过 Proguard 加密资源,但至少,我相信您可以混淆它们。

使用AndResGuard :

AndResGuard is a tooling for reducing your apk size, it works like the ProGuard for Java source code, but only aim at the resource files. It changes res/drawable/wechat to r/d/a, and renames the resource file wechat.png to a.png. Finally, it repackages the apk with 7zip, which can reduce the package size obviously.

Obfuscate android resources. It contains all the resource type(such as drawable、layout、string...). It can prevent your apk from being reversed by Apktool.

However ;

ProGuard only affects Java code, not resources. You will need to research other tools, like DexGuard, that may offer resource obfuscation. Whether there is a tool that can obfuscate raw resources is another matter.

关于android - 我想在 android 中加密或混淆我的资源(XML 布局文件、字符串等),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52476181/

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