Commit 500986fc authored by Wes Johnston's avatar Wes Johnston
Browse files

Bug 718760 - Crypto for the java passwords provider. r=blassey,bsmith

parent 67b65ba3
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@

    <uses-permission android:name="android.permission.WAKE_LOCK"/>
    <uses-permission android:name="android.permission.VIBRATE"/>
    <uses-permission android:name="@ANDROID_PACKAGE_NAME@.permissions.PASSWORD_PROVIDER"/>

#ifdef MOZ_WEBSMS_BACKEND
    <!-- WebSMS -->
@@ -116,6 +117,13 @@
            </intent-filter>
        </receiver>

        <receiver android:name="org.mozilla.gecko.GeckoMessageReceiver"
                  android:permission="@ANDROID_PACKAGE_NAME@.permissions.PASSWORD_PROVIDER">
            <intent-filter>
                  <action android:name="org.mozilla.gecko.INIT_PW"></action>
            </intent-filter>
        </receiver>

        <activity android:name="Restarter"
                  android:process="@ANDROID_PACKAGE_NAME@Restarter"
                  android:theme="@style/Gecko"
@@ -171,8 +179,8 @@

        <provider android:name="@ANDROID_PACKAGE_NAME@.db.PasswordsProvider"
                  android:authorities="@ANDROID_PACKAGE_NAME@.db.passwords"
                  android:permission="@ANDROID_PACKAGE_NAME@.permissions.BROWSER_PROVIDER"
                  android:protectionLevel="signature"/>
                  android:permission="@ANDROID_PACKAGE_NAME@.permissions.PASSWORD_PROVIDER"
                  android:process="org.mozilla.gecko.PasswordsProvider"/>

        <provider android:name="@ANDROID_PACKAGE_NAME@.db.FormHistoryProvider"
                  android:authorities="@ANDROID_PACKAGE_NAME@.db.formhistory"
@@ -189,6 +197,9 @@
    <permission android:name="@ANDROID_PACKAGE_NAME@.permissions.BROWSER_PROVIDER"
                android:protectionLevel="signature"/>

    <permission android:name="@ANDROID_PACKAGE_NAME@.permissions.PASSWORD_PROVIDER"
                android:protectionLevel="signature"/>

    <permission android:name="@ANDROID_PACKAGE_NAME@.permissions.FORMHISTORY_PROVIDER"
                android:protectionLevel="signature"/>

+1 −0
Original line number Diff line number Diff line
@@ -109,6 +109,7 @@ abstract public class GeckoApp
    public static final String ACTION_BOOKMARK      = "org.mozilla.gecko.BOOKMARK";
    public static final String ACTION_LOAD          = "org.mozilla.gecko.LOAD";
    public static final String ACTION_UPDATE        = "org.mozilla.gecko.UPDATE";
    public static final String ACTION_INIT_PW       = "org.mozilla.gecko.INIT_PW";
    public static final String SAVED_STATE_URI      = "uri";
    public static final String SAVED_STATE_TITLE    = "title";
    public static final String SAVED_STATE_VIEWPORT = "viewport";
+15 −1
Original line number Diff line number Diff line
@@ -112,6 +112,7 @@ public class GeckoAppShell
    static File sHomeDir = null;
    static private int sDensityDpi = 0;
    private static Boolean sSQLiteLibsLoaded = false;
    private static Boolean sNSSLibsLoaded = false;
    private static Boolean sLibsSetup = false;
    private static File sGREDir = null;

@@ -141,6 +142,7 @@ public class GeckoAppShell
    public static native void removeObserver(String observerKey);
    public static native void loadGeckoLibsNative(String apkName);
    public static native void loadSQLiteLibsNative(String apkName);
    public static native void loadNSSLibsNative(String apkName);
    public static native void onChangeNetworkLinkStatus(String status);

    public static void reportJavaCrash(Throwable e) {
@@ -346,13 +348,25 @@ public class GeckoAppShell
            if (sSQLiteLibsLoaded)
                return;
            loadMozGlue();
            // the extract libs parameter is being removed in bug 732069
            loadLibsSetup(context);
            loadSQLiteLibsNative(apkName);
            sSQLiteLibsLoaded = true;
        }
    }

    public static void loadNSSLibs(Context context, String apkName) {
        if (sNSSLibsLoaded)
            return;
        synchronized(sNSSLibsLoaded) {
            if (sNSSLibsLoaded)
                return;
            loadMozGlue();
            loadLibsSetup(context);
            loadNSSLibsNative(apkName);
            sNSSLibsLoaded = true;
        }
    }

    public static void loadMozGlue() {
        System.loadLibrary("mozglue");
    }
+20 −0
Original line number Diff line number Diff line
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

package org.mozilla.gecko;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

public class GeckoMessageReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        final String action = intent.getAction();
        if (GeckoApp.ACTION_INIT_PW.equals(action)) {
            GeckoAppShell.sendEventToGecko(GeckoEvent.createBroadcastEvent("Passwords:Init", null));
        }
    }
}
+2 −0
Original line number Diff line number Diff line
@@ -90,6 +90,7 @@ public class GeckoThread extends Thread {
        String resourcePath = app.getApplication().getPackageResourcePath();
        GeckoAppShell.setupGeckoEnvironment(app);
        GeckoAppShell.loadSQLiteLibs(app, resourcePath);
        GeckoAppShell.loadNSSLibs(app, resourcePath);
        GeckoAppShell.loadGeckoLibs(resourcePath);

        Locale.setDefault(locale);
@@ -111,5 +112,6 @@ public class GeckoThread extends Thread {
        } catch (Exception e) {
            GeckoAppShell.reportJavaCrash(e);
        }

    }
}
Loading