23 | * public long divideBy(long value) { 24 | * Preconditions.checkArgument(value != 0); 25 | * return this.value / value; 26 | * } 27 | *28 | * 29 | * @author Inderjeet Singh 30 | * @author Joel Leitch 31 | */ 32 | public final class $Gson$Preconditions { 33 | private $Gson$Preconditions() { 34 | throw new UnsupportedOperationException(); 35 | } 36 | 37 | public static
23 | * This implementation just calls {@link AccessibleObject#setAccessible(boolean) setAccessible(true)}, which worked 24 | * fine before Java 9. 25 | */ 26 | final class PreJava9ReflectionAccessor extends ReflectionAccessor { 27 | 28 | /** {@inheritDoc} */ 29 | @Override 30 | public void makeAccessible(AccessibleObject ao) { 31 | ao.setAccessible(true); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/com/zhenxi/external/gson/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This package provides the {@link zhenxi.external.gson.Gson} class to convert Json to Java and 3 | * vice-versa. 4 | * 5 | *
The primary class to use is {@link zhenxi.external.gson.Gson} which can be constructed with 6 | * {@code new Gson()} (using default settings) or by using {@link zhenxi.external.gson.GsonBuilder} 7 | * (to configure various options such as using versioning and so on).
8 | * 9 | * @author Inderjeet Singh, Joel Leitch 10 | */ 11 | package com.zhenxi.external.gson; -------------------------------------------------------------------------------- /app/src/main/java/com/zhenxi/external/gson/reflect/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This package provides utility classes for finding type information for generic types. 3 | * 4 | * @author Inderjeet Singh, Joel Leitch 5 | */ 6 | package com.zhenxi.external.gson.reflect; -------------------------------------------------------------------------------- /app/src/main/java/com/zhenxi/jnitrace/bean/AppBean.java: -------------------------------------------------------------------------------- 1 | package com.zhenxi.jnitrace.bean; 2 | 3 | import android.graphics.drawable.Drawable; 4 | 5 | import androidx.annotation.NonNull; 6 | 7 | /** 8 | * Created by lyh on 2019/2/14. 9 | */ 10 | 11 | public class AppBean { 12 | 13 | 14 | public String appName; 15 | 16 | public String packageName; 17 | 18 | public Drawable appIcon; 19 | 20 | 21 | public boolean isSystemApp=false; 22 | 23 | 24 | @NonNull 25 | @Override 26 | public String toString() { 27 | return "AppBean{" + 28 | "appName='" + appName + '\'' + 29 | ", packageName='" + packageName + '\'' + 30 | ", appIcon=" + appIcon + 31 | ", isSystemApp=" + isSystemApp + 32 | '}'; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/src/main/java/com/zhenxi/jnitrace/config/ConfigKey.java: -------------------------------------------------------------------------------- 1 | package com.zhenxi.jnitrace.config; 2 | 3 | /** 4 | * Created by Zhenxi on 2019/4/3. 5 | */ 6 | 7 | public class ConfigKey { 8 | 9 | 10 | public static final String CONFIG_JSON="CONFIG_JSON"; 11 | /** 12 | * 选中的包名 13 | */ 14 | public static final String PACKAGE_NAME="PACKAGE_NAME"; 15 | 16 | /** 17 | * 注入模块So的Path 18 | */ 19 | public static final String MOUDLE_SO_PATH="MOUDLE_SO_PATH"; 20 | 21 | /** 22 | * 选择Apk的时间,十分钟有效 23 | */ 24 | public static final String SAVE_TIME="SAVE_TIME"; 25 | 26 | /** 27 | * 是否开启内存序列化 28 | */ 29 | public static final String IS_SERIALIZATION="IS_SERIALIZATION"; 30 | 31 | /** 32 | * 是否监听全部的SO文件 33 | */ 34 | public static final String IS_LISTEN_TO_ALL="IS_LISTEN_TO_ALL"; 35 | 36 | 37 | /** 38 | * 过滤的集合 39 | */ 40 | public static final String FILTER_LIST="FILTER_LIST"; 41 | 42 | /** 43 | * 开启的功能列表 44 | */ 45 | public static final String LIST_OF_FUNCTIONS="LIST_OF_FUNCTIONS"; 46 | 47 | 48 | } 49 | -------------------------------------------------------------------------------- /app/src/main/java/com/zhenxi/jnitrace/utils/AES.java: -------------------------------------------------------------------------------- 1 | package com.zhenxi.jnitrace.utils; 2 | 3 | import javax.crypto.Cipher; 4 | import javax.crypto.SecretKey; 5 | import javax.crypto.spec.SecretKeySpec; 6 | 7 | /** 8 | * Created by Lyh on 9 | * 2019/9/23 10 | */ 11 | public class AES { 12 | 13 | /** 14 | * 用秘钥进行加密 15 | * @param content 明文 16 | * @param secretKey 秘钥 17 | * @return byte数组的密文 18 | * @throws Exception 19 | */ 20 | public static byte[] encrypt(String content, SecretKey secretKey) throws Exception { 21 | // 秘钥 22 | byte[] enCodeFormat = secretKey.getEncoded(); 23 | return encrypt(content, enCodeFormat); 24 | } 25 | 26 | /** 27 | * 用秘钥进行加密 28 | * @param content 明文 29 | * @param secretKeyEncoded 秘钥Encoded 30 | * @return byte数组的密文 31 | * @throws Exception 32 | */ 33 | public static byte[] encrypt(String content, byte[] secretKeyEncoded) throws Exception { 34 | // 创建AES秘钥 35 | SecretKeySpec key = new SecretKeySpec(secretKeyEncoded, "AES"); 36 | // 创建密码器 37 | Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); 38 | // Cipher cipher = Cipher.getInstance("AES"); 39 | // 初始化加密器 40 | cipher.init(Cipher.ENCRYPT_MODE, key); 41 | // 加密 42 | return cipher.doFinal(content.getBytes("UTF-8")); 43 | } 44 | 45 | 46 | 47 | 48 | } 49 | -------------------------------------------------------------------------------- /app/src/main/java/com/zhenxi/jnitrace/utils/GsonUtils.java: -------------------------------------------------------------------------------- 1 | package com.zhenxi.jnitrace.utils; 2 | 3 | 4 | import com.zhenxi.external.gson.Gson; 5 | import com.zhenxi.external.gson.GsonBuilder; 6 | 7 | /** 8 | * Created by Zhenxi on 9 | * 2019/11/12 10 | */ 11 | public class GsonUtils { 12 | 13 | 14 | public static final Gson gson = new GsonBuilder() 15 | .setLenient() 16 | .create(); 17 | 18 | 19 | public static