|
|
@@ -1,19 +1,31 @@
|
|
|
package com.example.modifiermodule;
|
|
|
|
|
|
+import static fi.iki.elonen.NanoHTTPD.Response.Status.INTERNAL_ERROR;
|
|
|
+
|
|
|
+import android.annotation.SuppressLint;
|
|
|
import android.content.AttributionSource;
|
|
|
+import android.content.BroadcastReceiver;
|
|
|
+import android.content.Context;
|
|
|
+import android.content.Intent;
|
|
|
+import android.content.IntentFilter;
|
|
|
import android.net.ConnectivityManager;
|
|
|
import android.net.NetworkInfo;
|
|
|
import android.os.Build;
|
|
|
import android.util.Log;
|
|
|
|
|
|
+import org.apache.commons.io.IOUtils;
|
|
|
import org.apache.commons.lang3.RandomStringUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
|
import java.io.File;
|
|
|
+import java.io.IOException;
|
|
|
+import java.nio.charset.StandardCharsets;
|
|
|
+import java.util.HashMap;
|
|
|
|
|
|
import de.robv.android.xposed.XC_MethodHook;
|
|
|
import de.robv.android.xposed.XposedHelpers;
|
|
|
import de.robv.android.xposed.callbacks.XC_LoadPackage;
|
|
|
+import fi.iki.elonen.NanoHTTPD;
|
|
|
|
|
|
public class HookSystem extends BaseHook {
|
|
|
|
|
|
@@ -29,6 +41,23 @@ public class HookSystem extends BaseHook {
|
|
|
log("setConfigFile fail");
|
|
|
}
|
|
|
|
|
|
+ try {
|
|
|
+ new NanoHTTPD(6101) {
|
|
|
+ @Override
|
|
|
+ public Response serve(IHTTPSession session) {
|
|
|
+ try {
|
|
|
+ final HashMap<String, String> map = new HashMap<>();
|
|
|
+ session.parseBody(map);
|
|
|
+ return newFixedLengthResponse("body:" + map.toString());
|
|
|
+ } catch (Exception e) {
|
|
|
+ return newFixedLengthResponse(INTERNAL_ERROR, MIME_PLAINTEXT, e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }.start();
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+
|
|
|
try {
|
|
|
Class<?> DeviceIdentifiersPolicy = XposedHelpers.findClass("com.android.server.os.DeviceIdentifiersPolicyService$DeviceIdentifiersPolicy", lpparam.classLoader);
|
|
|
XposedHelpers.findAndHookMethod(DeviceIdentifiersPolicy, "getSerial", new XC_MethodHook() {
|