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

The following examples show how to use de.robv.android.xposed.XSharedPreferences#getInt() . 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: NotificationWallpaper.java    From GravityBox with Apache License 2.0 5 votes vote down vote up
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 2
Source File: StatusbarClock.java    From GravityBox with Apache License 2.0 5 votes vote down vote up
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 3
Source File: TrafficMeterOmni.java    From GravityBox with Apache License 2.0 5 votes vote down vote up
@Override
protected void onInitialize(XSharedPreferences prefs) throws Throwable {
    mGbContext = Utils.getGbContext(getContext());
    SYMBOLS.put("b/s", mGbContext.getString(R.string.bit_per_sec_abbr));
    SYMBOLS.put("B/s", mGbContext.getString(R.string.byte_per_sec_abbr));
    SYMBOLS.put("k", mGbContext.getString(R.string.kilo_abbr));
    SYMBOLS.put("M", mGbContext.getString(R.string.mega_abbr));
    SYMBOLS.put("G", mGbContext.getString(R.string.giga_abbr));

    mMode = Mode.valueOf(prefs.getString(GravityBoxSettings.PREF_KEY_DATA_TRAFFIC_OMNI_MODE, "IN_OUT"));
    mShowIcon = prefs.getBoolean(GravityBoxSettings.PREF_KEY_DATA_TRAFFIC_OMNI_SHOW_ICON, true);
    mAutoHide = prefs.getBoolean(GravityBoxSettings.PREF_KEY_DATA_TRAFFIC_OMNI_AUTOHIDE, false);
    mAutoHideThreshold = prefs.getInt(GravityBoxSettings.PREF_KEY_DATA_TRAFFIC_OMNI_AUTOHIDE_TH, 10);
    setSize();
}
 
Example 4
Source File: BatteryBarView.java    From GravityBox with Apache License 2.0 5 votes vote down vote up
public BatteryBarView(ContainerType containerType, ViewGroup container, XSharedPreferences prefs) {
    super(container.getContext());

    mContainerType = containerType;

    mEnabled = prefs.getBoolean(GravityBoxSettings.PREF_KEY_BATTERY_BAR_SHOW, false);
    mPosition = Position.valueOf(prefs.getString(
            GravityBoxSettings.PREF_KEY_BATTERY_BAR_POSITION, "TOP"));
    mMarginPx = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
            prefs.getInt(GravityBoxSettings.PREF_KEY_BATTERY_BAR_MARGIN, 0),
            getResources().getDisplayMetrics());
    mHeightPx = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
            prefs.getInt(GravityBoxSettings.PREF_KEY_BATTERY_BAR_THICKNESS, 2),
            getResources().getDisplayMetrics());
    mAnimateCharge = prefs.getBoolean(GravityBoxSettings.PREF_KEY_BATTERY_BAR_CHARGE_ANIM, false);
    mDynaColor = prefs.getBoolean(GravityBoxSettings.PREF_KEY_BATTERY_BAR_DYNACOLOR, true);
    mColor = prefs.getInt(GravityBoxSettings.PREF_KEY_BATTERY_BAR_COLOR, Color.WHITE);
    mColorLow = prefs.getInt(GravityBoxSettings.PREF_KEY_BATTERY_BAR_COLOR_LOW, 0xffffa500);
    mColorCritical = prefs.getInt(GravityBoxSettings.PREF_KEY_BATTERY_BAR_COLOR_CRITICAL, Color.RED);
    mColorCharging = prefs.getInt(GravityBoxSettings.PREF_KEY_BATTERY_BAR_COLOR_CHARGING, Color.GREEN);
    mCentered = prefs.getBoolean(GravityBoxSettings.PREF_KEY_BATTERY_BAR_CENTERED, false);

    container.addView(this);

    setScaleX(0f);
    setVisibility(View.GONE);
    updatePosition();
}
 
Example 5
Source File: XSPUtils.java    From XMiTools with GNU General Public License v3.0 4 votes vote down vote up
/**
 * 获取状态栏时钟颜色
 */
public static int getStatusBarClockColor(XSharedPreferences xsp) {
    return xsp.getInt(STATUS_BAR_CLOCK_COLOR, Color.WHITE);
}
 
Example 6
Source File: XSPUtils.java    From XMiTools with GNU General Public License v3.0 4 votes vote down vote up
/**
 * 下拉状态栏时钟颜色
 */
public static int getDropdownStatusBarClockColor(XSharedPreferences xsp) {
    return xsp.getInt(DROPDOWN_STATUS_BAR_CLOCK_COLOR, Color.WHITE);
}
 
Example 7
Source File: XSPUtils.java    From XMiTools with GNU General Public License v3.0 4 votes vote down vote up
/**
 * 下拉状态栏日期颜色
 */
public static int getDropdownStatusBarDateColor(XSharedPreferences xsp) {
    return xsp.getInt(DROPDOWN_STATUS_BAR_DATE_COLOR, Color.WHITE);
}
 
Example 8
Source File: XSPUtils.java    From XMiTools with GNU General Public License v3.0 4 votes vote down vote up
/**
 * 获取锁屏时钟颜色
 */
public static int getKeyguardClockColor(XSharedPreferences xsp) {
    return xsp.getInt(KEYGUARD_CLOCK_COLOR, Color.WHITE);
}
 
Example 9
Source File: XSPUtils.java    From XMiTools with GNU General Public License v3.0 4 votes vote down vote up
/**
 * 下拉状态栏天气字体颜色
 */
public static int getDropdownStatusBarWeatherTextColor(XSharedPreferences xsp) {
    return xsp.getInt(DROPDOWN_STATUS_BAR_WEATHER_TEXT_COLOR, Color.WHITE);
}
 
Example 10
Source File: XSPUtils.java    From XMiTools with GNU General Public License v3.0 4 votes vote down vote up
/**
 * 锁屏一言文字颜色
 */
public static int getOneSentenceColor(XSharedPreferences xsp) {
    return xsp.getInt(PrefConst.ONE_SENTENCE_COLOR, Color.WHITE);
}
 
Example 11
Source File: SystemWideResources.java    From GravityBox with Apache License 2.0 4 votes vote down vote up
public static void initResources(final XSharedPreferences prefs) {
    try {
        Resources systemRes = XResources.getSystem();

        int translucentDecor = Integer.valueOf(prefs.getString(GravityBoxSettings.PREF_KEY_TRANSLUCENT_DECOR, "0"));
        if (translucentDecor != 0) {
            XResources.setSystemWideReplacement("android", "bool", "config_enableTranslucentDecor", translucentDecor == 1);
        }

        if (prefs.getBoolean(GravityBoxSettings.PREF_KEY_NAVBAR_OVERRIDE, false)) {
            XResources.setSystemWideReplacement("android", "bool", "config_showNavigationBar",
                    prefs.getBoolean(GravityBoxSettings.PREF_KEY_NAVBAR_ENABLE,
                            SystemPropertyProvider.getSystemConfigBool(systemRes,
                                    "config_showNavigationBar")));
        }

        XResources.setSystemWideReplacement("android", "bool", "config_unplugTurnsOnScreen",
                prefs.getBoolean(GravityBoxSettings.PREF_KEY_UNPLUG_TURNS_ON_SCREEN,
                        SystemPropertyProvider.getSystemConfigBool(systemRes,
                                "config_unplugTurnsOnScreen")));

        if (!Utils.isVerneeApolloDevice()) {
            int pulseNotificationDelay = prefs.getInt(GravityBoxSettings.PREF_KEY_PULSE_NOTIFICATION_DELAY, -1);
            if (pulseNotificationDelay != -1) {
                XResources.setSystemWideReplacement("android", "integer", "config_defaultNotificationLedOff",
                        (pulseNotificationDelay));;
            }
        }

        XResources.setSystemWideReplacement("android", "bool", "config_sip_wifi_only", false);

        if (prefs.getBoolean(GravityBoxSettings.PREF_KEY_BRIGHTNESS_MASTER_SWITCH, false)) {
            int brightnessMin = prefs.getInt(GravityBoxSettings.PREF_KEY_BRIGHTNESS_MIN, 20);
            XResources.setSystemWideReplacement(
                "android", "integer", "config_screenBrightnessSettingMinimum", brightnessMin);
            if (DEBUG) log("Minimum brightness value set to: " + brightnessMin);

            int screenDim = prefs.getInt(GravityBoxSettings.PREF_KEY_SCREEN_DIM_LEVEL, 10);
            XResources.setSystemWideReplacement(
                    "android", "integer", "config_screenBrightnessDim", screenDim);
            if (DEBUG) log("Screen dim level set to: " + screenDim);
        }

        // Safe media volume
        Utils.TriState triState = Utils.TriState.valueOf(prefs.getString(
                GravityBoxSettings.PREF_KEY_SAFE_MEDIA_VOLUME, "DEFAULT"));
        if (DEBUG) log(GravityBoxSettings.PREF_KEY_SAFE_MEDIA_VOLUME + ": " + triState);
        if (triState != Utils.TriState.DEFAULT) {
            XResources.setSystemWideReplacement("android", "bool", "config_safe_media_volume_enabled",
                    triState == Utils.TriState.ENABLED);
            if (DEBUG) log("config_safe_media_volume_enabled: " + (triState == Utils.TriState.ENABLED));
        }
    } catch (Throwable t) {
        XposedBridge.log(t);
    }
}
 
Example 12
Source File: PieController.java    From GravityBox with Apache License 2.0 4 votes vote down vote up
public PieController(Context context, Context gbContext, XSharedPreferences prefs) {
    mContext = context;
    mGbContext = gbContext;
    mGbResources = gbContext.getResources();
    mLongPressHandler = new PieLongPressHandler(context, prefs);

    mVibrator = (Vibrator) mContext.getSystemService(Context.VIBRATOR_SERVICE);

    final PackageManager pm = mContext.getPackageManager();
    mHasTelephony = pm.hasSystemFeature(PackageManager.FEATURE_TELEPHONY);

    final Resources res = mContext.getResources();
    Tracker.sDistance = mGbResources.getDimensionPixelSize(R.dimen.pie_trigger_distance);

    mBackIcon = res.getDrawable(context.getResources().getIdentifier(
            "ic_sysbar_back", "drawable", PACKAGE_NAME), null).mutate();
    mBackAltIcon = res.getDrawable(context.getResources().getIdentifier(
            "ic_sysbar_back_ime", "drawable", PACKAGE_NAME), null).mutate();
    mRecentIcon = res.getDrawable(res.getIdentifier(
            "ic_sysbar_recent", "drawable", PACKAGE_NAME), null).mutate();
    mRecentAltIcon = mGbResources.getDrawable(R.drawable.ic_sysbar_recent_clear, null).mutate();

    try {
        mBaseStatusBarClass = XposedHelpers.findClass(CLASS_BASE_STATUSBAR, mContext.getClassLoader());
    } catch (ClassNotFoundError e) {
        XposedBridge.log(e);
    }

    mSysinfoDisabled = prefs.getBoolean(GravityBoxSettings.PREF_KEY_PIE_SYSINFO_DISABLE, false);
    setLongpressDelay(Integer.valueOf(prefs.getString(
            GravityBoxSettings.PREF_KEY_PIE_LONGPRESS_DELAY, "0")));;

    mColorInfo = new ColorInfo();
    mColorInfo.bgColor = prefs.getInt(GravityBoxSettings.PREF_KEY_PIE_COLOR_BG, 
            mGbResources.getColor(R.color.pie_background_color));
    mColorInfo.selectedColor = prefs.getInt(GravityBoxSettings.PREF_KEY_PIE_COLOR_SELECTED,
            mGbResources.getColor(R.color.pie_selected_color));
    mColorInfo.outlineColor = prefs.getInt(GravityBoxSettings.PREF_KEY_PIE_COLOR_OUTLINE,
            mGbResources.getColor(R.color.pie_outline_color));
    mColorInfo.fgColor = prefs.getInt(GravityBoxSettings.PREF_KEY_PIE_COLOR_FG,
            mGbResources.getColor(R.color.pie_foreground_color));
    mColorInfo.textColor = prefs.getInt(GravityBoxSettings.PREF_KEY_PIE_COLOR_TEXT,
            mGbResources.getColor(R.color.pie_text_color));

    updateColors();
}
 
Example 13
Source File: ModSmartRadio.java    From GravityBox with Apache License 2.0 4 votes vote down vote up
public static void init(final XSharedPreferences prefs, final ClassLoader classLoader) {
    try {
        final Class<?> classSystemUIService = XposedHelpers.findClass(
                "com.android.systemui.SystemUIService", classLoader);

        mNormalMode = prefs.getInt(GravityBoxSettings.PREF_KEY_SMART_RADIO_NORMAL_MODE, -1);
        mPowerSavingMode = prefs.getInt(GravityBoxSettings.PREF_KEY_SMART_RADIO_POWER_SAVING_MODE, -1);
        mPowerSaveWhenScreenOff = prefs.getBoolean(GravityBoxSettings.PREF_KEY_SMART_RADIO_SCREEN_OFF, false);
        mIgnoreWhileLocked = prefs.getBoolean(GravityBoxSettings.PREF_KEY_SMART_RADIO_IGNORE_LOCKED, true);
        mModeChangeDelay = prefs.getInt(GravityBoxSettings.PREF_KEY_SMART_RADIO_MODE_CHANGE_DELAY, 5);
        mScreenOffDelay = prefs.getInt(GravityBoxSettings.PREF_KEY_SMART_RADIO_SCREEN_OFF_DELAY, 0);
        mIgnoreMobileDataAvailability = prefs.getBoolean(GravityBoxSettings.PREF_KEY_SMART_RADIO_MDA_IGNORE, false);
        mAdaptiveDelayThreshold = prefs.getInt(GravityBoxSettings.PREF_KEY_SMART_RADIO_ADAPTIVE_DELAY, 0);

        XposedHelpers.findAndHookMethod(classSystemUIService, "onCreate", new XC_MethodHook() {
            @Override
            protected void afterHookedMethod(final MethodHookParam param) throws Throwable {
                mContext = (Context) param.thisObject;
                if (mContext != null) {
                    if (DEBUG) log("Initializing SmartRadio");

                    mSmartRadioEnabled = Settings.System.getInt(mContext.getContentResolver(),
                            SETTING_SMART_RADIO_ENABLED, 1) == 1;
                    mConnManager = (ConnectivityManager) mContext.getSystemService(Context.CONNECTIVITY_SERVICE);
                    mKeyguardManager = (KeyguardManager) mContext.getSystemService(Context.KEYGUARD_SERVICE);
                    mNetworkModeChanger = new NetworkModeChanger(mContext, new Handler());
                    Settings.System.putString(mContext.getContentResolver(), 
                            SETTING_SMART_RADIO_STATE, mCurrentState.toString());

                    IntentFilter intentFilter = new IntentFilter();
                    intentFilter.addAction(GravityBoxSettings.ACTION_PREF_SMART_RADIO_CHANGED);
                    intentFilter.addAction(ConnectivityManager.CONNECTIVITY_ACTION);
                    intentFilter.addAction(Intent.ACTION_SCREEN_ON);
                    intentFilter.addAction(Intent.ACTION_SCREEN_OFF);
                    intentFilter.addAction(Intent.ACTION_USER_PRESENT);
                    intentFilter.addAction(NetworkModeChanger.ACTION_CHANGE_MODE_ALARM);
                    intentFilter.addAction(ACTION_TOGGLE_SMART_RADIO);
                    intentFilter.addAction(TelephonyManager.ACTION_PHONE_STATE_CHANGED);
                    intentFilter.addAction(PhoneWrapper.ACTION_NETWORK_TYPE_CHANGED);
                    mContext.registerReceiver(mBroadcastReceiver, intentFilter);
                }
            }
        });
    } catch (Throwable t) {
        XposedBridge.log(t);
    }
}
 
Example 14
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 15
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);
}