赞
踩
https://blog.csdn.net/weixin_43290551/article/details/125954709
https://blog.csdn.net/qq_41940277/article/details/122610916
https://vscode.cdn.azure.cn/stable/5e805b79fcb6ba4c2d23712967df89a089da575b/code_1.76.1-1678294265_amd64.deb
sudo dpkg -i 文件
这一条命令就够了sudo snap install code
sudo rm /var/lib/dpkg/lock-frontend
sudo rm /var/lib/dpkg/lock
sudo apt update
sudo apt-get install git-core gnupg flex bison build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev libgl1-mesa-dev libxml2-utils xsltproc unzip fontconfig
sudo apt htop jnettop
使用時要加sudo
sudo apt install proxychains
sudo nano /etc/proxychains.conf 配置科學
proxychains curl http://httpbin.org/ip
到20%的时候会暂停一下
按enter然後空格
給vendor權限 记得这个文件夹下面所有文件都要给权限
sudo chmod 777 -R vendor/
在安卓源码根目录下找到/build/envsetup.sh
文件,在文件的最后加入下面的代码
export LC_ALL=C
安卓8.1.0源码默认带了jdk
路径在/prebuilts/jdk/jdk8
,我选择将/prebuilts/jdk/jdk8/linux-x86/bin
添加到了环境变量.
先打开.bashrc
文件,在文件的最后加上export PATH=$PATH:/home/lingzhiyi/Documents/aosp-all/aosp-pixel810/aosp810r1/prebuilts/jdk/jdk8/linux-x86/bin
回到安卓根目录
source build/envsetup.sh
lunch 24 // lunch aosp_saifish-user
make -j6 // 6表示6个线程
到源码目录source build/envsetup.sh
lunch
aosp_sailfish-user
/build/make/target/product/core.mk
文件,注意增加的地方app = data.info.makeApplication(data.restrictedBackupMode, null); // demoli-add start String curPkgName = data.appInfo.packageName; String path_for_gadget = "/sdcard/" + curPkgName+"demoligadgethook"; File path_curPkgName = new File(path_for_gadget); if(path_curPkgName.exists()){ String arch = System.getProperty("os.arch"); try{ if (arch != null && arch.contains("64")){ System.load("/system/lib64/demoli.so"); }else{ System.load("/system/lib/demoli.so"); } Slog.e("demoli", "load gadget successful"); } catch (Exception e) { Slog.e("demoli", "demoli_failed=" + e.toString()); } } // demoli-add end // demoli-add start //String curPkgName = app.getPackageName(); String path_for_dex = "/sdcard/"+curPkgName+"demolidexhook.dex"; File file = new File(path_for_dex); if(file.exists()){ try { //获取到 BaseDexClassLoader 的 pathList字段 // private final DexPathList pathList; // find("BaseDexClassLoader","") Field pathListField = BaseDexClassLoader.class.getDeclaredField("pathList"); //破坏封装,设置为可以调用 pathListField.setAccessible(true); //拿到当前ClassLoader的pathList对象 Object pathListObj = pathListField.get(app.getClassLoader()); //获取当前ClassLoader的pathList对象的字节码文件(DexPathList ) Class<?> dexPathListClass = pathListObj.getClass(); //拿到DexPathList 的 dexElements字段 // private final Element[] dexElements; Field dexElementsField = dexPathListClass.getDeclaredField("dexElements"); //破坏封装,设置为可以调用 dexElementsField.setAccessible(true); //使用插件创建 ClassLoader DexClassLoader pathClassLoader = new DexClassLoader(file.getPath(), file.getAbsolutePath(), null, app.getClassLoader()); //拿到插件的DexClassLoader 的 pathList对象 Object newPathListObj = pathListField.get(pathClassLoader); //拿到插件的pathList对象的 dexElements变量 Object newDexElementsObj = dexElementsField.get(newPathListObj); //拿到当前的pathList对象的 dexElements变量 Object dexElementsObj=dexElementsField.get(pathListObj); int oldLength = Array.getLength(dexElementsObj); int newLength = Array.getLength(newDexElementsObj); //创建一个dexElements对象 Object concatDexElementsObject = Array.newInstance(dexElementsObj.getClass().getComponentType(), oldLength + newLength); //先添加新的dex添加到dexElement for (int i = 0; i < newLength; i++) { Array.set(concatDexElementsObject, i, Array.get(newDexElementsObj, i)); } //再添加之前的dex添加到dexElement for (int i = 0; i < oldLength; i++) { Array.set(concatDexElementsObject, newLength + i, Array.get(dexElementsObj, i)); } //将组建出来的对象设置给 当前ClassLoader的pathList对象 dexElementsField.set(pathListObj, concatDexElementsObject); Slog.e("dexhook","demoli add dex successful!"); } catch (Exception e) { e.printStackTrace(); } }else{ Slog.e("dexhook",path_for_dex + " not exists"); } String path_for_apk = "/sdcard/"+curPkgName+"demoliapkhook.apk"; File file_apk = new File(path_for_apk); if(file_apk.exists()){ try { //获取到 BaseDexClassLoader 的 pathList字段 // private final DexPathList pathList; Field pathListField2 = BaseDexClassLoader.class.getDeclaredField("pathList"); //破坏封装,设置为可以调用 pathListField2.setAccessible(true); //拿到当前ClassLoader的pathList对象 Object pathListObj2 = pathListField2.get(app.getClassLoader()); //获取当前ClassLoader的pathList对象的字节码文件(DexPathList ) Class<?> dexPathListClass2 = pathListObj2.getClass(); //拿到DexPathList 的 dexElements字段 // private final Element[] dexElements; Field dexElementsField2 = dexPathListClass2.getDeclaredField("dexElements"); //破坏封装,设置为可以调用 dexElementsField2.setAccessible(true); //使用插件创建 ClassLoader DexClassLoader pathClassLoader2 = new DexClassLoader(file_apk.getPath(), file_apk.getAbsolutePath(), null, app.getClassLoader()); //拿到插件的DexClassLoader 的 pathList对象 Object newpathListObj2 = pathListField2.get(pathClassLoader2); //拿到插件的pathList对象的 dexElements变量 Object newDexElementsObj2 = dexElementsField2.get(newpathListObj2); //将插件的 dexElements对象设置给 当前ClassLoader的pathList对象 dexElementsField2.set(pathListObj2, newDexElementsObj2); Slog.e("dexhook","demoli add apk successful!"); } catch (Exception e) { e.printStackTrace(); } }else{ Slog.e("apkhook",path_for_apk+" not exists"); } // demoli add end
/system/core/init/property_service.cpp
中电脑太垃圾了 等我编译出来在发个效果
赞
踩
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。