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


Java OrbotHelper.requestStartTor方法代码示例

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


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

示例1: torEnable

import info.guardianproject.netcipher.proxy.OrbotHelper; //导入方法依赖的package包/类
public void torEnable() {
    CookieHelper.acceptCookies(webView, false);
    CookieHelper.deleteCookies();
    //Make sure that all cookies are really deleted
    if (!CookieManager.getInstance().hasCookies()) {
        if (!OrbotHelper.isOrbotRunning(mApplicationContext))
            OrbotHelper.requestStartTor(mApplicationContext);
        try {
            WebkitProxy.setProxy(MainActivity.class.getName(), mApplicationContext, null, "localhost", PORT_TOR);
            SharedPreferences.Editor spEdit = sp.edit();
            spEdit.putBoolean(PREF_TOR_ENABLED, true);
            spEdit.commit();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    webView.reload();
}
 
开发者ID:martykan,项目名称:webTube,代码行数:19,代码来源:TorHelper.java

示例2: 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

示例3: initializeProxy

import info.guardianproject.netcipher.proxy.OrbotHelper; //导入方法依赖的package包/类
private void initializeProxy(@NonNull Activity activity) {
    String host;
    int port;

    switch (mPreferences.getProxyChoice()) {
        case Constants.NO_PROXY:
            // We shouldn't be here
            return;
        case Constants.PROXY_ORBOT:
            if (!OrbotHelper.isOrbotRunning(activity)) {
                OrbotHelper.requestStartTor(activity);
            }
            host = "localhost";
            port = 8118;
            break;
        case Constants.PROXY_I2P:
            mI2PProxyInitialized = true;
            if (mI2PHelperBound && !mI2PHelper.isI2PAndroidRunning()) {
                mI2PHelper.requestI2PAndroidStart(activity);
            }
            host = "localhost";
            port = 4444;
            break;
        default:
            host = mPreferences.getProxyHost();
            port = mPreferences.getProxyPort();
            break;
        case Constants.PROXY_MANUAL:
            host = mPreferences.getProxyHost();
            port = mPreferences.getProxyPort();
            break;
    }

    try {
        WebkitProxy.setProxy(BrowserApp.class.getName(), activity.getApplicationContext(), null, host, port);
    } catch (Exception e) {
        Log.d(TAG, "error enabling web proxying", e);
    }

}
 
开发者ID:XndroidDev,项目名称:Xndroid,代码行数:41,代码来源:ProxyUtils.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: initializeProxy

import info.guardianproject.netcipher.proxy.OrbotHelper; //导入方法依赖的package包/类
private void initializeProxy(Activity activity) {
    String host;
    int port;

    switch (mPreferences.getProxyChoice()) {
        case Constants.NO_PROXY:
            // We shouldn't be here
            return;

        case Constants.PROXY_ORBOT:
            if (!OrbotHelper.isOrbotRunning(activity))
                OrbotHelper.requestStartTor(activity);
            host = "localhost";
            port = 8118;
            break;

        case Constants.PROXY_I2P:
            mI2PProxyInitialized = true;
            if (mI2PHelperBound && !mI2PHelper.isI2PAndroidRunning()) {
                mI2PHelper.requestI2PAndroidStart(activity);
            }
            host = "localhost";
            port = 4444;
            break;

        default:
            host = mPreferences.getProxyHost();
            port = mPreferences.getProxyPort();
    }

    try {
        WebkitProxy.setProxy(BrowserApp.class.getName(), activity.getApplicationContext(), null, host, port);
    } catch (Exception e) {
        Log.d(Constants.TAG, "error enabling web proxying", e);
    }

}
 
开发者ID:javadtaghia,项目名称:DeeBrowser,代码行数:38,代码来源:ProxyUtils.java

示例6: onCreate

import info.guardianproject.netcipher.proxy.OrbotHelper; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_use_tor);

    registerReceiver(torStatusReceiver, new IntentFilter(OrbotHelper.ACTION_STATUS));
    if (!OrbotHelper.requestStartTor(this)) {
        // Orbot needs to be installed, so ignore this request
        Toast.makeText(this, R.string.you_must_have_orbot, Toast.LENGTH_LONG).show();
        finish();
    }
    isReceiverRegistered = true;
}
 
开发者ID:guardianproject,项目名称:LocationPrivacy,代码行数:15,代码来源:UseTorActivity.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: ensureTorIsRunning

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

		if(!OrbotHelper.isOrbotRunning(context)) {
			if(!OrbotHelper.requestStartTor(context)) {

				final AlertDialog.Builder builder = new AlertDialog.Builder(context);
				builder.setMessage(R.string.error_tor_start_failed);

				AlertDialog dialog = builder.create();
				dialog.show();
			}
		}
	}
 
开发者ID:QuantumBadger,项目名称:RedReader,代码行数:14,代码来源:TorCommon.java

示例9: checkStartTor

import info.guardianproject.netcipher.proxy.OrbotHelper; //导入方法依赖的package包/类
public static void checkStartTor(Context context) {
    if (useTor) {
        OrbotHelper.requestStartTor(context);
    }
}
 
开发者ID:uhuru-mobile,项目名称:mobile-store,代码行数:6,代码来源:FDroidApp.java


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