Java Code Examples for de.robv.android.xposed.XSharedPreferences#makeWorldReadable()

The following examples show how to use de.robv.android.xposed.XSharedPreferences#makeWorldReadable() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LocationHolder.java    From PokeFaker with MIT License 5 votes vote down vote up
private LocationHolder(Context context) {
    if (context != null) {
        mHandler = new Handler(Looper.getMainLooper());
        mPreference = context.getSharedPreferences("location", Context.MODE_WORLD_READABLE);
    } else {
        mXPreference = new XSharedPreferences("com.github.jinsen47.pokefaker", "location");
        mXPreference.makeWorldReadable();
    }
}
 
Example 2
Source File: AliPayHook.java    From XposedManyMoney with GNU General Public License v2.0 5 votes vote down vote up
public AliPayHook(String versionName) {
    xsp = new XSharedPreferences(BuildConfig.APPLICATION_ID, SettingLabelView.DEFAULT_PREFERENCES_NAME);
    xsp.makeWorldReadable();
    switch (versionName) {
        default:
            ttsClassName = "com.alipay.mobile.rome.pushservice.tts.e";
            break;
    }
}
 
Example 3
Source File: Lockscreen.java    From android-lockscreen-disabler with Apache License 2.0 5 votes vote down vote up
@Override
public void initZygote(StartupParam startupParam) throws Throwable {
    prefs = new XSharedPreferences("com.lr.keyguarddisabler");
    prefs.makeWorldReadable();
    lockScreenTimeoutToEnforce = Integer.parseInt(prefs.getString("lockscreentimeout", "1")) * 60 * 1000;
    LOG = prefs.getBoolean("logtofile", false);
    lockScreenType = prefs.getString("lockscreentype", LOCK_SCREEN_TYPE_SLIDE);
    lockonBootup = prefs.getBoolean("lockscreenonboot", false);
    // Make sure we start any bootup locked...
}
 
Example 4
Source File: ProxyHook.java    From Inspeckage with Apache License 2.0 4 votes vote down vote up
public static void loadPrefs() {
    sPrefs = new XSharedPreferences(Module.class.getPackage().getName(), Module.PREFS);
    sPrefs.makeWorldReadable();
}
 
Example 5
Source File: XposedModule.java    From HideMockLocation with MIT License 4 votes vote down vote up
@Override
public void initZygote(StartupParam startupParam) throws Throwable {
    prefs = new XSharedPreferences(Common.PACKAGE_NAME, Common.PACKAGE_PREFERENCES);
    prefs.makeWorldReadable();

    hideAllowMockSettingHook = new XC_ProcessNameMethodHook() {
        @Override
        protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
            if (!Common.SYSTEM_WHITELIST.contains(this.processName) &&
                    !Common.SYSTEM_WHITELIST.contains(this.packageName)) {
                reloadPrefs();
                if (isHidingEnabled()) {
                    String methodName = param.method.getName();
                    String setting = (String) param.args[1];
                    if (setting.equals(Settings.Secure.ALLOW_MOCK_LOCATION)) {
                        switch (methodName) {
                            case "getInt":
                                param.setResult(0);
                                break;
                            case "getString":
                                param.setResult("0");
                                break;
                            case "getFloat":
                                param.setResult(0.0f);
                                break;
                            case "getLong":
                                param.setResult(0L);
                                break;
                            default:
                                break;
                        }
                    }
                }
            }
        }
    };

    hideMockProviderHook = new XC_ProcessNameMethodHook() {
        @Override
        protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
            reloadPrefs();
            boolean isGMSWhitelisted = prefs.getBoolean(Common.PREF_GMS_WHITELISTED, false);
            if (!isGMSWhitelisted || !this.packageName.equals(Common.GMS_PACKAGE)) {
                if(isHidingEnabled())
                    param.setResult(false);
            }
        }
    };

    hideMockGooglePlayServicesHook = new XC_ProcessNameMethodHook() {
        @Override
        protected void afterHookedMethod(MethodHookParam param) throws Throwable {
            reloadPrefs();
            if(isHidingEnabled()) {
                Bundle extras = (Bundle) param.getResult();
                if (extras != null && extras.getBoolean(Common.GMS_MOCK_KEY))
                    extras.putBoolean(Common.GMS_MOCK_KEY, false);
                param.setResult(extras);
            }
        }
    };
}
 
Example 6
Source File: SettingsHelper.java    From WechatUnrecalled with GNU General Public License v3.0 4 votes vote down vote up
public SettingsHelper(String name) {
    mXPreferences = new XSharedPreferences(name);
    mXPreferences.makeWorldReadable();
    this.reload();
}
 
Example 7
Source File: XposedMod.java    From XposedAppLocale with Apache License 2.0 4 votes vote down vote up
public static void loadPrefs() {
    prefs = new XSharedPreferences(Common.MY_PACKAGE_NAME, Common.PREFS);
    prefs.makeWorldReadable();
}
 
Example 8
Source File: Module.java    From Inspeckage with Apache License 2.0 4 votes vote down vote up
public void initZygote(StartupParam startupParam) throws Throwable {
    sPrefs = new XSharedPreferences(MY_PACKAGE_NAME, PREFS);
    sPrefs.makeWorldReadable();
}
 
Example 9
Source File: FingerprintHook.java    From Inspeckage with Apache License 2.0 4 votes vote down vote up
public static void loadPrefs() {
    sPrefs = new XSharedPreferences(Module.class.getPackage().getName(), Module.PREFS);
    sPrefs.makeWorldReadable();
}
 
Example 10
Source File: SSLPinningHook.java    From Inspeckage with Apache License 2.0 4 votes vote down vote up
public static void loadPrefs() {
    sPrefs = new XSharedPreferences(Module.class.getPackage().getName(), Module.PREFS);
    sPrefs.makeWorldReadable();
}
 
Example 11
Source File: UserHooks.java    From Inspeckage with Apache License 2.0 4 votes vote down vote up
public static void loadPrefs() {
    sPrefs = new XSharedPreferences(Module.class.getPackage().getName(), Module.PREFS);
    sPrefs.makeWorldReadable();
}
 
Example 12
Source File: SettingsHelper.java    From ActivityForceNewTask with GNU General Public License v3.0 4 votes vote down vote up
public SettingsHelper() {
    xSharedPreferences = new XSharedPreferences(Common.PACKAGE_NAME, Common.PREFS);
    xSharedPreferences.makeWorldReadable();
    listType = getListType();
    listItems = getListItems(listType);
}
 
Example 13
Source File: FlagSecureHook.java    From Inspeckage with Apache License 2.0 4 votes vote down vote up
public static void loadPrefs() {
    sPrefs = new XSharedPreferences(Module.class.getPackage().getName(), Module.PREFS);
    sPrefs.makeWorldReadable();
}
 
Example 14
Source File: SharedPrefsHook.java    From Inspeckage with Apache License 2.0 4 votes vote down vote up
public static void loadPrefs() {
    sPrefs = new XSharedPreferences(Module.class.getPackage().getName(), Module.PREFS);
    sPrefs.makeWorldReadable();
}
 
Example 15
Source File: DataHook.java    From XposedNavigationBar with GNU General Public License v3.0 4 votes vote down vote up
public static void init(IXposedHookZygoteInit.StartupParam startupParam) throws Throwable {
    XSharedPreferences pre = new XSharedPreferences(BuildConfig.APPLICATION_ID, "xpnavbar");
    pre.makeWorldReadable();

    String json = pre.getString(ConstantStr.SHORT_CUT_DATA, "");
    XpLog.i("short_cut_data " + json);
    expandStatusBarWithRoot = pre.getBoolean(SPUtil.ROOT_DOWN, false);
    clearMenLevel = pre.getInt(SPUtil.CLEAR_MEM_LEVEL, 200);
    //获取主导行栏小点的位置
    homePointPosition = pre.getInt(ConstantStr.HOME_POINT, 0);
    chameleonNavbar = pre.getBoolean(SPUtil.CHAMELEON_NAVBAR, false);
    rootDown = pre.getBoolean(SPUtil.ROOT_DOWN, false);
    vibrate = pre.getBoolean(SPUtil.NAVBAR_VIBRATE, false);
    //获取快捷按钮设置数据
    Gson gson = new Gson();
    //在第一次激活重新启动的时候,可能因为没有设置任何快捷按钮,导致这里报错
    try {
        shortCutList = gson.fromJson(json, ShortCutData.class).getData();
    } catch (Exception e) {
        shortCutList = new ArrayList<>();
    }

    //获取图片缩放大小
    iconScale = pre.getInt(ConstantStr.ICON_SIZE, 40);

    navbarHeight = pre.getInt(SPUtil.NAVBAR_HEIGHT, 100);

    navbarOpt = pre.getBoolean(SPUtil.NAVBAR_HEIGHT_OPT, false);

    goHomeAfterClick = pre.getBoolean(SPUtil.GO_HOME_AFTER_CLICK, false);

    //加载图片资源文件
    Resources res = XModuleResources.createInstance(startupParam.modulePath, null);
    byte[] backImg = XposedHelpers.assetAsByteArray(res, "back.png");
    byte[] clearMenImg = XposedHelpers.assetAsByteArray(res, "clear_mem.png");
    byte[] clearNotificationImg = XposedHelpers.assetAsByteArray(res, "clear_notification.png");
    byte[] downImg = XposedHelpers.assetAsByteArray(res, "down.png");
    byte[] lightImg = XposedHelpers.assetAsByteArray(res, "light.png");
    byte[] quickNoticesImg = XposedHelpers.assetAsByteArray(res, "quick_notices.png");
    byte[] screenOffImg = XposedHelpers.assetAsByteArray(res, "screenoff.png");
    //  byte[] upImg = XposedHelpers.assetAsByteArray(res, "up.png");
    byte[] volume = XposedHelpers.assetAsByteArray(res, "volume.png");
    byte[] smallPonit = XposedHelpers.assetAsByteArray(res, "small_point.png");
    byte[] home = XposedHelpers.assetAsByteArray(res, "ic_home.png");
    byte[] startActs = XposedHelpers.assetAsByteArray(res, "start_acts.png");
    byte[] playMusic = XposedHelpers.assetAsByteArray(res, "ic_music.png");
    byte[] pauseMusic = XposedHelpers.assetAsByteArray(res, "ic_pause.png");
    byte[] previousMusic = XposedHelpers.assetAsByteArray(res, "ic_previous.png");
    byte[] nextMusic = XposedHelpers.assetAsByteArray(res, "ic_next.png");
    byte[] scanWeChat = XposedHelpers.assetAsByteArray(res, "wechat_qr.png");
    byte[] scanAlipay = XposedHelpers.assetAsByteArray(res, "alipay_qr.png");
    byte[] screenshot = XposedHelpers.assetAsByteArray(res, "ic_image.png");
    byte[] navBack = XposedHelpers.assetAsByteArray(res, "ic_sysbar_back.png");
    byte[] navHome = XposedHelpers.assetAsByteArray(res, "ic_sysbar_home.png");
    byte[] navRecent = XposedHelpers.assetAsByteArray(res, "ic_sysbar_recent.png");
    byte[] clipBoard = XposedHelpers.assetAsByteArray(res, "ic_clipboard.png");
    byte[] command = XposedHelpers.assetAsByteArray(res, "ic_command.png");
    byte[] navHide = XposedHelpers.assetAsByteArray(res, "ic_nav_down.png");

    mapImgRes.put(ConstantStr.FUNC_BACK_CODE, backImg);
    mapImgRes.put(ConstantStr.FUNC_CLEAR_MEM_CODE, clearMenImg);
    mapImgRes.put(ConstantStr.FUNC_CLEAR_NOTIFICATION_CODE, clearNotificationImg);
    mapImgRes.put(ConstantStr.FUNC_DOWN_CODE, downImg);
    mapImgRes.put(ConstantStr.FUNC_LIGHT_CODE, lightImg);
    mapImgRes.put(ConstantStr.FUNC_QUICK_NOTICE_CODE, quickNoticesImg);
    mapImgRes.put(ConstantStr.FUNC_SCREEN_OFF_CODE, screenOffImg);
    //  mapImgRes.put(ConstantStr.UP, upImg);
    mapImgRes.put(ConstantStr.FUNC_VOLUME_CODE, volume);
    mapImgRes.put(ConstantStr.FUNC_SMALL_POINT_CODE, smallPonit);
    mapImgRes.put(ConstantStr.FUNC_HOME_CODE, home);
    mapImgRes.put(ConstantStr.FUNC_START_ACTS_CODE, startActs);
    mapImgRes.put(ConstantStr.FUNC_PLAY_MUSIC_CODE, playMusic);
    mapImgRes.put(ConstantStr.FUNC_NEXT_PLAY_CODE, nextMusic);
    mapImgRes.put(ConstantStr.FUNC_PREVIOUS_PLAY_CODE, previousMusic);
    mapImgRes.put(ConstantStr.FUNC_WECHAT_SACNNER_CODE, scanWeChat);
    mapImgRes.put(ConstantStr.FUNC_ALIPAY_SACNNER_CODE, scanAlipay);
    mapImgRes.put(ConstantStr.FUNC_SCREEN_SHOT_CODE, screenshot);
    mapImgRes.put(ConstantStr.FUNC_NAV_BACK_CODE, navBack);
    mapImgRes.put(ConstantStr.FUNC_NAV_HOME_CODE, navHome);
    mapImgRes.put(ConstantStr.FUNC_NAV_RECENT_CODE, navRecent);
    mapImgRes.put(ConstantStr.FUNC_CLIPBOARD_CODE, clipBoard);
    mapImgRes.put(ConstantStr.FUNC_COMMAND_CODE, command);
    mapImgRes.put(ConstantStr.FUNC_NAV_HIDE_CODE, navHide);
}
 
Example 16
Source File: GravityBox.java    From GravityBox with Apache License 2.0 4 votes vote down vote up
@Override
    public void initZygote(StartupParam startupParam) throws Throwable {
        MODULE_PATH = startupParam.modulePath;
        prefs = new XSharedPreferences(PACKAGE_NAME);
        prefs.makeWorldReadable();
        if (!startupParam.startsSystemServer) return;

        XposedBridge.log("GB:Hardware: " + Build.HARDWARE);
        XposedBridge.log("GB:Product: " + Build.PRODUCT);
        XposedBridge.log("GB:Device manufacturer: " + Build.MANUFACTURER);
        XposedBridge.log("GB:Device brand: " + Build.BRAND);
        XposedBridge.log("GB:Device model: " + Build.MODEL);
        XposedBridge.log("GB:Device type: " + (Utils.isTablet() ? "tablet" : "phone"));
        XposedBridge.log("GB:Is MTK device: " + Utils.isMtkDevice());
        XposedBridge.log("GB:Is Xperia device: " + Utils.isXperiaDevice());
        XposedBridge.log("GB:Is Moto XT device: " + Utils.isMotoXtDevice());
        XposedBridge.log("GB:Is OxygenOS 4.5 ROM: " + Utils.isOxygenOs45Rom());
        XposedBridge.log("GB:Has Lenovo custom UI: " + Utils.hasLenovoCustomUI());
        if (Utils.hasLenovoCustomUI()) {
            XposedBridge.log("GB:Lenovo UI is VIBE: " + Utils.hasLenovoVibeUI());
            XposedBridge.log("GB:Lenovo ROM is ROW: " + Utils.isLenovoROW());
        }
        XposedBridge.log("GB:Has telephony support: " + Utils.hasTelephonySupport());
        XposedBridge.log("GB:Has Gemini support: " + Utils.hasGeminiSupport());
        XposedBridge.log("GB:Android SDK: " + Build.VERSION.SDK_INT);
        XposedBridge.log("GB:Android Release: " + Build.VERSION.RELEASE);
        XposedBridge.log("GB:ROM: " + Build.DISPLAY);

        if (!ArrayUtils.arrayHas(SUPPORT_SDK, Build.VERSION.SDK_INT)) {
            XposedBridge.log("!!! GravityBox you are running is not designed for "
                    + "Android SDK " + Build.VERSION.SDK_INT + " !!!");
            return;
        }

        SystemWideResources.initResources(prefs);

        // Common
        ModInputMethod.initZygote(prefs);
        PhoneWrapper.initZygote(prefs);
        ModTelephony.initZygote(prefs);

        // MTK (deprecated)
//        if (Utils.isMtkDevice()) {
//            if (prefs.getBoolean(GravityBoxSettings.PREF_KEY_MTK_FIX_DEV_OPTS, false)) {
//                MtkFixDevOptions.initZygote();
//            }
//        }
    }
 
Example 17
Source File: Settings.java    From SwipeBack with GNU General Public License v3.0 4 votes vote down vote up
XSettings() {
	mPref = new XSharedPreferences("info.papdt.swipeback", PREF);
	mPref.makeWorldReadable();
}
 
Example 18
Source File: Module.java    From ProxyOn with GNU General Public License v2.0 4 votes vote down vote up
public static void loadPrefs() {
    sPrefs = new XSharedPreferences(Module.class.getPackage().getName(), PREFS);
    sPrefs.makeWorldReadable();
}
 
Example 19
Source File: HookMethod.java    From CustomText with Apache License 2.0 4 votes vote down vote up
@Override
public void handleLoadPackage(final LoadPackageParam lpparam) throws Throwable {
    
	global_prefs.reload();
    if (!global_prefs.getBoolean("moduleswitch", true)) {
        return;
    }
	prefs = new XSharedPreferences(PKG_NAME,lpparam.packageName);
	prefs.makeWorldReadable();
	boolean ImageText = global_prefs.getBoolean("ImageText", false);
	final boolean global_tag = global_prefs.getBoolean(PKG_NAME+"_preferences", false);
	final boolean current_app_tag = global_prefs.getBoolean(lpparam.packageName,false);
	boolean my_app_tag =lpparam.packageName.equals(PKG_NAME)?true:false;
	XC_MethodHook textMethodHook ;
	if (my_app_tag){
		if (current_app_tag)
			return;
		textMethodHook = new XC_MethodHook() {
         @Override
         protected void beforeHookedMethod(MethodHookParam methodHookParam) throws Throwable {
         	String abc = (String) methodHookParam.args[0];
         	if (abc != null) {
              abc=abc.replaceAll("^�ı��Զ���$","�ı��Զ���,ģ����Կ��� :)" );
              abc=abc.replaceAll("^Custom Text$","Custom Text, it works:)" );
              methodHookParam.args[0] = abc;
         	}
         }
	 	};
	}else{
    	if(!global_tag&&!current_app_tag)
			return;
		final int num = prefs.getInt("maxpage", 0)*10+10;
    	final String[] oristr = new String[num];
    	final String[] newstr = new String[num];
    	if(current_app_tag){
        	for (int i=0; i<num ; i++){
        		oristr[i] = prefs.getString("oristr"+i, "");
        		newstr[i] = prefs.getString("newstr"+i, "");
        	}
    	}
		final int global_num = global_prefs.getInt("maxpage", 0)*10+10;
    	final String[] global_oristr = new String[global_num];
    	final String[] global_newstr = new String[global_num];
    	if(global_tag){
        	for (int i=0; i<global_num ; i++){
        		global_oristr[i] = global_prefs.getString("oristr"+i, "");
        		global_newstr[i] = global_prefs.getString("newstr"+i, "");
        	}
    	}
    	if (ImageText){
	    		textMethodHook = new XC_MethodHook() {
		            @Override
		            protected void beforeHookedMethod(MethodHookParam methodHookParam) throws Throwable {
		            	CharSequence actualText = (CharSequence) methodHookParam.args[0];
		            		if (actualText != null) {
		            			String abc = actualText.toString();
		            			if(global_tag)
		            				abc=ReplaceText(global_oristr, global_newstr, global_num, abc);
		            			if(current_app_tag)
		            				abc=ReplaceText(oristr, newstr, num, abc);
		            			methodHookParam.args[0] =abc ;
		            	}
		            }
	    	 	};
		}else{
    		textMethodHook = new XC_MethodHook() {
          @Override
          protected void beforeHookedMethod(MethodHookParam methodHookParam) throws Throwable {
         		if (!methodHookParam.args[0].getClass().getSimpleName().contains("SpannableString")){
         			String abc = (String) methodHookParam.args[0];
          		if (abc != null) {
          			if(global_tag)
          				abc=ReplaceText(global_oristr, global_newstr, global_num, abc);
          			if(current_app_tag)
          				abc=ReplaceText(oristr, newstr, num, abc);
          			methodHookParam.args[0] = abc;
          		}	
          	}
          }
 	 	};
    	}
	}
    
   findAndHookMethod(TextView.class, "setText", CharSequence.class,
		   TextView.BufferType.class, boolean.class, int.class, textMethodHook);
   findAndHookMethod(TextView.class, "setHint", CharSequence.class, textMethodHook);
   findAndHookMethod("android.view.GLES20Canvas", null, "drawText", String.class,
		   float.class, float.class, Paint.class, textMethodHook);
}
 
Example 20
Source File: LocationHook.java    From XposedRimetHelper with GNU General Public License v2.0 4 votes vote down vote up
public LocationHook(String versionName) {
    xsp = new XSharedPreferences(BuildConfig.APPLICATION_ID, SettingLabelView.DEFAULT_PREFERENCES_NAME);
    xsp.makeWorldReadable();
}