有兴趣的可以看一下 com.immomo.momo.e.J()
因为是网络程序,所以验证是发到网上进行验证.连接用了HTTPS,防抓包,思路不错.
代码:
public static String J() { String str1 = a.getApplicationInfo().publicSourceDir; Class localClass = Class.forName("android.content.pm.PackageParser"); Class[] arrayOfClass1 = new Class[4]; arrayOfClass1[0] = File.class; arrayOfClass1[1] = String.class; arrayOfClass1[2] = DisplayMetrics.class; arrayOfClass1[3] = Integer.TYPE; Method localMethod1 = localClass.getMethod("parsePackage", arrayOfClass1); Class[] arrayOfClass2 = new Class[1]; arrayOfClass2[0] = String.class; Constructor localConstructor = localClass.getConstructor(arrayOfClass2); Object[] arrayOfObject1 = new Object[1]; arrayOfObject1[0] = ""; Object localObject1 = localConstructor.newInstance(arrayOfObject1); Object[] arrayOfObject2 = new Object[4]; arrayOfObject2[0] = new File(str1); arrayOfObject2[1] = null; arrayOfObject2[2] = a.getResources().getDisplayMetrics(); arrayOfObject2[3] = Integer.valueOf(4); Object localObject2 = localMethod1.invoke(localObject1, arrayOfObject2); Class[] arrayOfClass3 = new Class[2]; arrayOfClass3[0] = Class.forName("android.content.pm.PackageParser$Package"); arrayOfClass3[1] = Integer.TYPE; Method localMethod2 = localClass.getMethod("collectCertificates", arrayOfClass3); Object[] arrayOfObject3 = new Object[2]; arrayOfObject3[0] = localObject2; arrayOfObject3[1] = Integer.valueOf(64); localMethod2.invoke(localObject1, arrayOfObject3); Signature[] arrayOfSignature = (Signature[])localObject2.getClass().getField("mSignatures").get(localObject2); Signature localSignature; if (arrayOfSignature.length > 0) { localSignature = arrayOfSignature[0]; if (localSignature == null) break label267; } label267: for (String str2 = a.j(localSignature.toCharsString()); ; str2 = null) //a.j=>MD5 { return str2; localSignature = null; break; } }
****仅用于学习研究******