本文整理汇总了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;
}
示例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;
}
示例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();
}
}
示例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;
}
示例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 */
}
}
示例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();
}
}
}
示例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);
}
}
示例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);
}
示例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;
}
}
示例10: isOrbotInstalled
import info.guardianproject.netcipher.proxy.OrbotHelper; //导入方法依赖的package包/类
public static boolean isOrbotInstalled(Context mContext) {
return OrbotHelper.isOrbotInstalled(mContext);
}