魔法管理器 v1.3.3.3版本的 MD5 值为:a95170fff2e9d2a046e882fc18daa858
以下内容为反编译后的 MagicCoreService.java 源代码,内容仅作参考
package cc.omycar.magiccore.services;
import android.app.ActivityManagerNative;
import android.app.IActivityManager;
import android.app.IProcessObserver;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Binder;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.Message;
import android.os.ParcelFileDescriptor;
import android.os.Process;
import android.os.RemoteCallbackList;
import android.os.RemoteException;
import android.os.SystemProperties;
import android.view.Surface;
import cc.omycar.magiccore.IMagicCoreEventCallback;
import cc.omycar.magiccore.IMagicCoreInterface;
import cc.omycar.magiccore.ISentryAppCallback;
import cc.omycar.magiccore.api.Common;
import com.nmmedit.protect.NativeUtil;
import g.b;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import org.json.JSONArray;
import org.json.JSONObject;
public class MagicCoreService extends IMagicCoreInterface.a {
public static int f198f = 1000;
public static String f199g = "1.0.0.0";
public static int f200h = 1000;
public static String f201i = "1.0.0.0";
public static Context f202j;
public static ISentryAppCallback f203k;
public static final cc.omycar.magiccore.api.c f204l;
public static final JSONObject f205m;
public final Handler b = new Handler(new b());
public final String f206c = "tcp://139.155.182.90:2883";
public final int f207d;
public c.b f208e;
public class a implements Runnable {
public final String b;
public final String f209d;
static {
NativeUtil.classesInit0(1125);
}
public a(String str, String str2) {
this.b = str;
this.f209d = str2;
}
@Override
public final native void run();
}
public class b implements Handler.Callback {
static {
NativeUtil.classesInit0(1126);
}
@Override
public final native boolean handleMessage(Message message);
}
public class c implements Runnable {
static {
NativeUtil.classesInit0(1127);
}
@Override
public final native void run();
}
public class d implements Runnable {
static {
NativeUtil.classesInit0(1129);
}
@Override
public final native void run();
}
public class e implements Runnable {
static {
NativeUtil.classesInit0(1130);
}
@Override
public final native void run();
}
public class f implements Runnable {
static {
NativeUtil.classesInit0(1131);
}
@Override
public final native void run();
}
public class g implements Runnable {
static {
NativeUtil.classesInit0(1132);
}
public g() {
}
@Override
public final native void run();
}
public class h implements Runnable {
public final Intent b;
static {
NativeUtil.classesInit0(1133);
}
public h(Intent intent) {
this.b = intent;
}
@Override
public final native void run();
}
public class i {
public final Handler f210a;
public final RemoteCallbackList<IMagicCoreEventCallback> b = new RemoteCallbackList<>();
public i(String str, String str2, String str3, String str4, String str5) {
HandlerThread handlerThread = new HandlerThread("HandlerMagicCoreCallbackList:" + str + ":" + str2 + ":" + str3 + ":" + str4 + ":" + str5);
handlerThread.start();
this.f210a = new Handler(handlerThread.getLooper(), new cc.omycar.magiccore.services.a(this));
}
}
public class j extends e.a {
}
static {
NativeUtil.classesInit0(2126);
f204l = new cc.omycar.magiccore.api.c(1);
f205m = new JSONObject();
}
public MagicCoreService() {
ApplicationInfo applicationInfo;
String[] strArr;
PrintStream printStream = System.out;
printStream.println(new Date() + " MagicCoreService start");
try {
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(Runtime.getRuntime().exec(new String[]{"pidof", Common.SERVER_NAME}).getInputStream()), 4096);
while (true) {
String readLine = bufferedReader.readLine();
if (readLine == null) {
break;
}
String replaceAll = readLine.replaceAll(Process.myPid() + "", "");
if (!replaceAll.trim().isEmpty()) {
Runtime runtime = Runtime.getRuntime();
runtime.exec("kill " + replaceAll);
}
}
} catch (Exception unused) {
}
i("package");
i("activity");
i("user");
i("appops");
if (g.d.f324a == null) {
g.d.c();
}
try {
applicationInfo = g.d.f324a.getPackageManager().getApplicationInfo(Common.MANAGER_PACKAGE_NAME, 0);
} catch (Exception e2) {
e2.printStackTrace();
applicationInfo = null;
}
if (applicationInfo == null) {
System.exit(0);
}
String str = applicationInfo.packageName;
this.f207d = applicationInfo.uid;
try {
Context a2 = g.d.a();
a2.getPackageName();
Objects.toString(a2.getApplicationContext());
new Thread(new c());
SystemProperties.get("sys.motion_switch", "aaa");
try {
g.d.a();
this.b.postDelayed(new d(), 10000L);
this.b.postDelayed(new e(), 30000L);
Context c2 = g.d.c();
f202j = c2;
if (c2 != null) {
if (this.f208e == null) {
this.f208e = c.b.a(c2);
}
try {
Context a3 = g.d.a();
a3.getPackageName();
Objects.toString(a3.getApplicationContext());
a3.checkCallingOrSelfPermission("android.permission.SET_WALLPAPER_COMPONENT");
a3.checkCallingOrSelfPermission("android.permission.MOUNT_UNMOUNT_FILESYSTEMS");
} catch (PackageManager.NameNotFoundException e3) {
throw new RuntimeException(e3);
}
}
new Thread(new f()).start();
this.b.post(new g());
g.b.f322a = this;
b.a aVar = new b.a();
try {
ActivityManagerNative.class.toString();
IActivityManager iActivityManager = (IActivityManager) ActivityManagerNative.class.getMethod("getDefault", new Class[0]).invoke(ActivityManagerNative.class, new Object[0]);
new Binder();
iActivityManager.getClass().getDeclaredMethod("registerProcessObserver", IProcessObserver.class).invoke(iActivityManager, aVar);
Objects.toString(aVar);
} catch (Exception e4) {
System.err.println("Error while accessing settings provider");
System.err.println(e4.getMessage());
}
g.b.c(Common.MANAGER_PACKAGE_NAME);
if (g.d.f324a == null) {
g.d.c();
}
List<PackageInfo> installedPackages = g.d.f324a.getPackageManager().getInstalledPackages(12288);
new JSONArray();
for (PackageInfo packageInfo : installedPackages) {
if (!packageInfo.packageName.equals(Common.MANAGER_PACKAGE_NAME) && (strArr = packageInfo.requestedPermissions) != null && Arrays.asList(strArr).contains(Common.PERMISSION_API)) {
g.b.b(packageInfo.packageName);
}
}
} catch (PackageManager.NameNotFoundException e5) {
throw new RuntimeException(e5);
}
} catch (PackageManager.NameNotFoundException e6) {
throw new RuntimeException(e6);
}
}
public static native void a(String[] strArr, int i2, JSONObject jSONObject, IMagicCoreEventCallback iMagicCoreEventCallback);
public static native void b();
public static native void f(JSONObject jSONObject, String[] strArr, int i2, c.j jVar);
public static native boolean h();
public static native void i(String str);
public static native void main(String[] strArr);
@Override
public final native void GenFolderVideoThumb(String str);
@Override
public final native void add360PreviewSurface(Surface surface, int i2) throws RemoteException;
@Override
public final native void basicTypes(int i2, long j2, boolean z2, float f2, double d2, String str) throws RemoteException;
public final native void c(String str);
@Override
public final native String callFunction(String str, String str2) throws RemoteException;
@Override
public final native void close360Camera(Surface surface, int i2) throws RemoteException;
@Override
public final native void copyFile(String str, String str2) throws RemoteException;
public final native void d(String str);
@Override
public final native boolean deleteFile(String str) throws RemoteException;
public final native void e(String str);
@Override
public final native void exit();
public final native void g(String str, String str2, String str3);
@Override
public final native String getACarStatusValue(String str, String str2, String str3, String str4) throws RemoteException;
@Override
public final native String getACarStatusValueF(String str, String str2, String str3, String str4) throws RemoteException;
@Override
public final native String getAllCarStatusValue() throws RemoteException;
@Override
public final native String getAllEvents() throws RemoteException;
@Override
public final native ParcelFileDescriptor getFileDescriptor(String str) throws RemoteException;
@Override
public final native void grantPermission(String str, String str2) throws RemoteException;
@Override
public final native void initCustomEvent(String str) throws RemoteException;
@Override
public final native boolean is360Open() throws RemoteException;
@Override
public final native boolean is360Preview() throws RemoteException;
@Override
public final native void moveFile(String str, String str2) throws RemoteException;
@Override
public final native void open360Camera(Surface surface, int i2) throws RemoteException;
@Override
public final native boolean open360CameraD() throws RemoteException;
@Override
public final native void postEvent(String str, String str2, String str3, int i2, int i3, double d2, String str4) throws RemoteException;
@Override
public final native void pushMqttMsg(String str) throws RemoteException;
@Override
public final native boolean registerCustomEvent(String str, String str2, String str3, String str4, int i2, int i3, int i4);
@Override
public final native void registerEventCallBackByDeviceType(int i2, IMagicCoreEventCallback iMagicCoreEventCallback) throws RemoteException;
@Override
public final native void registerMagicCoreEventCallBack(String str, String str2, String str3, String str4, String str5, IMagicCoreEventCallback iMagicCoreEventCallback) throws RemoteException;
@Override
public final native void registerMagicCoreEventCallBack2(IMagicCoreEventCallback iMagicCoreEventCallback) throws RemoteException;
@Override
public final native void registerSentryAppCallBack(ISentryAppCallback iSentryAppCallback) throws RemoteException;
@Override
public final native void renameFile(String str, String str2) throws RemoteException;
@Override
public final native void revokePermission(String str, String str2) throws RemoteException;
@Override
public final native String saveAllEvents(String str) throws RemoteException;
@Override
public final native void set360Preview(Surface surface, int i2) throws RemoteException;
@Override
public final native void set360PreviewSize(int i2, int i3) throws RemoteException;
@Override
public final native void set360PreviewSurface(Surface surface, int i2) throws RemoteException;
@Override
public final native void setBoolSetting(String str, boolean z2) throws RemoteException;
@Override
public final native void setCameraFps(int i2) throws RemoteException;
@Override
public final native void setCameraInfo(String str) throws RemoteException;
@Override
public final native void setFastBoot(boolean z2) throws RemoteException;
@Override
public final native void setFloatSetting(String str, float f2) throws RemoteException;
@Override
public final native void setIntSetting(String str, int i2) throws RemoteException;
@Override
public final native void setKeepWakeUpAfterAccOff(boolean z2) throws RemoteException;
@Override
public final native void setLanguage(int i2) throws RemoteException;
@Override
public final native void setLiveWallpaper(String str, String str2) throws RemoteException;
@Override
public final native void setPP(int i2, int i3, int i4, int i5, int i6) throws RemoteException;
@Override
public final native void setStopAfterAccOff(boolean z2) throws RemoteException;
@Override
public final native void setStringSetting(String str, String str2) throws RemoteException;
@Override
public final native void start360Preview() throws RemoteException;
@Override
public final native void stop360Preview() throws RemoteException;
@Override
public final native void test(int i2) throws RemoteException;
@Override
public final native void testSurfaceView(Surface surface, int i2) throws RemoteException;
@Override
public final native void toScreenShow();
}