V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
qwwuyu
V2EX  ›  Android

Android 怎么实现这样的混淆?把所有代码混淆到一个包下,所有资源文件名和属性名被混淆了.

  •  
  •   qwwuyu · 2019-04-28 14:34:11 +08:00 · 4564 次点击
    这是一个创建于 1796 天前的主题,其中的信息可能已经有所发展或是发生改变。
    代码例子:
    public boolean ۟ۖ۫۠ = true;

    public ۘۙۢۥ(ۘۙۢ۠ paramۘۙۢ۠)
    {
    boolean bool = ۛ۟۫ۥ.ۗۤ۟ۜ;
    if (!ۡۦۛۥ.ۨۚۦۜ())
    {
    ۡۦ۬ۨ.ۤۥۧۗ();
    if (ۡۦ۬ۨ.ۤۥۧۗ) {}
    }

    layout 下的文件命名:
    MT_Protector
    MT_Protector_APKTOOL_DUPLICATENAME_0x7f0b000a
    MT_Protector_APKTOOL_DUPLICATENAME_0x7f0b000b
    ...

    layout 里截取的部分内容:
    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout android:orientation="vertical" android:id="@id/MT_Protector_APKTOOL_DUPLICATENAME_0x7f0901e4"
    xmlns:android="http://schemas.android.com/apk/res/android">
    <l.ۢ۫ۡۡ android:ellipsize="end" android:id="@id/MT_Protector_APKTOOL_DUPLICATENAME_0x7f09001c" android:l
    </LinearLayout>

    strings 里的内容:
    <string name="MT_Protector_APKTOOL_DUPLICATENAME_0x7f0f0002">更多选项</string>
    <string name="MT_Protector_APKTOOL_DUPLICATENAME_0x7f0f0003">完成</string>
    <string name="MT_Protector_APKTOOL_DUPLICATENAME_0x7f0f0004">查看全部</string>

    代码混淆包括清单组件、自定义控件,都被混淆到一个目录下了。
    资源图片都没有后缀了,资源目录下除了 values 全被混淆成 MT_Protector**。
    感觉很高大上,这种混淆是怎么实现的...
    3 条回复    2019-04-28 15:26:15 +08:00
    bunnyblueair
        1
    bunnyblueair  
       2019-04-28 14:45:28 +08:00
    代码这个是字典,你可以查下。layout 这个嘛,比较蛮烦
    qwwuyu
        2
    qwwuyu  
    OP
       2019-04-28 14:59:40 +08:00
    @bunnyblueair 恩,简单的代码混淆规则还是了解过的.
    res 估计和微信方式类似,找一找应该还是可以找到.
    但是所有代码被混淆到一个目录,没有一个正常命名的类,还是好奇怎么做到的.
    bunnyblueair
        3
    bunnyblueair  
       2019-04-28 15:26:15 +08:00
    @qwwuyu renamepackage proguard 的配置规则
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   957 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 20:41 · PVG 04:41 · LAX 13:41 · JFK 16:41
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.