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


Java OrbotHelper.isOrbotInstalled方法代码示例

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


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

示例1: setProxyChoice

import info.guardianproject.netcipher.proxy.OrbotHelper; //导入方法依赖的package包/类
@Constants.Proxy
public static int setProxyChoice(int choice, @NonNull Activity activity) {
    switch (choice) {
        case Constants.PROXY_ORBOT:
            if (!OrbotHelper.isOrbotInstalled(activity)) {
                choice = Constants.NO_PROXY;
                Utils.showSnackbar(activity, R.string.install_orbot);
            }
            break;
        case Constants.PROXY_I2P:
            I2PAndroidHelper ih = new I2PAndroidHelper(activity.getApplication());
            if (!ih.isI2PAndroidInstalled()) {
                choice = Constants.NO_PROXY;
                ih.promptToInstall(activity);
            }
            break;
        case Constants.PROXY_MANUAL:
            break;
    }
    return choice;
}
 
开发者ID:XndroidDev,项目名称:Xndroid,代码行数:22,代码来源:ProxyUtils.java

示例2: setProxyChoice

import info.guardianproject.netcipher.proxy.OrbotHelper; //导入方法依赖的package包/类
public static int setProxyChoice(int choice, Activity activity) {
    switch (choice) {
        case Constants.PROXY_ORBOT:
            if (!OrbotHelper.isOrbotInstalled(activity)) {
                choice = Constants.NO_PROXY;
                Utils.showSnackbar(activity, R.string.install_orbot);
            }
            break;

        case Constants.PROXY_I2P:
            I2PAndroidHelper ih = new I2PAndroidHelper(activity.getApplicationContext());
            if (!ih.isI2PAndroidInstalled()) {
                choice = Constants.NO_PROXY;
                ih.promptToInstall(activity);
            }
            break;
        case Constants.PROXY_MANUAL:
            break;
    }
    return choice;
}
 
开发者ID:javadtaghia,项目名称:DeeBrowser,代码行数:22,代码来源:ProxyUtils.java

示例3: checkRemoteAccessOnion

import info.guardianproject.netcipher.proxy.OrbotHelper; //导入方法依赖的package包/类
private void checkRemoteAccessOnion() {
    if (OrbotHelper.isOrbotInstalled(mActivity)) {
        OrbotHelper.requestStartTor(mActivity);

        if (preferences.getRemoteAccessOnion() != null && TextUtils.isEmpty(preferences.getRemoteAccessOnion().trim())) {
            OrbotHelper.requestHiddenServiceOnPort(mActivity, WebServer.LOCAL_PORT);
        }
    } else {
        Toast.makeText(mActivity, R.string.remote_access_onion_error, Toast.LENGTH_LONG).show();
    }
}
 
开发者ID:guardianproject,项目名称:haven,代码行数:12,代码来源:SettingsFragment.java

示例4: checkTorRunning

import info.guardianproject.netcipher.proxy.OrbotHelper; //导入方法依赖的package包/类
public static boolean checkTorRunning(Context context, boolean notifyUser) {
    if (Config.values.useProxy
            && Config.values.useTor
            && OrbotHelper.isOrbotInstalled(context)
            && !OrbotHelper.isOrbotRunning(context)) {
        if (!notifyUser) {
            OrbotHelper.requestStartTor(context);
            return true;
        } else return false;
    } else return true;
}
 
开发者ID:vit1-irk,项目名称:idec-mobile,代码行数:12,代码来源:SimpleFunctions.java

示例5: setUpMenu

import info.guardianproject.netcipher.proxy.OrbotHelper; //导入方法依赖的package包/类
public void setUpMenu(final ActionMenuView actionMenu, final DrawerLayout drawerLayout, final View bookmarksPanel ) {
    this.drawerLayout = drawerLayout;
    this.bookmarksPanel = bookmarksPanel;
    this.actionMenu = actionMenu;

    actionMenu.setOnMenuItemClickListener(this);

    // Enable special buttons
    Menu menu = actionMenu.getMenu();
    PackageManager pm = context.getPackageManager();

    menu.findItem(R.id.action_backgroundPlay).setChecked(sp.getBoolean(BackgroundPlayHelper.PREF_BACKGROUND_PLAY_ENABLED, true));
    menu.findItem(R.id.action_accept_cookies).setChecked(sp.getBoolean(PREF_COOKIES_ENABLED,true));

    // Tor button
    if (OrbotHelper.isOrbotInstalled(context.getApplicationContext())) {
        menu.findItem(R.id.action_tor)
                .setEnabled(true)
                .setChecked(sp.getBoolean(TorHelper.PREF_TOR_ENABLED, false));
    }

    // Add Kodi button
    try {
        pm.getPackageInfo("org.xbmc.kore", PackageManager.GET_ACTIVITIES);
        menu.findItem(R.id.action_cast_to_kodi).setEnabled(true);
    } catch (PackageManager.NameNotFoundException e) {
        /* Kodi is not installed */
    }
}
 
开发者ID:martykan,项目名称:webTube,代码行数:30,代码来源:MenuHelper.java

示例6: setUpTor

import info.guardianproject.netcipher.proxy.OrbotHelper; //导入方法依赖的package包/类
public void setUpTor() {
    // Tor
    if (OrbotHelper.isOrbotInstalled(mApplicationContext)) {
        if (sp.getBoolean(PREF_TOR_ENABLED, false)) {
            torEnable();
        }
    }
}
 
开发者ID:martykan,项目名称:webTube,代码行数:9,代码来源:TorHelper.java

示例7: initOnionSite

import info.guardianproject.netcipher.proxy.OrbotHelper; //导入方法依赖的package包/类
private void initOnionSite ()
{
	if (OrbotHelper.isOrbotInstalled(this))
	{
		OrbotHelper.requestStartTor(this);

		if (mOnionHost == null)
			OrbotHelper.requestHiddenServiceOnPort(this, mLocalPort);

	}
}
 
开发者ID:guardianproject,项目名称:CameraV,代码行数:12,代码来源:RemoteShareActivity.java

示例8: verifyTorSetup

import info.guardianproject.netcipher.proxy.OrbotHelper; //导入方法依赖的package包/类
private static void verifyTorSetup(final Context context) {

		General.checkThisIsUIThread();

		if(!sIsTorEnabled.get()) {
			return;
		}

		if(!OrbotHelper.isOrbotInstalled(context)) {
			promptToInstallOrbot(context);
			return;
		}

		ensureTorIsRunning(context);
	}
 
开发者ID:QuantumBadger,项目名称:RedReader,代码行数:16,代码来源:TorCommon.java

示例9: onSharedPreferenceChanged

import info.guardianproject.netcipher.proxy.OrbotHelper; //导入方法依赖的package包/类
@Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences,
                                      String key) {
    // Никогда не запускать здесь sharedPreferences.edit(), иначе будет
    // цикл с бесконечной рекурсией!

    Activity mContext = getActivity();

    switch (key) {
        case "application_theme":
            Config.select_gui_theme();
            Intent intent = mContext.getIntent();
            mContext.finish();
            startActivity(intent);
            break;
        case "use_proxy":
            Network.proxy = null;
            break;
        case "proxy_address":
            Network.proxy = null;
            break;
        case "use_tor":
            boolean useTor = sharedPreferences.getBoolean(key, Config.default_values.useTor);

            if (useTor) {
                Context context = mContext.getApplicationContext();
                if (!OrbotHelper.isOrbotInstalled(context)) {
                    startActivity(OrbotHelper.getOrbotInstallIntent(context));
                } else if (!OrbotHelper.isOrbotRunning(context)) {
                    startActivity(OrbotHelper.getShowOrbotStartIntent());
                }
            }
            break;
        case "notifications_enabled":
            mContext.startService(new Intent(mContext, AlarmService.class));
            break;
        case "notify_fire_duration":
            mContext.startService(new Intent(mContext, AlarmService.class));
            break;
        case "notifications_vibrate":
            mContext.startService(new Intent(mContext, AlarmService.class));
            break;
    }
}
 
开发者ID:vit1-irk,项目名称:idec-mobile,代码行数:45,代码来源:SettingsFragment.java

示例10: isOrbotInstalled

import info.guardianproject.netcipher.proxy.OrbotHelper; //导入方法依赖的package包/类
public static boolean isOrbotInstalled(Context mContext) {
    return OrbotHelper.isOrbotInstalled(mContext);
}
 
开发者ID:StoryMaker,项目名称:SecureShareLib,代码行数:4,代码来源:Util.java


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