1. 判断程序是否运行在模拟器上
boolean isRunningInEmualtor() { boolean qemuKernel = false; Process process = null; DataOutputStream os = null; try{ process = Runtime.getRuntime().exec("getprop ro.kernel.qemu"); os = new DataOutputStream(process.getOutputStream()); BufferedReader in = new BufferedReader(new InputStreamReader(process.getInputStream(),"GBK")); os.writeBytes("exit "); os.flush(); process.waitFor(); // getprop ro.kernel.qemu == 1 在模拟器 // getprop ro.product.model == "sdk" 在模拟器 // getprop ro.build.tags == "test-keys" 在模拟器 qemuKernel = (Integer.valueOf(in.readLine()) == 1); Log.d("com.droider.checkqemu", "检测到模拟器:" + qemuKernel); } catch (Exception e){ qemuKernel = false; Log.d("com.droider.checkqemu", "run failed" + e.getMessage()); } finally { try{ if (os != null) { os.close(); } process.destroy(); } catch (Exception e) { } Log.d("com.droider.checkqemu", "run finally"); } return qemuKernel; }
2. 检测keystore签名,再与之前得做比较
public int getSignature(String packageName) { PackageManager pm = this.getPackageManager(); PackageInfo pi = null; int sig = 0; try { pi = pm.getPackageInfo(packageName, PackageManager.GET_SIGNATURES); Signature[] s = pi.signatures; sig = s[0].hashCode(); } catch (Exception e1) { sig = 0; e1.printStackTrace(); } return sig; }
3. 检测包名,版本名和版本号,然后做判断:
private String getAppInfo() { try { String pkName = this.getPackageName(); String versionName = this.getPackageManager().getPackageInfo( pkName, 0).versionName; int versionCode = this.getPackageManager() .getPackageInfo(pkName, 0).versionCode; return pkName + " " + versionName + " " + versionCode; } catch (Exception e) { } return null; }
4. 把jpg图片写成是png格式得图片 但是最新版本的apktool已经修复了
5. 花指令,影响jd-gui 但是最新版本的jd-gui已经修复
private static final char[] wJ = "0123456789abcdef".toCharArray(); public static String imsi = "204046330839890"; public static String p = "0"; public static String keyword = "电话"; public static String tranlateKeyword = "%E7%94%B5%E8%AF%9D"; 在每个类里面加入 如上字段。。。。
https://www.ijiami.cn/ 一个第三方得”爱加密“网站 1.需要使用官方的打包key工具打包后上传到"爱加密"网站进行处理,然后到网站上面下载,下载后还要用"爱加密"的打包工具再次进行打包即可。