Commit 8e8445c1 authored by Georg Koppen's avatar Georg Koppen
Browse files

28051

parent 970fcfe5
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -32,6 +32,10 @@ allprojects {
                url repository
            }
        }
        // These are needed for Orbot's dependencies
        maven { url "https://raw.githubusercontent.com/guardianproject/gpmaven/master" }
        maven { url 'https://jitpack.io' }
        jcenter()
    }
}

+0 −3
Original line number Diff line number Diff line
@@ -54,9 +54,6 @@ pref("media.realtime_decoder.enabled", false);
pref("general.useragent.updates.enabled", false);
pref("general.useragent.updates.url", "");

// Override this because Orbot uses 9050 as the default
pref("network.proxy.socks_port", 9050);

// Do not allow the user to install extensions from web
pref("xpinstall.enabled", false);
pref("extensions.enabledScopes", 1);
+11 −0
Original line number Diff line number Diff line
@@ -225,6 +225,9 @@ dependencies {
    implementation "com.android.support:design:${mozconfig.substs.ANDROID_SUPPORT_LIBRARY_VERSION}"
    implementation "com.android.support:customtabs:${mozconfig.substs.ANDROID_SUPPORT_LIBRARY_VERSION}"
    implementation "com.android.support:palette-v7:${mozconfig.substs.ANDROID_SUPPORT_LIBRARY_VERSION}"
    implementation files('Orbot-16.0.5-RC-1-tor-0.3.4.9-fullperm-release.aar')
    implementation files('orbotservice-release.aar')
    implementation files('jsocksAndroid-release.aar')

    if (mozconfig.substs.MOZ_NATIVE_DEVICES) {
        implementation "com.android.support:mediarouter-v7:${mozconfig.substs.ANDROID_SUPPORT_LIBRARY_VERSION}"
@@ -262,6 +265,14 @@ dependencies {

    // Including the Robotium JAR directly can cause issues with dexing.
    androidTestImplementation 'com.jayway.android.robotium:robotium-solo:5.5.4'

    // Orbot
    implementation 'com.github.delight-im:Android-Languages:v1.0.1'
    implementation 'pl.bclogic:pulsator4droid:1.0.3'

    // Orbotservice
    implementation 'org.torproject:tor-android-binary:0.3.4.9'
    implementation 'com.jrummyapps:android-shell:1.0.1'
}

// TODO: (bug 1261486): This impl is not robust -
+1 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@
#include FennecManifest_permissions.xml.in

    <application android:label="@string/moz_app_displayname"
                 tools:replace="android:label"
                 android:icon="@drawable/icon"
                 android:logo="@drawable/logo"
                 android:name="@MOZ_ANDROID_APPLICATION_CLASS@"
+24 −29
Original line number Diff line number Diff line
@@ -181,7 +181,8 @@ import org.mozilla.gecko.widget.GeckoActionProvider;
import org.mozilla.gecko.widget.SplashScreen;
import org.mozilla.geckoview.GeckoSession;

import info.guardianproject.netcipher.proxy.OrbotHelper;
import org.torproject.android.OrbotMainActivity;
import org.torproject.android.service.TorServiceConstants;

import java.io.File;
import java.io.FileNotFoundException;
@@ -239,6 +240,9 @@ public class BrowserApp extends GeckoApp
    public static final int ACTIVITY_REQUEST_TRIPLE_READERVIEW = 4001;
    public static final int ACTIVITY_RESULT_TRIPLE_READERVIEW_ADD_BOOKMARK = 4002;
    public static final int ACTIVITY_RESULT_TRIPLE_READERVIEW_IGNORE = 4003;
    public static final int ACTIVITY_RESULT_ORBOT_LAUNCH = 5001;

    private static boolean mOrbotRun = false;

    public static final String ACTION_VIEW_MULTIPLE = AppConstants.ANDROID_PACKAGE_NAME + ".action.VIEW_MULTIPLE";

@@ -1282,41 +1286,26 @@ public class BrowserApp extends GeckoApp

        @Override
        public void onReceive(Context context, Intent intent) {
            if (TextUtils.equals(intent.getAction(), OrbotHelper.ACTION_STATUS)) {
            if (TextUtils.equals(intent.getAction(), TorServiceConstants.ACTION_STATUS)) {
                GeckoAppShell.setTorStatus(intent);
            }
        }
    };

    public void checkStartOrbot() {
        if (!OrbotHelper.isOrbotInstalled(this)) {
            final Intent installOrbotIntent = OrbotHelper.getOrbotInstallIntent(this);

            AlertDialog.Builder builder = new AlertDialog.Builder(this);
            builder.setTitle(R.string.install_orbot);
            builder.setMessage(R.string.you_must_have_orbot);
            builder.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialogInterface, int i) {
                    startActivity(installOrbotIntent);
                }
            });
            builder.setNegativeButton(R.string.no, new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialogInterface, int i) {
                }
            });
            builder.show();
        } else {
        /* run in thread so Tor status updates will be received while the
        * Gecko event sync is blocking the main thread */
        HandlerThread handlerThread = new HandlerThread("torStatusReceiver");
        handlerThread.start();
        Looper looper = handlerThread.getLooper();
        Handler handler = new Handler(looper);
            registerReceiver(torStatusReceiver, new IntentFilter(OrbotHelper.ACTION_STATUS),
        registerReceiver(torStatusReceiver, new IntentFilter(TorServiceConstants.ACTION_STATUS),
            null, handler);
            OrbotHelper.requestStartTor(this);

        if (!mOrbotRun) {
          final String orbotStartAction = "android.intent.action.MAIN";
          final Intent launchOrbot = new Intent(orbotStartAction, null, this, OrbotMainActivity.class);
          startActivityForResult(launchOrbot, ACTIVITY_RESULT_ORBOT_LAUNCH, null);
        }
    }

@@ -3018,6 +3007,12 @@ public class BrowserApp extends GeckoApp
                TabQueueHelper.processTabQueuePromptResponse(resultCode, this);
                break;

            case ACTIVITY_RESULT_ORBOT_LAUNCH:
                final SafeIntent intent = new SafeIntent(getIntent());
                Log.d(LOGTAG, "onActivityResult: ACTIVITY_RESULT_ORBOT_LAUNCH");
                mOrbotRun = true;
                break;

            default:
                for (final BrowserAppDelegate delegate : delegates) {
                    delegate.onActivityResult(this, requestCode, resultCode, data);
Loading