java - 类、成员和参数混淆的 Proguard 自定义命名

标签 java dictionary refactoring obfuscation proguard

Proguard 中的字典文件应该如何构建,是否有简单的描述?

我读过有关 -?obfuscationdictionary 的内容,但我找不到有关文件本身的任何信息。

此外,我想将命名方案更改为更复杂的东西,而不仅仅是 ab 等和 paramX , paramY...如果可能的话,我想要一系列随机字符。

是的,我知道这只是视觉上的差异,可以将其 reshape (重构?)为更易于阅读的内容。仍然,只是问...

谢谢

最佳答案

字典文件格式非常简单:

  1. 每行一个词
  2. 忽略空行
  3. 忽略以#开头的行

如果你想创建一个随机字符串的字典,你可以编写一个简单的程序来生成它们并将它们转储到一个文本文件中,或者使用 http://www.random.org/strings它有一个很好的简单的网络界面来创建随机字符串。它每行吐出一个,因此您可以直接将其输出用作字典文件。

这是一些示例输出(您可以生成任意大小的字符串):

HISPj7KHQ7
Wja3o2vx62
eyd3OXAZgV
DxDJysLV5r
BsUTWEAMAI
R7N8DF4OVS
4q7UsoAgP4
cWbN6pumKk
SJowARcXwM
OyIbF7L6XB

这是我找到的一个例子:

https://trac.openxdata.org/browser/trunk/j2me/openxdata-mobile/epihandy-lite/proguard/examples/dictionaries/keywords.txt?rev=1156

#
# This obfuscation dictionary contains reserved Java keywords. They can't
# be used in Java source files, but they can be used in compiled class files.
# Note that this hardly improves the obfuscation. Decent decompilers can
# automatically replace reserved keywords, and the effect can fairly simply be
# undone by obfuscating again with simpler names.
# Usage:
#     java -jar proguard.jar ..... -obfuscationdictionary keywords.txt
#

do
if
for
int
new
try
byte
case
char
else
goto
long
this
void
break
catch
class
const
final
float
short
super
throw
while
double
import
native
public
return
static
switch
throws
boolean
default
extends
finally
package
private
abstract
continue
strictfp
volatile
interface
protected
transient
implements
instanceof
synchronized

关于java - 类、成员和参数混淆的 Proguard 自定义命名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10044993/

相关文章:

c# - 没有catch block 的finally block 是java反模式吗?

java - setDisplayHomeAsUpEnabled 关闭 ActionBarDrawerToggle

java - 求解 boolean 表达式时如何思考?

swift : Query Dictionary using value

java - 我收到 ClassCastException : WrappedPreparedStatementJDK8 cannot be cast to SQLServerPreparedStatement

python - 打印层次字典的递归方法

python - 如何在 snakemake 的扩展函数参数中使用通配符?

visual-studio-2010 - 使用 ReSharper 和 Visual Studio 2010 自动重构导入/使用指令

java - 基于多个标志的条件

c# - 如何从配置文件重构高度重复的阅读部分