#### 一、理论基础（我们先讲道理）

``````paramContext.getSharedPreferences(Fegli.a("SjUIVhhB:&Zi2}3mo@i"), 0);
``````

``````[color=#000000]const-string v0, "SjUIVhhB:&Zi2}3mo@i"

invoke-static {v0}, Lcom/molniya/free/Fegli;->a(Ljava/lang/String;)Ljava/lang/String;

move-result-object v0

invoke-virtual {p1, v0, v1}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;[/color]
``````

#### 二、实践过程（弟兄们，抄家伙动手）

``````vmx = analysis.VMAnalysis( vm )
``````

``````for i in self.vm.get_methods():
x = MethodAnalysis( self.vm, i, self )
self.methods.append( x )
self.hmethods[ i ] = x
self.__nmethods[ i.get_name() ] = x
``````

``````code = self.method.get_code()
``````

``````bc = code.get_bc()
``````

``````instructions = [i for i in bc.get_instructions()]
``````

``````public short class_idx;
public short proto_idx;
public int name_idx;
``````

``````class decryptMethonA:
def __init__(self, encrypt, vm):
self.encrypt = encrypt
self.vm = vm
self.methons = self.vm.get_methods()
#self.register = 0
self.methon_dict = {}
self.methon_info = []

def analyze(self):
for methon in self.methons:
code = methon.get_code()
if code == None:
continue

bc = code.get_bc()
instructions = [i for i in bc.get_instructions()] #获取指令
flag = 0
for i in instructions:
if flag == 1:
flag = 0
if self.searchFor(i): #op是否为0x1a
flag = 1

def searchFor(self, ins):
op_value = ins.get_op_value()
if op_value == 0x1a:
string_name = self.vm.get_cm_string(ins.get_ref_kind())
return string_name in self.encrypt
return False

op_value = ins.get_op_value()
if (op_value >= 0x6e and op_value <= 0x72) or (op_value >= 0x74 and op_value <= 0x78):
idx_meth = ins.get_ref_kind()
meth_info = self.vm.get_cm_method(idx_meth)
if meth_info[2][1] == 'Ljava/lang/String;':
if meth_info not in self.methon_info:
self.methon_info.append(meth_info)
self.methon_dict[self.methon_info.index(meth_info)] = 1
else:
self.methon_dict[self.methon_info.index(meth_info)] += 1

def get_meth_dict(self):
return self.methon_dict

def get_meth_info(self):
return self.methon_info
``````

#### 四、总结性发言

``````DexClassLoder classLoder = new DexClassLoder(目标dex，..., ..., ...)；
Class clazz = classLoder.loadClass(目标类)；
clazz.getMethod(目标函数，object [] {...}).invoke(null, 加密字符串)；
``````