| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- package com.example.modifiermodule;
- import android.annotation.SuppressLint;
- import android.text.TextUtils;
- import android.util.Log;
- import java.lang.reflect.Method;
- import de.robv.android.xposed.XposedBridge;
- public class BaseHook {
- static final String PROP_MCC = "persist.spoof.mcc";
- static final String PROP_MNC = "persist.spoof.mnc";
- static final String PROP_ICCID = "persist.spoof.iccid";
- static final String PROP_IMSI = "persist.spoof.imsi";
- static final String PROP_IMEI = "persist.spoof.imei";
- static final String PROP_NUMBER = "persist.spoof.number";
- static final String PROP_COUNTRY = "persist.spoof.country";
- static final String PROP_CARRIER_ID = "persist.spoof.carrier.id";
- static final String PROP_CARRIER_NAME = "persist.spoof.carrier.name";
- static final String TAG = "Modifier";
- static void log(String message) {
- Log.i(TAG, message);
- XposedBridge.log(TAG + ": " + message);
- }
- @SuppressLint("PrivateApi")
- static String getProperty(String key, String defaultValue) {
- String value = defaultValue;
- try {
- Class<?> c = Class.forName("android.os.SystemProperties");
- Method get = c.getMethod("get", String.class, String.class);
- value = (String) (get.invoke(c, key, defaultValue));
- if (TextUtils.isEmpty(value)) {
- value = defaultValue;
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- return value;
- }
- }
|