当前位置: 首页>>代码示例>>Java>>正文


Java XSharedPreferences.getString方法代码示例

本文整理汇总了Java中de.robv.android.xposed.XSharedPreferences.getString方法的典型用法代码示例。如果您正苦于以下问题:Java XSharedPreferences.getString方法的具体用法?Java XSharedPreferences.getString怎么用?Java XSharedPreferences.getString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在de.robv.android.xposed.XSharedPreferences的用法示例。


在下文中一共展示了XSharedPreferences.getString方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: handleLoadPackage

import de.robv.android.xposed.XSharedPreferences; //导入方法依赖的package包/类
@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);
}
 
开发者ID:nijigenirubasho,项目名称:mobiletailchanger,代码行数:26,代码来源:Xpo.java

示例2: getPref

import de.robv.android.xposed.XSharedPreferences; //导入方法依赖的package包/类
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"));
}
 
开发者ID:akhilkedia,项目名称:AllTrans,代码行数:25,代码来源:PreferenceList.java

示例3: initResources

import de.robv.android.xposed.XSharedPreferences; //导入方法依赖的package包/类
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"));
    }
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:27,代码来源:StatusbarSignalCluster.java

示例4: initPreferences

import de.robv.android.xposed.XSharedPreferences; //导入方法依赖的package包/类
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));
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:10,代码来源:NotificationWallpaper.java

示例5: StatusbarClock

import de.robv.android.xposed.XSharedPreferences; //导入方法依赖的package包/类
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);
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:11,代码来源:StatusbarClock.java

示例6: ProgressBarController

import de.robv.android.xposed.XSharedPreferences; //导入方法依赖的package包/类
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();
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:16,代码来源:ProgressBarController.java

示例7: handleLoadPackage

import de.robv.android.xposed.XSharedPreferences; //导入方法依赖的package包/类
@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();
    }
}
 
开发者ID:mateuszk87,项目名称:BadIntent,代码行数:42,代码来源:AppAnalyzer.java

示例8: init

import de.robv.android.xposed.XSharedPreferences; //导入方法依赖的package包/类
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);

    //加载图片资源文件
    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);
}
 
开发者ID:EggUncle,项目名称:XposedNavigationBar,代码行数:81,代码来源:DataHook.java

示例9: getBadIntentURL

import de.robv.android.xposed.XSharedPreferences; //导入方法依赖的package包/类
/**
 * 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);
}
 
开发者ID:mateuszk87,项目名称:BadIntent,代码行数:13,代码来源:ConnectionUtils.java


注:本文中的de.robv.android.xposed.XSharedPreferences.getString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。