|
|
@@ -5,6 +5,8 @@ import android.content.Context;
|
|
|
import android.content.SharedPreferences;
|
|
|
import android.net.ConnectivityManager;
|
|
|
import android.net.NetworkInfo;
|
|
|
+import android.os.Build;
|
|
|
+import android.util.Log;
|
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
|
@@ -106,15 +108,16 @@ public class HookSystem extends BaseHook {
|
|
|
ClassLoader classLoader = (ClassLoader) param.args[1];
|
|
|
try {
|
|
|
Class<?> ConnectivityService = null;
|
|
|
+
|
|
|
try {
|
|
|
- ConnectivityService = XposedHelpers.findClass("com.android.server.ConnectivityService", classLoader);
|
|
|
- } catch (Exception e1) {
|
|
|
- e1.printStackTrace();
|
|
|
- try {
|
|
|
+ if (Build.MANUFACTURER.toLowerCase().equals("samsung")) {
|
|
|
ConnectivityService = XposedHelpers.findClass("android.net.connectivity.com.android.server.ConnectivityService", classLoader);
|
|
|
- } catch (Exception e2) {
|
|
|
- e2.printStackTrace();
|
|
|
+ } else {
|
|
|
+ ConnectivityService = XposedHelpers.findClass("com.android.server.ConnectivityService", classLoader);
|
|
|
}
|
|
|
+ } catch (Exception e1) {
|
|
|
+ Log.wtf("HookSystem", "ConnectivityService not found", e1);
|
|
|
+ log("ConnectivityService not found: " + e1.getMessage());
|
|
|
}
|
|
|
if (ConnectivityService != null) {
|
|
|
XposedHelpers.findAndHookMethod(ConnectivityService, "getNetworkInfo", int.class, new XC_MethodHook() {
|