Comments (1)
请教一下大佬,现在的版本只能进行单classes.dex文件的加固 如果是多classes.dex文件,应该如何实现加固呢?
通过下面这个函数,将dump下来的其他DEX拼接到pathList字段里面去即可。
public void load(Context oApp, String path) {
try {
// 已加载的dex
Object dexPathList = getField(BaseDexClassLoader.class, "pathList", oApp.getClassLoader());
Object dexElements = getField(dexPathList.getClass(), "dexElements", dexPathList);
// patchdex
String dexOptDir = oApp.getCacheDir().getAbsolutePath();
DexClassLoader dcl = new DexClassLoader(path, dexOptDir, null, oApp.getClassLoader());
Object patchDexPathList = getField(BaseDexClassLoader.class, "pathList", dcl);
Object patchDexElements = getField(patchDexPathList.getClass(), "dexElements", patchDexPathList);
// 将patchdex和已加载的dexes数组拼接连接
Object concatDexElements = concatArray(patchDexElements, dexElements);
// 重新给dexPathList#dexElements赋值
setField(dexPathList.getClass(), "dexElements", dexPathList, concatDexElements);
} catch (NoSuchFieldException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
from apksheller.
Related Issues (8)
- 怎么用啊
- 如果apk有多个dex要怎么处理呢 HOT 1
- 请问支持aab加固吗?或者加固后的apk能否转成aab? HOT 1
- 启动时闪退 HOT 1
- python -f xxx.apk用不了啊
- cn.yongye.stub这个包名改了加固出来的包就安装不了 HOT 1
- 1111
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apksheller.