@Override public void handleLoadPackage(XC_LoadPackage.LoadPackageParam p1) throws Throwable { String pn=p1.packageName; Log.d(tag, "PackageName:" + pn); XSharedPreferences xsp=new XSharedPreferences(this.getClass().getPackage().getName(), "xposed_blacklist"); XSharedPreferences xsp2=new XSharedPreferences(this.getClass().getPackage().getName(), "config"); String manufacturer=xsp2.getString("manufacturer", null); String model=xsp2.getString("model", null); String brand=xsp2.getString("brand", null); String product=xsp2.getString("product", null); String device=xsp2.getString("device", null); String blacklist=xsp.getString("main", null); if (!blacklist.contains(pn)) { Log.d(tag, pn + ":return_OutOfBlackList"); return; } Class<?> clz=XposedHelpers.findClass("android.os.Build", p1.classLoader); XposedHelpers.setStaticObjectField(clz, "MANUFACTURER", manufacturer); XposedHelpers.setStaticObjectField(clz, "BRAND", brand); XposedHelpers.setStaticObjectField(clz, "PRODUCT", product); XposedHelpers.setStaticObjectField(clz, "DEVICE", device); XposedHelpers.setStaticObjectField(clz, "MODEL", model); }
public static void getPref(XSharedPreferences gPref, XSharedPreferences lPref, String packageName) { SubscriptionKey = gPref.getString("SubscriptionKey", ""); EnableYandex = gPref.getBoolean("EnableYandex", false); DelayWebView = Integer.parseInt(gPref.getString("DelayWebView", "500")); //boolean anon = gPref.getBoolean("Anon", true); //boolean debug = gPref.getBoolean("Debug", false); //boolean localEnabled = gPref.getBoolean(packageName, false); if (lPref.contains("OverRide")) { if (lPref.getBoolean("OverRide", false)) gPref = lPref; } TranslateFromLanguage = gPref.getString("TranslateFromLanguage", ""); TranslateToLanguage = gPref.getString("TranslateToLanguage", ""); SetText = gPref.getBoolean("SetText", false); SetHint = gPref.getBoolean("SetHint", false); LoadURL = gPref.getBoolean("LoadURL", false); DrawText = gPref.getBoolean("DrawText", false); Caching = gPref.getBoolean("Cache", false); Delay = Integer.parseInt(gPref.getString("Delay", "0")); }
@Override protected void onInitialize(XSharedPreferences prefs) throws Throwable { Context gbContext = Utils.getGbContext(getContext()); mB = gbContext.getString(R.string.byte_abbr); mKB = gbContext.getString(R.string.kilobyte_abbr); mMB = gbContext.getString(R.string.megabyte_abbr); mS = gbContext.getString(R.string.second_abbr); try { int inactivityMode = Integer.valueOf(prefs.getString( GravityBoxSettings.PREF_KEY_DATA_TRAFFIC_INACTIVITY_MODE, "0")); setInactivityMode(inactivityMode); } catch (NumberFormatException nfe) { log("Invalid preference value for PREF_KEY_DATA_TRAFFIC_INACTIVITY_MODE"); } setTextSize(TypedValue.COMPLEX_UNIT_DIP, mSize); }
public LockscreenAppBar(Context ctx, Context gbCtx, ViewGroup container, Object statusBar, XSharedPreferences prefs) { mContext = ctx; mGbContext = gbCtx; mContainer = container; mStatusBar = statusBar; mPrefs = prefs; mPm = mContext.getPackageManager(); mHandler = new Handler(); mSafeLaunchEnabled = prefs.getBoolean( GravityBoxSettings.PREF_KEY_LOCKSCREEN_SHORTCUT_SAFE_LAUNCH, false); mShowBadges = prefs.getBoolean( GravityBoxSettings.PREF_KEY_LOCKSCREEN_SHORTCUT_SHOW_BADGES, false); mNdMonitor = SysUiManagers.NotifDataMonitor; if (mNdMonitor != null) { mNdMonitor.registerListener(this); } initAppSlots(); mKgMonitor = SysUiManagers.KeyguardMonitor; mKgMonitor.registerListener(this); }
public static void initPackageResources(final XSharedPreferences prefs, final InitPackageResourcesParam resparam) { try { XModuleResources modRes = XModuleResources.createInstance(GravityBox.MODULE_PATH, resparam.res); resparam.res.setReplacement(PACKAGE_NAME, "array", "window_animation_scale_entries", modRes.fwd(R.array.window_animation_scale_entries)); resparam.res.setReplacement(PACKAGE_NAME, "array", "window_animation_scale_values", modRes.fwd(R.array.window_animation_scale_values)); resparam.res.setReplacement(PACKAGE_NAME, "array", "transition_animation_scale_entries", modRes.fwd(R.array.transition_animation_scale_entries)); resparam.res.setReplacement(PACKAGE_NAME, "array", "transition_animation_scale_values", modRes.fwd(R.array.transition_animation_scale_values)); resparam.res.setReplacement(PACKAGE_NAME, "array", "animator_duration_scale_entries", modRes.fwd(R.array.animator_duration_scale_entries)); resparam.res.setReplacement(PACKAGE_NAME, "array", "animator_duration_scale_values", modRes.fwd(R.array.animator_duration_scale_values)); } catch (Throwable t) { XposedBridge.log(t); } }
protected BatteryInfoManager(Context context, XSharedPreferences prefs) { mContext = context; mBatteryData = new BatteryData(); mListeners = new ArrayList<BatteryStatusListener>(); mSounds = new Uri[4]; mPowerManager = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE); mBatteryData.isPowerSaving = mPowerManager.isPowerSaveMode(); setSound(BatteryInfoManager.SOUND_CHARGED, prefs.getString(GravityBoxSettings.PREF_KEY_BATTERY_CHARGED_SOUND, "")); setSound(BatteryInfoManager.SOUND_PLUGGED, prefs.getString(GravityBoxSettings.PREF_KEY_CHARGER_PLUGGED_SOUND, "")); setSound(BatteryInfoManager.SOUND_UNPLUGGED, prefs.getString(GravityBoxSettings.PREF_KEY_CHARGER_UNPLUGGED_SOUND, "")); try { mLowBatteryWarningPolicy = LowBatteryWarningPolicy.valueOf(prefs.getString( GravityBoxSettings.PREF_KEY_LOW_BATTERY_WARNING_POLICY, "DEFAULT")); } catch (Throwable t) { mLowBatteryWarningPolicy = LowBatteryWarningPolicy.DEFAULT; } }
public StatusbarBatteryPercentage(TextView view, XSharedPreferences prefs, BatteryStyleController controller) { mPercentage = view; mController = controller; mDefaultColor = mIconColor = mPercentage.getCurrentTextColor(); try { Resources res = mPercentage.getResources(); int resId = res.getIdentifier("battery_level_text_size", "dimen", BatteryStyleController.PACKAGE_NAME); mDefaultSizePx = res.getDimensionPixelSize(resId); } catch (Throwable t) { mDefaultSizePx = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 16, mPercentage.getResources().getDisplayMetrics()); } initPreferences(prefs); if (SysUiManagers.IconManager != null) { SysUiManagers.IconManager.registerListener(this); } if (SysUiManagers.BatteryInfoManager != null) { SysUiManagers.BatteryInfoManager.registerListener(this); } }
public static void init(final XSharedPreferences prefs, final ClassLoader classLoader) { try { final Class<?> classDevSettings = XposedHelpers.findClass(CLASS_DEV_SETTINGS, classLoader); if (DEBUG) log("hooking DeveloperSettings.onCreate method"); XposedHelpers.findAndHookMethod(classDevSettings, "onCreate", Bundle.class, new XC_MethodHook() { @Override protected void beforeHookedMethod(final MethodHookParam param) throws Throwable { PreferenceFragment pf = (PreferenceFragment) param.thisObject; mResId = pf.getResources().getIdentifier("development_prefs", "xml", PACKAGE_NAME); if (DEBUG) log("mResId=" + mResId); } }); } catch (Throwable t) { XposedBridge.log(t); } }
public static void initResources(final XSharedPreferences prefs, final InitPackageResourcesParam resparam) { try { // Lockscreen: disable menu key in lock screen Utils.TriState triState = Utils.TriState.valueOf(prefs.getString( GravityBoxSettings.PREF_KEY_LOCKSCREEN_MENU_KEY, "DEFAULT")); if (DEBUG) log(GravityBoxSettings.PREF_KEY_LOCKSCREEN_MENU_KEY + ": " + triState); if (triState != Utils.TriState.DEFAULT) { resparam.res.setReplacement(PACKAGE_NAME, "bool", "config_disableMenuKeyInLockScreen", triState == Utils.TriState.DISABLED); if (DEBUG) log("config_disableMenuKeyInLockScreen: " + (triState == Utils.TriState.DISABLED)); } } catch (Throwable t) { XposedBridge.log(t); } }
static void initAndroid(final XSharedPreferences prefs, final ClassLoader classLoader) { try { if (DEBUG) log("init"); updatePreference(prefs); Class<?> classPhoneWindowManager = findClass("com.android.server.policy.PhoneWindowManager", classLoader); XposedBridge.hookAllConstructors(classPhoneWindowManager, handleConstructPhoneWindowManager); // take advantage of screenTurnedOff method for refreshing state of allowSkipTrack preference findAndHookMethod(classPhoneWindowManager, "screenTurnedOff", new XC_MethodHook() { @Override protected void beforeHookedMethod(MethodHookParam param) throws Throwable { if (DEBUG) log("screenTurnedOff"); updatePreference(prefs); } }); findAndHookMethod(classPhoneWindowManager, "interceptKeyBeforeQueueing", KeyEvent.class, int.class, handleInterceptKeyBeforeQueueing); } catch (Throwable t) { XposedBridge.log(t); } }
public static void init(final XSharedPreferences prefs, final ClassLoader classLoader) { try { final Class<?> classDownloadService = XposedHelpers.findClass(CLASS_DOWNLOAD_SERVICE, classLoader); XposedHelpers.findAndHookMethod(classDownloadService, "updateLocked", new XC_MethodHook() { @Override protected void afterHookedMethod(MethodHookParam param) throws Throwable { final boolean isActive = (Boolean) param.getResult(); if (mIsActive != isActive) { mIsActive = isActive; if (DEBUG) log("Download state changed; active=" + mIsActive); final Context context = (Context) param.thisObject; Intent intent = new Intent(ACTION_DOWNLOAD_STATE_CHANGED); intent.putExtra(EXTRA_ACTIVE, mIsActive); context.sendBroadcast(intent); } } }); } catch (Throwable t) { XposedBridge.log(t); } }
public PieLongPressHandler(Context context, XSharedPreferences prefs) { mContext = context; mActions = new HashMap<ButtonType, ModHwKeys.HwKeyAction>(); mActions.put(ButtonType.BACK, new ModHwKeys.HwKeyAction(Integer.valueOf( prefs.getString(GravityBoxSettings.PREF_KEY_PIE_BACK_LONGPRESS, "0")), prefs.getString(GravityBoxSettings.PREF_KEY_PIE_BACK_LONGPRESS+"_custom", null))); mActions.put(ButtonType.HOME, new ModHwKeys.HwKeyAction(Integer.valueOf( prefs.getString(GravityBoxSettings.PREF_KEY_PIE_HOME_LONGPRESS, "0")), prefs.getString(GravityBoxSettings.PREF_KEY_PIE_HOME_LONGPRESS+"_custom", null))); mActions.put(ButtonType.RECENT, new ModHwKeys.HwKeyAction(Integer.valueOf( prefs.getString(GravityBoxSettings.PREF_KEY_PIE_RECENTS_LONGPRESS, "0")), prefs.getString(GravityBoxSettings.PREF_KEY_PIE_RECENTS_LONGPRESS+"_custom", null))); mActions.put(ButtonType.SEARCH, new ModHwKeys.HwKeyAction(Integer.valueOf( prefs.getString(GravityBoxSettings.PREF_KEY_PIE_SEARCH_LONGPRESS, "0")), prefs.getString(GravityBoxSettings.PREF_KEY_PIE_SEARCH_LONGPRESS+"_custom", null))); mActions.put(ButtonType.MENU, new ModHwKeys.HwKeyAction(Integer.valueOf( prefs.getString(GravityBoxSettings.PREF_KEY_PIE_MENU_LONGPRESS, "0")), prefs.getString(GravityBoxSettings.PREF_KEY_PIE_MENU_LONGPRESS+"_custom", null))); mActions.put(ButtonType.APP_LAUNCHER, new ModHwKeys.HwKeyAction(Integer.valueOf( prefs.getString(GravityBoxSettings.PREF_KEY_PIE_APP_LONGPRESS, "0")), prefs.getString(GravityBoxSettings.PREF_KEY_PIE_APP_LONGPRESS+"_custom", null))); }
public SyncTile(Object host, String key, XSharedPreferences prefs, QsTileEventDistributor eventDistributor) throws Throwable { super(host, key, prefs, eventDistributor); mHandler = new Handler(); mReceiver = new GravityBoxResultReceiver(mHandler); mReceiver.setReceiver(new Receiver() { @Override public void onReceiveResult(int resultCode, Bundle resultData) { if (resultCode == GravityBoxService.RESULT_SYNC_STATUS) { final boolean oldState = mSyncState; mSyncState = resultData.getBoolean(GravityBoxService.KEY_SYNC_STATUS); if (mSyncState != oldState) { refreshState(); if (DEBUG) log(getKey() + ": onReceiveResult: mSyncState=" + mSyncState); } } } }); }
public NfcTile(Object host, String key, XSharedPreferences prefs, QsTileEventDistributor eventDistributor) throws Throwable { super(host, key, prefs, eventDistributor); mHandler = new Handler(); mReceiver = new GravityBoxResultReceiver(mHandler); mReceiver.setReceiver(new Receiver() { @Override public void onReceiveResult(int resultCode, Bundle resultData) { if (resultData != null && resultData.containsKey("nfcState")) { int newState = resultData.getInt("nfcState"); if (mNfcState != newState) { mNfcState = newState; refreshState(); } } } }); }
public TorchTile(Object host, String key, XSharedPreferences prefs, QsTileEventDistributor eventDistributor) throws Throwable { super(host, key, prefs, eventDistributor); mReceiver = new GravityBoxResultReceiver(new Handler()); mReceiver.setReceiver(new Receiver() { @Override public void onReceiveResult(int resultCode, Bundle resultData) { final int oldState = mTorchStatus; mTorchStatus = resultData.getInt(TorchService.EXTRA_TORCH_STATUS); if (mTorchStatus != oldState) { refreshState(); if (DEBUG) log(getKey() + ": onReceiveResult: mTorchStatus=" + mTorchStatus); } } }); }
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")); } }
@Override public void initZygote(StartupParam startupParam) throws Throwable { pref = new XSharedPreferences("tk.navideju.darkthemefixer","fix_states"); pref.makeWorldReadable(); File test = pref.getFile(); Boolean a = pref.getBoolean("com.android.chrome.toolbar_phone.location_bar",true); XposedBridge.log(LOG_PRE+"From zygote: "+a+" can read?: "+test.canRead()); MODULE_PATH = startupParam.modulePath; }
/** * @param h * @param sharedPreferences which is used to determine the proxy settings (BadIntent HTTP-Proxy) * @param port on which the current app's BadIntent RestAPI is listening */ public TransactionHooks(BaseHook h, XSharedPreferences sharedPreferences, int port) { super(h); sPrefs = sharedPreferences; AppInformation.Instance.sPrefs = sPrefs; this.port = port; }
@Override public void handleLoadPackage(XC_LoadPackage.LoadPackageParam lpparam) throws Throwable { final Class<?> phoneWindowManager; if (Build.VERSION.SDK_INT > Build.VERSION_CODES.KITKAT) { phoneWindowManager = XposedHelpers.findClass("com.android.server.policy.PhoneWindowManager", lpparam.classLoader); } else { phoneWindowManager = XposedHelpers.findClass("com.android.internal.policy.impl.PhoneWindowManager", lpparam.classLoader); } XposedBridge.hookAllMethods(phoneWindowManager, "interceptKeyBeforeQueueing", new XC_MethodHook() { @Override protected void beforeHookedMethod(MethodHookParam param) throws Throwable { int keyCode = ((KeyEvent) param.args[0]).getKeyCode(); if (keyCode == KeyEvent.KEYCODE_POWER) { XSharedPreferences mXsp = new XSharedPreferences(PACKAGE_NAME); Log.d("isBlockPowerButton", "=================" + mXsp.getBoolean("isBlockPowerButton", true)); XposedBridge.log("isBlockPowerButton" + "=================" + mXsp.getBoolean("isBlockPowerButton", true)); if (mXsp.getBoolean("isBlockPowerButton", true)) { param.setResult(0); } } } }); }
public static void initResources(final XSharedPreferences prefs, final InitPackageResourcesParam resparam) { try { StatusbarSignalCluster.initResources(prefs, resparam); } catch (Throwable t) { XposedBridge.log(t); } }
public NotificationWallpaper(FrameLayout container, XSharedPreferences prefs) throws Throwable { mNotificationPanelView = container; mContext = mNotificationPanelView.getContext(); mBackupBg = mNotificationPanelView.getBackground(); Context gbContext = Utils.getGbContext(mContext); mNotifBgImagePathPortrait = gbContext.getFilesDir() + "/notifwallpaper"; mNotifBgImagePathLandscape = gbContext.getFilesDir() + "/notifwallpaper_landscape"; initPreferences(prefs); createHooks(); prepareWallpaper(); }
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)); }
public SystemIconController(ClassLoader classLoader, XSharedPreferences prefs) { mBtMode = BtMode.valueOf(prefs.getString( GravityBoxSettings.PREF_KEY_STATUSBAR_BT_VISIBILITY, "DEFAULT")); mHideVibrateIcon = prefs.getBoolean( GravityBoxSettings.PREF_KEY_STATUSBAR_HIDE_VIBRATE_ICON, false); createHooks(classLoader); }
public static void initResources(XSharedPreferences prefs, InitPackageResourcesParam resparam) { XModuleResources modRes = XModuleResources.createInstance(GravityBox.MODULE_PATH, resparam.res); mIconNotifResId = XResources.getFakeResId(modRes, R.drawable.ic_audio_notification); resparam.res.setReplacement(mIconNotifResId, modRes.fwd(R.drawable.ic_audio_notification)); mIconNotifMuteResId = XResources.getFakeResId(modRes, R.drawable.ic_audio_notification_mute); resparam.res.setReplacement(mIconNotifMuteResId, modRes.fwd(R.drawable.ic_audio_notification_mute)); }
public static void init(final XSharedPreferences prefs, final ClassLoader classLoader) { try { // reserved for potential future use } catch (Throwable t) { XposedBridge.log(t); } }
private static boolean shouldNotDisturb(Context context) { String pkgName = getTopLevelPackageName(context); final XSharedPreferences uncPrefs = new XSharedPreferences(GravityBox.PACKAGE_NAME, "ledcontrol"); if(!uncPrefs.getBoolean(LedSettings.PREF_KEY_LOCKED, false) && pkgName != null) { LedSettings ls = LedSettings.deserialize(uncPrefs.getStringSet(pkgName, null)); return (ls.getEnabled() && ls.getHeadsUpDnd()); } else { return false; } }
public static void createKeyguardMonitor(Context ctx, XSharedPreferences prefs) { if (KeyguardMonitor != null) return; try { KeyguardMonitor = new KeyguardStateMonitor(ctx, prefs); } catch (Throwable t) { log("Error creating KeyguardMonitor: "); XposedBridge.log(t); } }
public AppLauncher(Context context, XSharedPreferences prefs) throws Throwable { mContext = context; mResources = mContext.getResources(); mPrefs = prefs; mGbContext = Utils.getGbContext(mContext); mGbResources = mGbContext.getResources(); mHandler = new Handler(); mPm = mContext.getPackageManager(); mAppSlots = new ArrayList<AppInfo>(); mAppSlots.add(new AppInfo(R.id.quickapp1)); mAppSlots.add(new AppInfo(R.id.quickapp2)); mAppSlots.add(new AppInfo(R.id.quickapp3)); mAppSlots.add(new AppInfo(R.id.quickapp4)); mAppSlots.add(new AppInfo(R.id.quickapp5)); mAppSlots.add(new AppInfo(R.id.quickapp6)); mAppSlots.add(new AppInfo(R.id.quickapp7)); mAppSlots.add(new AppInfo(R.id.quickapp8)); mAppSlots.add(new AppInfo(R.id.quickapp9)); mAppSlots.add(new AppInfo(R.id.quickapp10)); mAppSlots.add(new AppInfo(R.id.quickapp11)); mAppSlots.add(new AppInfo(R.id.quickapp12)); IntentFilter intentFilter = new IntentFilter(Intent.ACTION_PACKAGE_FULLY_REMOVED); intentFilter.addDataScheme("package"); mContext.registerReceiver(mPackageRemoveReceiver, intentFilter); }
public FingerprintLauncher(Context ctx, XSharedPreferences prefs) throws Throwable { if (ctx == null) throw new IllegalArgumentException("Context cannot be null"); mContext = ctx; mGbContext = Utils.getGbContext(mContext); mPrefs = prefs; mQuickApp = mPrefs.getString(GravityBoxSettings.PREF_KEY_FINGERPRINT_LAUNCHER_APP, null); mShowToast = mPrefs.getBoolean(GravityBoxSettings.PREF_KEY_FINGERPRINT_LAUNCHER_SHOW_TOAST, true); initFingerprintManager(); initFingerAppMap(prefs); }
private void initFingerAppMap(XSharedPreferences prefs) { mFingerAppMap = new HashMap<>(); int[] ids = getEnrolledFingerprintIds(); if (ids != null) { for (int i = 0; i < ids.length; i++) { String key = GravityBoxSettings.PREF_KEY_FINGERPRINT_LAUNCHER_FINGER + String.valueOf(i); String[] data = parseFingerPrefSet(prefs.getStringSet(key, null)); if (data[0] != null) { mFingerAppMap.put(data[0], data[1]); } } } }
private void initPreferences(XSharedPreferences prefs) { setTextSize(Integer.valueOf(prefs.getString( GravityBoxSettings.PREF_KEY_BATTERY_PERCENT_TEXT_SIZE, "16"))); setPercentSign(prefs.getString( GravityBoxSettings.PREF_KEY_BATTERY_PERCENT_TEXT_STYLE, "%")); setChargingStyle(Integer.valueOf(prefs.getString( GravityBoxSettings.PREF_KEY_BATTERY_PERCENT_TEXT_CHARGING, "0"))); setChargingColor(prefs.getInt( GravityBoxSettings.PREF_KEY_BATTERY_PERCENT_TEXT_CHARGING_COLOR, Color.GREEN)); }
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); }
public static void init(final XSharedPreferences prefs, final ClassLoader classLoader) { try { final Class<?> classVoiceIoSettings = XposedHelpers.findClass(CLASS_VOICEIO_SETTINGS, classLoader); if (DEBUG) log("replacing populateOrRemovePreferences method"); XposedHelpers.findAndHookMethod(classVoiceIoSettings, "populateOrRemovePreferences", new XC_MethodReplacement() { @Override protected Object replaceHookedMethod(MethodHookParam param) throws Throwable { boolean hasRecognizer = (Boolean) XposedHelpers.callMethod(param.thisObject, "populateOrRemoveRecognizerPrefs"); boolean hasTts = (Boolean) XposedHelpers.callMethod(param.thisObject, "populateOrRemoveTtsPrefs"); if (DEBUG) log("populateOrRemovePreferences: hasRecognizer=" + hasRecognizer + "; hasTts=" + hasTts); if (hasRecognizer || hasTts) { return null; } PreferenceFragment fragment = (PreferenceFragment) XposedHelpers.getObjectField( param.thisObject, "mFragment"); PreferenceCategory prefCat = (PreferenceCategory) XposedHelpers.getObjectField( param.thisObject, "mVoiceCategory"); if (fragment != null && prefCat != null) { fragment.getPreferenceScreen().removePreference(prefCat); } return null; } }); } catch (Throwable t) { XposedBridge.log(t); } }
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(); }
public ProgressBarView(ContainerType containerType, ViewGroup container, XSharedPreferences prefs, ProgressBarController ctrl) { super(container.getContext()); mContainerType = containerType; mCtrl = ctrl; mAnimated = prefs.getBoolean(GravityBoxSettings.PREF_KEY_STATUSBAR_DOWNLOAD_PROGRESS_ANIMATED, true); mCentered = prefs.getBoolean(GravityBoxSettings.PREF_KEY_STATUSBAR_DOWNLOAD_PROGRESS_CENTERED, false); mHeightPx = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, prefs.getInt(GravityBoxSettings.PREF_KEY_STATUSBAR_DOWNLOAD_PROGRESS_THICKNESS, 1), getResources().getDisplayMetrics()); mEdgeMarginPx = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, prefs.getInt(GravityBoxSettings.PREF_KEY_STATUSBAR_DOWNLOAD_PROGRESS_MARGIN, 0), getResources().getDisplayMetrics()); setScaleX(0f); setBackgroundColor(Color.WHITE); setVisibility(View.GONE); container.addView(this); mAnimator = new ObjectAnimator(); mAnimator.setTarget(this); mAnimator.setInterpolator(new DecelerateInterpolator()); mAnimator.setDuration(ANIM_DURATION); mAnimator.setRepeatCount(0); }
public static boolean isExpandedDesktopEnabled(XSharedPreferences prefs) { int edMode = GravityBoxSettings.ED_DISABLED; try { edMode = Integer.valueOf(prefs.getString(GravityBoxSettings.PREF_KEY_EXPANDED_DESKTOP, "0")); } catch(NumberFormatException nfe) { log("Invalid value for PREF_KEY_EXPANDED_DESKTOP preference"); } return (edMode != GravityBoxSettings.ED_DISABLED); }
public BatteryStyleController(ContainerType containerType, ViewGroup container, XSharedPreferences prefs) throws Throwable { mContainerType = containerType; mContainer = container; mContext = container.getContext(); mSystemIcons = (ViewGroup) mContainer.findViewById( mContext.getResources().getIdentifier("system_icons", "id", PACKAGE_NAME)); if (mSystemIcons != null) { initPreferences(prefs); initLayout(); createHooks(); updateBatteryStyle(); } }
private static void updatePreference(final XSharedPreferences prefs) { prefs.reload(); allowSkipTrack = prefs.getBoolean(GravityBoxSettings.PREF_KEY_VOL_MUSIC_CONTROLS, false); mShoudTriggerWakeUp = "enabled".equals( prefs.getString(GravityBoxSettings.PREF_KEY_VOLUME_ROCKER_WAKE, "default")) && prefs.getBoolean(GravityBoxSettings.PREF_KEY_VOLUME_ROCKER_WAKE_ALLOW_MUSIC, false); if (DEBUG) log("allowSkipTrack = " + allowSkipTrack + "; " + "mShoudTriggerWakeUp=" + mShoudTriggerWakeUp); }
private static void reloadPrefs(XSharedPreferences prefs) { if ((System.currentTimeMillis() - mPrefsReloadedTstamp) > 10000) { if (DEBUG) log("Reloading preferences"); prefs.reload(); mPrefsReloadedTstamp = System.currentTimeMillis(); } }
protected HotspotTile(Object host, String aospKey, Object tile, XSharedPreferences prefs, QsTileEventDistributor eventDistributor) throws Throwable { super(host, "aosp_tile_hotspot", tile, prefs, eventDistributor); mAospKey = aospKey; createHooks(); }