防止在android中混淆方法 [英] Keep a method from obfuscate in android

查看:51
本文介绍了防止在android中混淆方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想避免混淆和重命名方法.

I want to keep a method from obfuscating and rename.

package test.app.my;

class my {
    public  void done() {

    }
}

推荐答案

在构建期间,混淆由调用 Proguard 的构建步骤处理,因此要保留添加到 Proguard 配置文件的方法:

During build, obfuscation is handled by the build step that invokes Proguard, so to keep a method you add to your Proguard configuration file:

-keep class test.app.my {
    void done();
}

配置语法支持通配符并且非常强大——看看一些Proguard 手册中的示例.

The configuration syntax supports wildcards and is quite powerful - take a look at some examples from the Proguard manual.

这篇关于防止在android中混淆方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆