Java Code Examples for de.robv.android.xposed.XSharedPreferences#getString()
The following examples show how to use
de.robv.android.xposed.XSharedPreferences#getString() .
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: BuildPropEditor.java From buildprop with Apache License 2.0 | 6 votes |
@Override public void initZygote(StartupParam startupParam) throws Throwable { prefs = new XSharedPreferences(BuildPropEditor.class.getPackage().getName()); prefs.makeWorldReadable(); reloadPreferences(); debug = prefs.getBoolean(Common.PREF_ENABLE_DEBUG, true); boolean enableViewServer = prefs.getBoolean(Common.PREF_ENABLE_VIEW_SERVER, false); roDebuggable = prefs.getString(Common.PREF_RO_DEBUGGABLE, "-1"); enableDebugWebview = prefs.getBoolean(Common.PREF_ENABLE_DEBUG_WEBVIEW, true); roSecure = prefs.getString(Common.PREF_RO_SECURE, "-1"); if (enableViewServer) roSecure = "0"; //关闭ro.secure才能开启viewServer XposedBridge.log("debug=" + debug + " enableViewServer=" + enableViewServer + " roDebuggable=" + roDebuggable + " roSecure=" + roSecure); }
Example 2
Source File: StatusbarSignalCluster.java From GravityBox with Apache License 2.0 | 6 votes |
public static void initResources(XSharedPreferences prefs, InitPackageResourcesParam resparam) { XModuleResources modRes = XModuleResources.createInstance(GravityBox.MODULE_PATH, resparam.res); if (prefs.getBoolean(GravityBoxSettings.PREF_KEY_SIGNAL_CLUSTER_HPLUS, false) && !Utils.isMtkDevice() && !Utils.isOxygenOs35Rom()) { sQsHpResId = XResources.getFakeResId(modRes, R.drawable.ic_qs_signal_hp); sSbHpResId = XResources.getFakeResId(modRes, R.drawable.stat_sys_data_fully_connected_hp); resparam.res.setReplacement(sQsHpResId, modRes.fwd(R.drawable.ic_qs_signal_hp)); resparam.res.setReplacement(sSbHpResId, modRes.fwd(R.drawable.stat_sys_data_fully_connected_hp)); DATA_HP = new int[][]{ {sSbHpResId, sSbHpResId, sSbHpResId, sSbHpResId}, {sSbHpResId, sSbHpResId, sSbHpResId, sSbHpResId} }; QS_DATA_HP = new int[]{sQsHpResId, sQsHpResId}; if (DEBUG) log("H+ icon resources initialized"); } String lteStyle = prefs.getString(GravityBoxSettings.PREF_KEY_SIGNAL_CLUSTER_LTE_STYLE, "DEFAULT"); if (!lteStyle.equals("DEFAULT")) { resparam.res.setReplacement(ModStatusBar.PACKAGE_NAME, "bool", "config_show4GForLTE", lteStyle.equals("4G")); } }
Example 3
Source File: NotificationWallpaper.java From GravityBox with Apache License 2.0 | 5 votes |
private void initPreferences(XSharedPreferences prefs) { mBgType = prefs.getString( GravityBoxSettings.PREF_KEY_NOTIF_BACKGROUND, GravityBoxSettings.NOTIF_BG_DEFAULT); mColor = prefs.getInt( GravityBoxSettings.PREF_KEY_NOTIF_COLOR, Color.BLACK); setAlpha(prefs.getInt( GravityBoxSettings.PREF_KEY_NOTIF_BACKGROUND_ALPHA, 0)); }
Example 4
Source File: Lockscreen.java From android-lockscreen-disabler with Apache License 2.0 | 5 votes |
@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 5
Source File: Preferences.java From glitchify with MIT License | 5 votes |
Preferences(XSharedPreferences prefs) { pref.put("ffzEmotes", prefs.getBoolean("ffz_emotes_enable", true)); pref.put("ffzBadges", prefs.getBoolean("ffz_badges_enable", true)); pref.put("ffzModBadge", prefs.getBoolean("ffz_mod_enable", true)); pref.put("ffzModBadgeURL", ""); pref.put("ffzModeBadgeScale", 1); pref.put("bttvEmotes", prefs.getBoolean("bttv_emotes_enable", true)); pref.put("bttvBadges", prefs.getBoolean("bttv_badges_enable", true)); pref.put("disableGifEmotes", prefs.getBoolean("disable_gif", false)); pref.put("bitsCombine", prefs.getBoolean("bits_combine_enable", true)); pref.put("hiddenBadges", new ArrayList<String>()); String hiddenBadges = prefs.getString("badge_hiding_enable", ""); if (!hiddenBadges.equals("")) { for (String key : hiddenBadges.split(",")) { //noinspection unchecked ((ArrayList<String>)pref.get("hiddenBadges")).add(key.trim()); } } pref.put("preventChatClear", prefs.getBoolean("prevent_channel_clear", true)); pref.put("showDeletedMessages", prefs.getBoolean("show_deleted_messages", true)); pref.put("showTimeStamps", prefs.getBoolean("show_timestamps", true)); pref.put("chatScrollbackLength", Integer.valueOf(prefs.getString("chat_scrollback_length", "100"))); pref.put("colorAdjust", prefs.getBoolean("color_adjust", false)); pref.put("hide_video_ads", prefs.getBoolean("hide_video_ads", false)); XSharedPreferences darkPrefs = new XSharedPreferences("tv.twitch.android.app", "tv.twitch.android.app_preferences"); pref.put("isDark", darkPrefs.getBoolean("dark_theme_enabled", false)); }
Example 6
Source File: ProgressBarController.java From GravityBox with Apache License 2.0 | 5 votes |
public ProgressBarController(Context ctx, XSharedPreferences prefs) { mContext = ctx; mListeners = new ArrayList<ProgressStateListener>(); mProgressList = new LinkedHashMap<String, ProgressInfo>(); mMode = Mode.valueOf(prefs.getString(GravityBoxSettings.PREF_KEY_STATUSBAR_DOWNLOAD_PROGRESS, "OFF")); mSoundEnabled = prefs.getBoolean(GravityBoxSettings.PREF_KEY_STATUSBAR_DOWNLOAD_PROGRESS_SOUND_ENABLE, false); mSoundUri = prefs.getString(GravityBoxSettings.PREF_KEY_STATUSBAR_DOWNLOAD_PROGRESS_SOUND, "content://settings/system/notification_sound"); mSoundWhenScreenOffOnly = prefs.getBoolean( GravityBoxSettings.PREF_KEY_STATUSBAR_DOWNLOAD_PROGRESS_SOUND_SCREEN_OFF, false); mPowerManager = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE); mHandler = new Handler(); }
Example 7
Source File: StatusbarClock.java From GravityBox with Apache License 2.0 | 5 votes |
public StatusbarClock(XSharedPreferences prefs) { mClockShowDate = prefs.getString(GravityBoxSettings.PREF_KEY_STATUSBAR_CLOCK_DATE, "disabled"); mClockShowDow = Integer.valueOf( prefs.getString(GravityBoxSettings.PREF_KEY_STATUSBAR_CLOCK_DOW, "0")); mAmPmHide = prefs.getBoolean(GravityBoxSettings.PREF_KEY_STATUSBAR_CLOCK_AMPM_HIDE, false); mClockHidden = prefs.getBoolean(GravityBoxSettings.PREF_KEY_STATUSBAR_CLOCK_HIDE, false); mDowSize = prefs.getInt(GravityBoxSettings.PREF_KEY_STATUSBAR_CLOCK_DOW_SIZE, 70) / 100f; mAmPmSize = prefs.getInt(GravityBoxSettings.PREF_KEY_STATUSBAR_CLOCK_AMPM_SIZE, 70) / 100f; mShowSeconds = prefs.getBoolean(GravityBoxSettings.PREF_KEY_STATUSBAR_CLOCK_SHOW_SECONDS, false); }
Example 8
Source File: XSPUtils.java From XposedSmsCode with GNU General Public License v3.0 | 5 votes |
/** * 获取验证码通知保留时间 */ public static int getNotificationRetentionTime(XSharedPreferences preferences) { String value = preferences.getString(PrefConst.KEY_NOTIFICATION_RETENTION_TIME, PrefConst.NOTIFICATION_RETENTION_TIME_DEFAULT); try { return Integer.valueOf(value); } catch (Exception e) { return 0; } }
Example 9
Source File: XSPUtils.java From XMiTools with GNU General Public License v3.0 | 5 votes |
/** * 锁屏一言文字大小 */ public static float getOneSentenceTextSize(XSharedPreferences xsp) { String text = xsp.getString(PrefConst.ONE_SENTENCE_TEXT_SIZE, PrefConst.ONE_SENTENCE_TEXT_SIZE_DEFAULT); float size; try { size = Float.parseFloat(text); } catch (Throwable t) { size = Float.parseFloat(PrefConst.ONE_SENTENCE_TEXT_SIZE_DEFAULT); } return size; }
Example 10
Source File: XSPUtils.java From XMiTools with GNU General Public License v3.0 | 5 votes |
/** * 获取一言刷新时间间隔,单位为min */ public static long getOneSentenceRefreshRate(XSharedPreferences xsp) { String text = xsp.getString(PrefConst.ONE_SENTENCE_REFRESH_RATE, PrefConst.ONE_SENTENCE_REFRESH_RATE_DEFAULT); long refreshRate; try { refreshRate = Long.parseLong(text); } catch (Throwable t) { refreshRate = Long.parseLong(PrefConst.ONE_SENTENCE_REFRESH_RATE_DEFAULT); } return refreshRate; }
Example 11
Source File: XSPUtils.java From XMiTools with GNU General Public License v3.0 | 5 votes |
/** * 下拉状态栏天气字体大小 */ public static float getDropdownStatusBarWeatherTextSize(XSharedPreferences xsp) { String text = xsp.getString(DROPDOWN_STATUS_BAR_WEATHER_TEXT_SIZE, DROPDOWN_STATUS_BAR_WEATHER_TEXT_SIZE_DEFAULT); float size; try { size = Float.parseFloat(text); } catch (Throwable t) { size = Float.parseFloat(DROPDOWN_STATUS_BAR_WEATHER_TEXT_SIZE_DEFAULT); } return size; }
Example 12
Source File: AppAnalyzer.java From BadIntent with BSD 3-Clause "New" or "Revised" License | 4 votes |
@Override public void handleLoadPackage(XC_LoadPackage.LoadPackageParam lpparam) throws Throwable { sPrefs = new XSharedPreferences(new File(PREFERENCE_PATH)); sPrefs.reload(); String target = lpparam.packageName; //bypass various apps depending on preferences String[] bypass = getBypassList(); String packageNameFilter = sPrefs.getString("package_filter", ""); for (String bypassElement : bypass) { /* check if package filter does not equal this package NOTE: this is a special condition in order to overwrite the hook_system_switch; However, the packageNameFilter has to exactly match exactly the target package. */ if (target.matches(bypassElement) && !target.equals(packageNameFilter)){ return; } } //disable strict mode in order to prevent unclosed connections file usage StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder().build()); HookingManager hookingManager = new HookingManager(lpparam, target); int port = getRandomPort(); //updating current app's meta data AppInformation.Instance.packageName = lpparam.packageName; AppInformation.Instance.port = port; Log.d(TAG, "Hooking package:" + target + " port: " + port); if (hookingManager.continueHooking()) { BaseHook base = hookingManager.getBaseHook(); ParcelProxyHooks parcelProxyHooks = new ParcelProxyHooks(base, port); parcelProxyHooks.hookParcel(); TransactionHooks transactionHooks = new TransactionHooks(base, sPrefs, port); transactionHooks.hookBinder(); LogHooks logHooks = new LogHooks(base, sPrefs, port); logHooks.hookLogs(); } }
Example 13
Source File: XSPUtils.java From XMiTools with GNU General Public License v3.0 | 4 votes |
/** * 获取状态栏时钟对齐方式 */ public static String getStatusBarClockAlignment(XSharedPreferences xsp) { return xsp.getString(STATUS_BAR_CLOCK_ALIGNMENT, ALIGNMENT_LEFT); }
Example 14
Source File: XSPUtils.java From XposedSmsCode with GNU General Public License v3.0 | 4 votes |
/** * 获取短信验证码关键字 */ public static String getSMSCodeKeywords(XSharedPreferences preferences) { return preferences.getString(PrefConst.KEY_SMSCODE_KEYWORDS, PrefConst.SMSCODE_KEYWORDS_DEFAULT); }
Example 15
Source File: DataHook.java From XposedNavigationBar with GNU General Public License v3.0 | 4 votes |
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: Replacement.java From Inspeckage with Apache License 2.0 | 4 votes |
public static boolean resultReplace(XC_MethodHook.MethodHookParam param, XSharedPreferences sPrefs) { String user_json = sPrefs.getString(Config.SP_USER_RETURN_REPLACES, ""); if (!user_json.trim().equals("")) { String json = "{\"replaceReturnItems\": " + sPrefs.getString(Config.SP_USER_RETURN_REPLACES, "") + "}"; ReplaceReturnList replaceList = gson.fromJson(json, ReplaceReturnList.class); for (ReplaceReturnItem item : replaceList.replaceReturnItems) { if (item.state && item.classMethod.equalsIgnoreCase(param.method.getDeclaringClass().getName() + "." + param.method.getName())) { if (item.returnNewValue != null && !item.returnNewValue.equals("void")) { if (item.returnType.equals("boolean") && param.getResult() instanceof Boolean) { param.setResult(Boolean.valueOf(item.returnNewValue.toString())); } else if (item.returnType.equals("String") && param.getResult() instanceof String) { if (item.returnMatch != null && item.returnMatch.toString().trim() != "") { if (item.returnMatch.equals(param.getResult())) { param.setResult(item.returnNewValue); } } else { param.setResult(item.returnNewValue); } } else if (item.returnType.equals("int") && param.getResult() instanceof Integer) { if (item.returnMatch != null && item.returnMatch.toString().trim() != "") { if (Integer.valueOf(item.returnNewValue.toString()).equals(param.getResult())) { param.setResult(Integer.valueOf(item.returnNewValue.toString())); } } else { param.setResult(Integer.valueOf(item.returnNewValue.toString())); } } else if (item.returnType.equals("ByteArray") && param.getResult().getClass().equals(byte[].class)) { String v = Util.byteArrayToString((byte[]) param.getResult()); if (item.returnMatch != null && item.returnMatch.toString().trim() != "") { param.setResult(v.getBytes()); } else { param.setResult(item.returnNewValue.toString().getBytes()); } } else if (item.returnType.equals("short") && param.getResult() instanceof Short) { if (item.returnMatch != null && item.returnMatch.toString().trim() != "") { if (Short.valueOf(item.returnNewValue.toString()).equals(param.getResult())) { param.setResult(Short.valueOf(item.returnNewValue.toString())); } } else { param.setResult(Short.valueOf(item.returnNewValue.toString())); } } else if (item.returnType.equals("long") && param.getResult() instanceof Long) { if (item.returnMatch != null && item.returnMatch.toString().trim() != "") { if (Long.valueOf(item.returnNewValue.toString()).equals(param.getResult())) { param.setResult(Long.valueOf(item.returnNewValue.toString())); } } else { param.setResult(Long.valueOf(item.returnNewValue.toString())); } } else if (item.returnType.equals("float") && param.getResult() instanceof Float) { if (item.returnMatch != null && item.returnMatch.toString().trim() != "") { if (Float.valueOf(item.returnNewValue.toString()).equals(param.getResult())) { param.setResult(Float.valueOf(item.returnNewValue.toString())); } } else { param.setResult(Float.valueOf(item.returnNewValue.toString())); } } else if (item.returnType.equals("double") && param.getResult() instanceof Double) { if (item.returnMatch != null && item.returnMatch.toString().trim() != "") { if (Double.valueOf(item.returnNewValue.toString()).equals(param.getResult())) { param.setResult(Double.valueOf(item.returnNewValue.toString())); } } else { param.setResult(Double.valueOf(item.returnNewValue.toString())); } } else if (item.returnType.equals("charArray") && param.getResult() instanceof char[]) { if (item.returnMatch != null && item.returnMatch.toString().trim() != "") { if (item.returnNewValue.toString().toCharArray().equals(param.getResult())) { param.setResult(item.returnNewValue.toString().toCharArray()); } } else { param.setResult(item.returnNewValue.toString().toCharArray()); } } } } } } return true; }
Example 17
Source File: XSPUtils.java From XMiTools with GNU General Public License v3.0 | 4 votes |
/** * 状态栏自定义显示的移动网络类型 */ public static String customMobileNetwork(XSharedPreferences xsp) { return xsp.getString(CUSTOM_MOBILE_NETWORK_TYPE, CUSTOM_MOBILE_NETWORK_TYPE_DEFAULT); }
Example 18
Source File: HookMethod.java From CustomText with Apache License 2.0 | 4 votes |
@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 19
Source File: XSPUtils.java From XMiTools with GNU General Public License v3.0 | 4 votes |
/** * 获取自定义的状态栏时间格式 */ public static String getStatusBarClockFormat(XSharedPreferences xsp) { return xsp.getString(STATUS_BAR_CLOCK_FORMAT, STATUS_BAR_CLOCK_FORMAT_DEFAULT); }
Example 20
Source File: ConnectionUtils.java From BadIntent with BSD 3-Clause "New" or "Revised" License | 2 votes |
/** * Get REST URL based on the BadIntent preferences. * @param resource needs to start with / * @param sPrefs * @param port * @return * @throws MalformedURLException */ public static URL getBadIntentURL(String resource, XSharedPreferences sPrefs, int port) throws MalformedURLException { String ip = sPrefs.getString(BadIntentConstants.TARGET_IP, "localhost"); return new URL("http://" + ip + ":" + port + resource); }