1. 本实例只对apklib文件夹中的文件进行分析

    import java.io.File;
    import java.io.IOException;
    import java.util.ArrayList;
    import java.util.Enumeration;
    import java.util.HashMap;
    import java.util.HashSet;
    import java.util.Set;
    import java.util.zip.ZipEntry;
    import java.util.zip.ZipFile;
  2.  
  3. public class GetReinforcementMoth {
  4.  
  5. public static void main(String[] args) throws IOException {
    initData();
    // String apkSourceCodeDir[] = {"G:\\workspace\\...\\...\\..", "G:\\workspace\\...\\...\\.."};
    String apkSourceCodeDir[] = {"D:\\develop\\apks"};
  6.  
  7. getReinforcementMothByPaths(apkSourceCodeDir);
  8.  
  9. // ArrayList<String> apkSourceCodeDir= new ArrayList<String>();
    //// apkSourceCodeDir.add("G:\\workspace\\...\\...\\..");
    //// apkSourceCodeDir.add("G:\\workspace\\...\\...\\..");
    // apkSourceCodeDir.add("E:\\workspace\\...\\...\\...\\..");
    // getReinforcementMothByPaths(apkSourceCodeDir);
    }
  10.  
  11. /**
    * 加固so集合
    */
    static HashMap<String, String> reinforcementSoMaps;
  12.  
  13. private static void initData() {
    reinforcementSoMaps = new HashMap<>();
    reinforcementSoMaps.put("libsecexe.so", "梆梆加固免费版");
    reinforcementSoMaps.put("libsecmain.so", "梆梆加固免费版");
    reinforcementSoMaps.put("libSecShell.so", "梆梆加固免费版");
    reinforcementSoMaps.put("secData0.jar", "梆梆加固免费版");
    reinforcementSoMaps.put("libSecShell-x86.so", "梆梆加固免费版");
  14.  
  15. reinforcementSoMaps.put("libDexHelper.so", "梆梆企业版");
    reinforcementSoMaps.put("libDexHelper-x86.so", "梆梆企业版");
    reinforcementSoMaps.put("classes.jar", "梆梆加固定制版");
    reinforcementSoMaps.put("DexHelper.so", "梆梆加固定制版");
  16.  
  17. reinforcementSoMaps.put("libtup.so", "腾讯加固");
    // ReinforcementSoMaps.put("libexec.so", "腾讯加固");
    reinforcementSoMaps.put("libshell.so", "腾讯加固");
    reinforcementSoMaps.put("mix.dex", "腾讯加固");
    reinforcementSoMaps.put("mixz.dex", "腾讯加固");
    reinforcementSoMaps.put("libshella-xxxx.so", "腾讯加固");
    reinforcementSoMaps.put("libshellx-xxxx.so", "腾讯加固");
  18.  
  19. reinforcementSoMaps.put("libtosprotection.armeabi-v7a.so", "腾讯御安全");
    reinforcementSoMaps.put("libtosprotection.armeabi.so", "腾讯御安全");
    reinforcementSoMaps.put("libtosprotection.x86.so", "腾讯御安全");
    reinforcementSoMaps.put("tosversion", "腾讯御安全");
    reinforcementSoMaps.put("libTmsdk-xxx-mfr.so", "腾讯御安全");
  1.      reinforcementSoMaps.put("aliprotect.dat", "阿里加固");
       reinforcementSoMaps.put("libsgmain.so", "阿里加固");
       reinforcementSoMaps.put("libsgsecuritybody.so", "阿里加固");
       reinforcementSoMaps.put("libmobisec.so", "阿里加固");
       reinforcementSoMaps.put("libfakejni.so", "阿里加固");
       reinforcementSoMaps.put("libzuma.so", "阿里加固");
       reinforcementSoMaps.put("libzumadata.so", "阿里加固");
       reinforcementSoMaps.put("libpreverify1.so", "阿里加固");
  2.  
  3.    reinforcementSoMaps.put("kdpdata.so", "几维加固");
       reinforcementSoMaps.put("dex.dat", "几维加固");
       reinforcementSoMaps.put("libkdp.so", "几维加固");
       reinforcementSoMaps.put("libkwscmm.so", "几维加固");
       reinforcementSoMaps.put("libkwscr.so", "几维加固");
       reinforcementSoMaps.put("libkwslinker.so", "几维加固");
  4.  
  5.    reinforcementSoMaps.put("libexec.so", "爱加密");
       reinforcementSoMaps.put("libexecmain.so", "爱加密");
       reinforcementSoMaps.put("ijiami.dat", "爱加密");
       reinforcementSoMaps.put("ijiami.ajm", "爱加密");
       reinforcementSoMaps.put("af.bin", "爱加密");
       reinforcementSoMaps.put("signed.bin", "爱加密");
  6.  
  7.    reinforcementSoMaps.put("libchaosvmp.so", "娜迦");
       reinforcementSoMaps.put("libddog.so", "娜迦");
       reinforcementSoMaps.put("libfdog.so", "娜迦");
       reinforcementSoMaps.put("libedog.so", "娜迦");
  8.  
  9.    reinforcementSoMaps.put("libprotectClass.so", "360加固");
       reinforcementSoMaps.put("libjiagu.so", "360加固");
       reinforcementSoMaps.put("libjiagu_art.so", "360加固");
       reinforcementSoMaps.put("libjiagu_x86.so", "360加固");
  10.  
  11.    reinforcementSoMaps.put("libcmvmp.so", "中国移动安全加固");
      reinforcementSoMaps.put("libmogosec_dex.so", "中国移动安全加固");
      reinforcementSoMaps.put("libmogosec_sodecrypt.so", "中国移动安全加固");
        reinforcementSoMaps.put("libmogosecurity.so", "中国移动安全加固");
        
        reinforcementSoMaps.put("libbaiduprotect.so", "百度加固");  
        reinforcementSoMaps.put("baiduprotect1.jar", "百度加固");
        reinforcementSoMaps.put("baiduprotect.jar", "百度加固");
  12.  
  13.   reinforcementSoMaps.put("libuusafe.jar.so", "UU安全加固");
       reinforcementSoMaps.put("libuusafe.so", "UU安全加固");
       reinforcementSoMaps.put("libuusafeempty.so", "UU安全加固");
  14.  
  15.    reinforcementSoMaps.put("dp.arm-v7.so.dat", "DexProtect加固");
       reinforcementSoMaps.put("dp.arm.so.dat", "DexProtect加固");
  16.  
  17.    reinforcementSoMaps.put("libegis.so", "通付盾加固");
       reinforcementSoMaps.put("libNSaferOnly.so", "通付盾加固");
  18.  
  19.    reinforcementSoMaps.put("libreincp.so", "珊瑚灵御加固");
       reinforcementSoMaps.put("libreincp_x86.so", "珊瑚灵御加固");
  20.  
  21.    reinforcementSoMaps.put("libnqshield.so", "网秦加固");
  22.  
  23.    reinforcementSoMaps.put("libnesec.so", "网易易盾");
  24.  
  25.    reinforcementSoMaps.put("libAPKProtect.so", "APKProtect加固");
  26.  
  27.    reinforcementSoMaps.put("libx3g.so", "顶象技术加固");
  28.  
  29.    reinforcementSoMaps.put("libitsec.so", "海云安加固");
  30.  
  31.    reinforcementSoMaps.put("libapssec.so", "盛大加固");
  32.  
  33.    reinforcementSoMaps.put("librsprotect.so", "瑞星加固");
  34.  
  35.    reinforcementSoMaps.put("libapktoolplus_jiagu.so", "apktoolplus加固");
      }
  36.  
  37.   public static void getReinforcementMothByPaths(String[] JavaSourceCodeDirs) throws IOException {
       for (String dirPath : JavaSourceCodeDirs) {
       File fl = new File(dirPath);
       if (fl.exists()) {
       getApkFileReinforcementMoth(fl);
       }
       }
      }
  38.  
  39.   public static void getReinforcementMothByPaths(ArrayList<String> JavaSourceCodeDirs) throws IOException {
       for (String dirPath : JavaSourceCodeDirs) {
       File fl = new File(dirPath);
       if (fl.exists()) {
       getApkFileReinforcementMoth(fl);
       }
       }
      }
  1.   private static void getApkFileReinforcementMoth(File fl) throws IOException {
    if (fl != null && fl.exists()) {
    if (fl.isDirectory()) {
    File[] listFiles = fl.listFiles();
    for (File file : listFiles)
    getApkFileReinforcementMoth(file);
    } else if (fl.isFile() && !fl.isHidden()) {
    if (fl.getName().endsWith(".apk")) {
    Enumeration<? extends ZipEntry> entries = new ZipFile(fl).entries();
    Set<String> libSo = new HashSet<>();
    while (entries.hasMoreElements()) {
    ZipEntry apk = entries.nextElement();
    if (!apk.isDirectory() && apk.getName().startsWith("lib/"))
    libSo.add(apk.getName().substring(apk.getName().lastIndexOf("/") + 1));
    }
    if (libSo.isEmpty()) { // 没有lib
    System.out.println(fl.getName() + ":\t从lib中没有分析出加固方式");
    return;
    }
    Set<String> reinforcementMoth = new HashSet<>();
    // 有so
    for (String libFile : libSo)
    if (reinforcementSoMaps.containsKey(libFile)) {
    reinforcementMoth.add(reinforcementSoMaps.get(libFile));
    }
    if (reinforcementMoth.size() > 0) {
    System.out.println(fl.getName() + ":\t分析出加固方式为:" + reinforcementMoth.toString());
    } else {
    System.out.println(fl.getName() + ":\t从lib中没有分析出加固方式");
    }
    reinforcementMoth.clear();
    }
    }
    }
    }
    }
  1.  

Android 自动分析apk加固方式的更多相关文章

  1. Android 查看Apk签名方式V1和V2

    Android 查看Apk签名方式V1和V2 java -jar apksigner.jar verify -v my.apk -- Verifies Verified using v1 scheme ...

  2. Android实现apk插件方式换肤

    换肤思路: 1.什么时候换肤? xml加载前换肤,如果xml加载后换肤,用户将会看见换肤之前的色彩,用户体验不好. 2.皮肤是什么? 皮肤就是apk,是一个资源包,包含了颜色.图片等. 3.什么样的控 ...

  3. Android中对Apk加固(加壳)续篇之---对Native层(so文件)进行加固

    有人说Android程序用Java代码写的,再怎么弄都是不安全的,很容易破解的,现在晚上关于应用加固的技术也很多了,当然这些也可以用于商业发展的,梆梆加密和爱加密就是很好的例子,当然这两家加固的Apk ...

  4. Android动态方式破解apk终极篇(加固apk破解方式)

    一.前言 今天总算迎来了破解系列的最后一篇文章了,之前的两篇文章分别为: 第一篇:如何使用Eclipse动态调试smali源码 第二篇:如何使用IDA动态调试SO文件 现在要说的就是最后一篇了,如何应 ...

  5. Android Apk加固的初步实现思路(dex整体加固)

    一.前 言 Android Apk加固的发展已经有一段时间了,相对来说本篇博客要记录的Android加壳的实现思路是4年的东西了,已经被老鸟玩烂了,Android加固的安全厂商也不会采用这么粗犷的方式 ...

  6. Android 换肤功能的实现(Apk插件方式)

    一.概述 由于Android 没有提供一套统一的换肤机制,我猜可能是因为国外更注重功能和体验的原因 所以国内如果要做一个漂亮的换肤方案,需要自己去实现. 目前换肤的方法大概有三种方案: (1)把皮肤资 ...

  7. 基于御安全APK加固的游戏反外挂方案

    一. 前言 随着移动互联网的兴起,移动游戏市场近几年突然爆发,收入规模快速增长.根据第三方数据统计,国内移动游戏2015年市场规模已达514.6亿.由于手游市场强势兴起,而且后续增长势头会愈加猛烈.火 ...

  8. [Android Security] APK自我保护 - 字符串处理

    cp : https://segmentfault.com/a/1190000005128037 在开发过程中字符串不可避免,但是这些字符串也可能是破解的关键点,比如服务器的地址和错误提示这些敏感的字 ...

  9. APK加固之类抽取分析与修复

    0x00 简单介绍   目前我己知的APK加固主要有以下两种方式(或有其它的方式有待发现) 隐藏dex文件:通过对目标DEX文件进行整体加密或压缩方式把整个dex转换为另外一个文件存放在assets文 ...

随机推荐

  1. oracle数据库列的操作

    本章和大家分享一下如何在数据库中进行列的一些相关操作. 1.增加列名 (我们先来看一个原始版本) 下面我们增加一个列名tel  记住,增加列时需要把列对应的数据类型要说明,不然会报错. alter t ...

  2. Html.Partial方法和Html.RenderPartial方法

    分布视图 PartialView 一般是功能相对独立的,类似用户控件的视图代码片段,可以被多个视图引用,引用方式如下. 1,Html.Partial方法和Html.RenderPartial方法 静态 ...

  3. RegExp正则表达式对象

    JavaScript的RegExp对象有两种创建方式,一种是字面量,一种是对象. var r = /pattern/attributes或者new RegExp(pattern, attributes ...

  4. Jquery hover 事件

    hover(over,out)一个模仿悬停事件(鼠标移动到一个对象上面及移出这个对象)的方法.这是一个自定义的方法,它为频繁使用的任务提供了一种“保持在其中”的状态. 当鼠标移动到一个匹配的元素上面时 ...

  5. DOM--sql server

    public List<LianHeData> select(int ID) { List<LianHeData> list = new List<LianHeData& ...

  6. C# System.Threading.Timer 定时器

    前提: 需要引入  System.Threading: 描述: 在很多时间我们都需要进行延迟执行,或是定时执行一些指定业务,这个时候使用 Timer 是最合适的,而且 Timer 是Cpu 级别处理对 ...

  7. Python第二周总结

    之所以晚发10天是因为中途发生了很多事情,让我比较懵,甚至都想放弃学Python,但自己选择的路,在艰难也得走下去,加油!!! 补充上期str后缀小魔法: 字符串一旦创建不得修改,一旦修改或拼接,就会 ...

  8. React进阶篇(1) -- react-router4模块化

    本篇内容: 单一的路由无嵌套 多层嵌套路由 获取路径中的参数 按需加载 单一的路由无嵌套 routers.js import Home from 'components/Home'; import N ...

  9. linux系统使用sh文件传参数给matlab程序

      linux系统下使用sh文件传参数给matlab程序 (1)编写sh文件 程序以下面的行开始(必须在文件的第一行):   #!/bin/sh 定义需要传递的参数,用双引号引起,参数之间使用逗号或分 ...

  10. linux下vim python代码自动补全

    一.vim python自动补全插件:pydiction 可以实现下面python代码的自动补全: 1.简单python关键词补全 2.python 函数补全带括号 3.python 模块补全 4.p ...