Bug 1486524 - Don't use XZ compression for libs on Android r=glandium,nalexander
☠☠ backed out by a38af3c7c0e4 ☠ ☠
authorJames Willcox <snorp@snorp.net>
Wed, 21 Nov 2018 15:21:59 +0000
changeset 506690 1e076b0054ccefb1dbbb89e885277e8d1d152832
parent 506689 dbb1558cb40e071e67fe4fcab5e92b2d25fb03f6
child 506691 bae43dfd3700460a55f3559eabbc888975f3a3c0
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium, nalexander
bugs1486524
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1486524 - Don't use XZ compression for libs on Android r=glandium,nalexander This also uses idiomatic packaging of the native libraries, which will allow easier downstream consumption of GeckoView. Differential Revision: https://phabricator.services.mozilla.com/D10775
mobile/android/base/java/org/mozilla/gecko/db/SQLiteBridgeContentProvider.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoThread.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/NSSBridge.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/mozglue/GeckoLoader.java
mobile/android/gradle/with_gecko_binaries.gradle
mobile/android/installer/package-manifest.in
mobile/android/tests/browser/robocop/src/org/mozilla/gecko/FennecNativeActions.java
mozglue/android/APKOpen.cpp
python/mozbuild/mozbuild/action/package_fennec_apk.py
--- a/mobile/android/base/java/org/mozilla/gecko/db/SQLiteBridgeContentProvider.java
+++ b/mobile/android/base/java/org/mozilla/gecko/db/SQLiteBridgeContentProvider.java
@@ -115,19 +115,18 @@ public abstract class SQLiteBridgeConten
         return !TextUtils.isEmpty(isSync);
     }
 
     private SQLiteBridge getDB(Context context, final String databasePath) {
         SQLiteBridge bridge = null;
 
         boolean dbNeedsSetup = true;
         try {
-            String resourcePath = context.getPackageResourcePath();
-            GeckoLoader.loadSQLiteLibs(context, resourcePath);
-            GeckoLoader.loadNSSLibs(context, resourcePath);
+            GeckoLoader.loadSQLiteLibs(context);
+            GeckoLoader.loadNSSLibs(context);
             bridge = SQLiteBridge.openDatabase(databasePath, null, 0);
             int version = bridge.getVersion();
             dbNeedsSetup = version != getDBVersion();
         } catch (SQLiteBridgeException ex) {
             // close the database
             if (bridge != null) {
                 bridge.close();
             }
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoThread.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoThread.java
@@ -255,20 +255,20 @@ public class GeckoThread extends Thread 
         return !isState(State.INITIAL);
     }
 
     @RobocopTarget
     public static boolean isRunning() {
         return isState(State.RUNNING);
     }
 
-    private static void loadGeckoLibs(final Context context, final String resourcePath) {
-        GeckoLoader.loadSQLiteLibs(context, resourcePath);
-        GeckoLoader.loadNSSLibs(context, resourcePath);
-        GeckoLoader.loadGeckoLibs(context, resourcePath);
+    private static void loadGeckoLibs(final Context context) {
+        GeckoLoader.loadSQLiteLibs(context);
+        GeckoLoader.loadNSSLibs(context);
+        GeckoLoader.loadGeckoLibs(context);
         setState(State.LIBS_READY);
     }
 
     private static void initGeckoEnvironment() {
         final Context context = GeckoAppShell.getApplicationContext();
         GeckoLoader.loadMozGlue(context);
         setState(State.MOZGLUE_READY);
 
@@ -279,38 +279,17 @@ public class GeckoThread extends Thread 
             Locale.setDefault(mappedLocale);
             Configuration config = res.getConfiguration();
             config.locale = mappedLocale;
             res.updateConfiguration(config, null);
         }
 
         GeckoSystemStateListener.getInstance().initialize(context);
 
-        final String resourcePath = context.getPackageResourcePath();
-
-        try {
-            loadGeckoLibs(context, resourcePath);
-            return;
-        } catch (final Exception e) {
-            // Cannot load libs; try clearing the cached files.
-            Log.w(LOGTAG, "Clearing cache after load libs exception", e);
-        }
-
-        FileUtils.delTree(GeckoLoader.getCacheDir(context),
-                          new FileUtils.FilenameRegexFilter(".*\\.so(?:\\.crc)?$"),
-                          /* recurse */ true);
-
-        if (!GeckoLoader.verifyCRCs(resourcePath)) {
-            setState(State.CORRUPT_APK);
-            EventDispatcher.getInstance().dispatch("Gecko:CorruptAPK", null);
-            return;
-        }
-
-        // Then try loading again. If this throws again, we actually crash.
-        loadGeckoLibs(context, resourcePath);
+        loadGeckoLibs(context);
     }
 
     private String[] getMainProcessArgs() {
         final Context context = GeckoAppShell.getApplicationContext();
         final ArrayList<String> args = new ArrayList<String>();
 
         // argv[0] is the program name, which for us is the package name.
         args.add(context.getPackageName());
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/NSSBridge.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/NSSBridge.java
@@ -13,43 +13,39 @@ public class NSSBridge {
     private static final String LOGTAG = "NSSBridge";
 
     private static native String nativeEncrypt(String aDb, String aValue);
     private static native String nativeDecrypt(String aDb, String aValue);
 
     @RobocopTarget
     static public String encrypt(Context context, String aValue)
       throws Exception {
-        String resourcePath = context.getPackageResourcePath();
-        GeckoLoader.loadNSSLibs(context, resourcePath);
+        GeckoLoader.loadNSSLibs(context);
 
         String path = GeckoProfile.get(context).getDir().toString();
         return nativeEncrypt(path, aValue);
     }
 
     @RobocopTarget
     static public String encrypt(Context context, String profilePath, String aValue)
       throws Exception {
-        String resourcePath = context.getPackageResourcePath();
-        GeckoLoader.loadNSSLibs(context, resourcePath);
+        GeckoLoader.loadNSSLibs(context);
 
         return nativeEncrypt(profilePath, aValue);
     }
 
     @RobocopTarget
     static public String decrypt(Context context, String aValue)
       throws Exception {
-        String resourcePath = context.getPackageResourcePath();
-        GeckoLoader.loadNSSLibs(context, resourcePath);
+        GeckoLoader.loadNSSLibs(context);
 
         String path = GeckoProfile.get(context).getDir().toString();
         return nativeDecrypt(path, aValue);
     }
 
     @RobocopTarget
     static public String decrypt(Context context, String profilePath, String aValue)
       throws Exception {
-        String resourcePath = context.getPackageResourcePath();
-        GeckoLoader.loadNSSLibs(context, resourcePath);
+        GeckoLoader.loadNSSLibs(context);
 
         return nativeDecrypt(profilePath, aValue);
     }
 }
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/mozglue/GeckoLoader.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/mozglue/GeckoLoader.java
@@ -173,42 +173,40 @@ public final class GeckoLoader {
 
         setupInitialPrefs(prefs);
 
         // env from extras could have reset out linker flags; set them again.
         loadLibsSetupLocked(context);
     }
 
     private static void loadLibsSetupLocked(Context context) {
-        // setup the libs cache
         putenv("GRE_HOME=" + getGREDir(context).getPath());
-        putenv("MOZ_LINKER_CACHE=" + getCacheDir(context).getPath());
-        putenv("MOZ_LINKER_EXTRACT=1");
+        putenv("MOZ_ANDROID_LIBDIR=" + context.getApplicationInfo().nativeLibraryDir);
     }
 
     @RobocopTarget
-    public synchronized static void loadSQLiteLibs(final Context context, final String apkName) {
+    public synchronized static void loadSQLiteLibs(final Context context) {
         if (sSQLiteLibsLoaded) {
             return;
         }
 
         loadMozGlue(context);
         loadLibsSetupLocked(context);
-        loadSQLiteLibsNative(apkName);
+        loadSQLiteLibsNative();
         sSQLiteLibsLoaded = true;
     }
 
-    public synchronized static void loadNSSLibs(final Context context, final String apkName) {
+    public synchronized static void loadNSSLibs(final Context context) {
         if (sNSSLibsLoaded) {
             return;
         }
 
         loadMozGlue(context);
         loadLibsSetupLocked(context);
-        loadNSSLibsNative(apkName);
+        loadNSSLibsNative();
         sNSSLibsLoaded = true;
     }
 
     @SuppressWarnings("deprecation")
     private static final String getCPUABI() {
         return android.os.Build.CPU_ABI;
     }
 
@@ -459,19 +457,19 @@ public final class GeckoLoader {
         if (sMozGlueLoaded) {
             return;
         }
 
         doLoadLibrary(context, "mozglue");
         sMozGlueLoaded = true;
     }
 
-    public synchronized static void loadGeckoLibs(final Context context, final String apkName) {
+    public synchronized static void loadGeckoLibs(final Context context) {
         loadLibsSetupLocked(context);
-        loadGeckoLibsNative(apkName);
+        loadGeckoLibsNative();
     }
 
     @SuppressWarnings("serial")
     public static class AbortException extends Exception {
         public AbortException(String msg) {
             super(msg);
         }
     }
@@ -487,14 +485,14 @@ public final class GeckoLoader {
     }
 
     // These methods are implemented in mozglue/android/nsGeckoUtils.cpp
     private static native void putenv(String map);
     public static native boolean verifyCRCs(String apkName);
 
     // These methods are implemented in mozglue/android/APKOpen.cpp
     public static native void nativeRun(String[] args, int prefsFd, int prefMapFd, int ipcFd, int crashFd, int crashAnnotationFd);
-    private static native void loadGeckoLibsNative(String apkName);
-    private static native void loadSQLiteLibsNative(String apkName);
-    private static native void loadNSSLibsNative(String apkName);
+    private static native void loadGeckoLibsNative();
+    private static native void loadSQLiteLibsNative();
+    private static native void loadNSSLibsNative();
     public static native boolean neonCompatible();
     public static native void suppressCrashDialog();
 }
--- a/mobile/android/gradle/with_gecko_binaries.gradle
+++ b/mobile/android/gradle/with_gecko_binaries.gradle
@@ -71,23 +71,16 @@ ext.configureVariantWithGeckoBinaries = 
             return true
         }
 
         into("${project.buildDir}/moz.build/src/${variant.name}/jniLibs")
         from("${distDir}/lib")
     }
 
     def syncAssetsFromDistDir = task("syncAssetsFromDistDirFor${variant.name.capitalize()}", type: Sync) {
-        onlyIf {
-            if (source.empty) {
-                throw new StopExecutionException("Required assets not found in ${distDir}/assets.  Have you built and packaged?")
-            }
-            return true
-        }
-
         into("${project.buildDir}/moz.build/src/${variant.name}/assets")
         from("${distDir}/assets") {
             exclude 'omni.ja'
         }
     }
 
     // Local (read, not 'official') builds want to reflect developer changes to
     // the Omnijar sources.  To do this, the Gradle build calls out to the
--- a/mobile/android/installer/package-manifest.in
+++ b/mobile/android/installer/package-manifest.in
@@ -19,22 +19,22 @@
 @BINPATH@/update.locale
 #ifdef MOZ_UPDATER
 @BINPATH@/updater.ini
 #endif
 @BINPATH@/dictionaries/*
 @BINPATH@/hyphenation/*
 @BINPATH@/localization/*
 
-; We want fennec/assets for both Fennec and GeckoView, so we turn
-; geckoview/assets into fennec/assets.
+; We want fennec/lib for both Fennec and GeckoView, so we turn
+; geckoview/lib into fennec/lib.
 #ifndef MOZ_GECKOVIEW_JAR
-[assets xz_compress="1" destdir="assets/@ANDROID_CPU_ARCH@"]
+[lib destdir="lib/@ANDROID_CPU_ARCH@"]
 #else
-[assets xz_compress="1" destdir="../fennec/assets/@ANDROID_CPU_ARCH@"]
+[lib destdir="../fennec/lib/@ANDROID_CPU_ARCH@"]
 #endif
 
 #ifndef MOZ_STATIC_JS
 @BINPATH@/@DLL_PREFIX@mozjs@DLL_SUFFIX@
 #endif
 #ifdef MOZ_DMD
 @BINPATH@/@DLL_PREFIX@dmd@DLL_SUFFIX@
 #endif
@@ -73,24 +73,16 @@
 @BINPATH@/@DLL_PREFIX@nssdbm3.chk
 #endif
 #endif
 
 #ifndef MOZ_FOLD_LIBS
 @BINPATH@/@DLL_PREFIX@mozsqlite3@DLL_SUFFIX@
 #endif
 
-; We want fennec/lib for both Fennec and GeckoView, so we turn
-; geckoview/lib into fennec/lib.
-#ifndef MOZ_GECKOVIEW_JAR
-[lib destdir="lib/@ANDROID_CPU_ARCH@"]
-#else
-[lib destdir="../fennec/lib/@ANDROID_CPU_ARCH@"]
-#endif
-
 @BINPATH@/@DLL_PREFIX@mozglue@DLL_SUFFIX@
 # This should be MOZ_CHILD_PROCESS_NAME, but that has a "lib/" prefix.
 @BINPATH@/@MOZ_CHILD_PROCESS_NAME@
 
 #ifdef MOZ_ANDROID_GOOGLE_VR
 @BINPATH@/@DLL_PREFIX@gvr@DLL_SUFFIX@
 #endif
 
--- a/mobile/android/tests/browser/robocop/src/org/mozilla/gecko/FennecNativeActions.java
+++ b/mobile/android/tests/browser/robocop/src/org/mozilla/gecko/FennecNativeActions.java
@@ -33,17 +33,17 @@ public class FennecNativeActions impleme
     private Instrumentation mInstr;
     private Assert mAsserter;
 
     public FennecNativeActions(Activity activity, Solo robocop, Instrumentation instrumentation, Assert asserter) {
         mSolo = robocop;
         mInstr = instrumentation;
         mAsserter = asserter;
 
-        GeckoLoader.loadSQLiteLibs(activity, activity.getApplication().getPackageResourcePath());
+        GeckoLoader.loadSQLiteLibs(activity);
     }
 
     class GeckoEventExpecter implements RepeatedEventExpecter {
         private static final int MAX_WAIT_MS = 180000;
 
         private volatile boolean mIsRegistered;
 
         private final EventDispatcher mDispatcher;
--- a/mozglue/android/APKOpen.cpp
+++ b/mozglue/android/APKOpen.cpp
@@ -179,44 +179,41 @@ delete_mapping(const char *name)
       *info = *last;
       --mapping_count;
       break;
     }
   }
 }
 
 static UniquePtr<char[]>
-getAPKLibraryName(const char* apkName, const char* libraryName)
+getUnpackedLibraryName(const char* libraryName)
 {
-#define APK_ASSETS_PATH "!/assets/" ANDROID_CPU_ARCH "/"
-  size_t filenameLength = strlen(apkName) +
-    sizeof(APK_ASSETS_PATH) + 	// includes \0 terminator
-    strlen(libraryName);
-  auto file = MakeUnique<char[]>(filenameLength);
-  snprintf(file.get(), filenameLength, "%s" APK_ASSETS_PATH "%s",
-	   apkName, libraryName);
+  static const char *libdir = getenv("MOZ_ANDROID_LIBDIR");
+
+  size_t len = strlen(libdir) + 1 /* path separator */ + strlen(libraryName) + 1; /* null terminator */
+  auto file = MakeUnique<char[]>(len);
+  snprintf(file.get(), len, "%s/%s", libdir, libraryName);
   return file;
-#undef APK_ASSETS_PATH
 }
 
 static void*
-dlopenAPKLibrary(const char* apkName, const char* libraryName)
+dlopenLibrary(const char* libraryName)
 {
-  return __wrap_dlopen(getAPKLibraryName(apkName, libraryName).get(), RTLD_GLOBAL | RTLD_LAZY);
+  return __wrap_dlopen(getUnpackedLibraryName(libraryName).get(), RTLD_GLOBAL | RTLD_LAZY);
 }
 
 static mozglueresult
-loadGeckoLibs(const char *apkName)
+loadGeckoLibs()
 {
   TimeStamp t0 = TimeStamp::Now();
   struct rusage usage1_thread, usage1;
   getrusage(RUSAGE_THREAD, &usage1_thread);
   getrusage(RUSAGE_SELF, &usage1);
 
-  gBootstrap = GetBootstrap(getAPKLibraryName(apkName, "libxul.so").get());
+  gBootstrap = GetBootstrap(getUnpackedLibraryName("libxul.so").get());
   if (!gBootstrap) {
     __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "Couldn't get a handle to libxul!");
     return FAILURE;
   }
 
   TimeStamp t1 = TimeStamp::Now();
   struct rusage usage2_thread, usage2;
   getrusage(RUSAGE_THREAD, &usage2_thread);
@@ -235,52 +232,52 @@ loadGeckoLibs(const char *apkName)
                       usage2_thread.ru_majflt - usage1_thread.ru_majflt,
                       usage2.ru_majflt - usage1.ru_majflt);
 
   gBootstrap->XRE_StartupTimelineRecord(LINKER_INITIALIZED, t0);
   gBootstrap->XRE_StartupTimelineRecord(LIBRARIES_LOADED, t1);
   return SUCCESS;
 }
 
-static mozglueresult loadNSSLibs(const char *apkName);
+static mozglueresult loadNSSLibs();
 
 static mozglueresult
-loadSQLiteLibs(const char *apkName)
+loadSQLiteLibs()
 {
   if (sqlite_handle)
     return SUCCESS;
 
 #ifdef MOZ_FOLD_LIBS
-  if (loadNSSLibs(apkName) != SUCCESS)
+  if (loadNSSLibs() != SUCCESS)
     return FAILURE;
 #else
 
-  sqlite_handle = dlopenAPKLibrary(apkName, "libmozsqlite3.so");
+  sqlite_handle = dlopenLibrary("libmozsqlite3.so");
   if (!sqlite_handle) {
     __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "Couldn't get a handle to libmozsqlite3!");
     return FAILURE;
   }
 #endif
 
   setup_sqlite_functions(sqlite_handle);
   return SUCCESS;
 }
 
 static mozglueresult
-loadNSSLibs(const char *apkName)
+loadNSSLibs()
 {
   if (nss_handle && nspr_handle && plc_handle)
     return SUCCESS;
 
-  nss_handle = dlopenAPKLibrary(apkName, "libnss3.so");
+  nss_handle = dlopenLibrary("libnss3.so");
 
 #ifndef MOZ_FOLD_LIBS
-  nspr_handle = dlopenAPKLibrary(apkName, "libnspr4.so");
+  nspr_handle = dlopenLibrary("libnspr4.so");
 
-  plc_handle = dlopenAPKLibrary(apkName, "libplc4.so");
+  plc_handle = dlopenLibrary("libplc4.so");
 #endif
 
   if (!nss_handle) {
     __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "Couldn't get a handle to libnss3!");
     return FAILURE;
   }
 
 #ifndef MOZ_FOLD_LIBS
@@ -294,68 +291,44 @@ loadNSSLibs(const char *apkName)
     return FAILURE;
   }
 #endif
 
   return setup_nss_functions(nss_handle, nspr_handle, plc_handle);
 }
 
 extern "C" APKOPEN_EXPORT void MOZ_JNICALL
-Java_org_mozilla_gecko_mozglue_GeckoLoader_loadGeckoLibsNative(JNIEnv *jenv, jclass jGeckoAppShellClass, jstring jApkName)
+Java_org_mozilla_gecko_mozglue_GeckoLoader_loadGeckoLibsNative(JNIEnv *jenv, jclass jGeckoAppShellClass)
 {
   jenv->GetJavaVM(&sJavaVM);
 
-  const char* str;
-  // XXX: java doesn't give us true UTF8, we should figure out something
-  // better to do here
-  str = jenv->GetStringUTFChars(jApkName, nullptr);
-  if (str == nullptr)
-    return;
-
-  int res = loadGeckoLibs(str);
+  int res = loadGeckoLibs();
   if (res != SUCCESS) {
     JNI_Throw(jenv, "java/lang/Exception", "Error loading gecko libraries");
   }
-  jenv->ReleaseStringUTFChars(jApkName, str);
 }
 
 extern "C" APKOPEN_EXPORT void MOZ_JNICALL
-Java_org_mozilla_gecko_mozglue_GeckoLoader_loadSQLiteLibsNative(JNIEnv *jenv, jclass jGeckoAppShellClass, jstring jApkName) {
-  const char* str;
-  // XXX: java doesn't give us true UTF8, we should figure out something
-  // better to do here
-  str = jenv->GetStringUTFChars(jApkName, nullptr);
-  if (str == nullptr)
-    return;
-
+Java_org_mozilla_gecko_mozglue_GeckoLoader_loadSQLiteLibsNative(JNIEnv *jenv, jclass jGeckoAppShellClass) {
   __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "Load sqlite start\n");
-  mozglueresult rv = loadSQLiteLibs(str);
+  mozglueresult rv = loadSQLiteLibs();
   if (rv != SUCCESS) {
       JNI_Throw(jenv, "java/lang/Exception", "Error loading sqlite libraries");
   }
   __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "Load sqlite done\n");
-  jenv->ReleaseStringUTFChars(jApkName, str);
 }
 
 extern "C" APKOPEN_EXPORT void MOZ_JNICALL
-Java_org_mozilla_gecko_mozglue_GeckoLoader_loadNSSLibsNative(JNIEnv *jenv, jclass jGeckoAppShellClass, jstring jApkName) {
-  const char* str;
-  // XXX: java doesn't give us true UTF8, we should figure out something
-  // better to do here
-  str = jenv->GetStringUTFChars(jApkName, nullptr);
-  if (str == nullptr)
-    return;
-
+Java_org_mozilla_gecko_mozglue_GeckoLoader_loadNSSLibsNative(JNIEnv *jenv, jclass jGeckoAppShellClass) {
   __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "Load nss start\n");
-  mozglueresult rv = loadNSSLibs(str);
+  mozglueresult rv = loadNSSLibs();
   if (rv != SUCCESS) {
     JNI_Throw(jenv, "java/lang/Exception", "Error loading nss libraries");
   }
   __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "Load nss done\n");
-  jenv->ReleaseStringUTFChars(jApkName, str);
 }
 
 static char**
 CreateArgvFromObjectArray(JNIEnv *jenv, jobjectArray jargs, int* length)
 {
   size_t stringCount = jenv->GetArrayLength(jargs);
 
   if (length) {
@@ -417,32 +390,23 @@ Java_org_mozilla_gecko_mozglue_GeckoLoad
 
   gBootstrap.reset();
   FreeArgv(argv, argc);
 }
 
 extern "C" APKOPEN_EXPORT mozglueresult
 ChildProcessInit(int argc, char* argv[])
 {
-  int i;
-  for (i = 0; i < (argc - 1); i++) {
-    if (strcmp(argv[i], "-greomni"))
-      continue;
-
-    i = i + 1;
-    break;
-  }
-
-  if (loadNSSLibs(argv[i]) != SUCCESS) {
+  if (loadNSSLibs() != SUCCESS) {
     return FAILURE;
   }
-  if (loadSQLiteLibs(argv[i]) != SUCCESS) {
+  if (loadSQLiteLibs() != SUCCESS) {
     return FAILURE;
   }
-  if (loadGeckoLibs(argv[i]) != SUCCESS) {
+  if (loadGeckoLibs() != SUCCESS) {
     return FAILURE;
   }
 
   gBootstrap->XRE_SetProcessType(argv[--argc]);
 
   XREChildData childData;
   return NS_FAILED(gBootstrap->XRE_InitChildProcess(argc, argv, &childData));
 }
--- a/python/mozbuild/mozbuild/action/package_fennec_apk.py
+++ b/python/mozbuild/mozbuild/action/package_fennec_apk.py
@@ -79,26 +79,17 @@ def package_fennec_apk(inputs=[], omni_j
     for features_dir in features_dirs:
         finder = FileFinder(features_dir)
         for p, f in finder.find('**'):
             add(mozpath.join('assets', 'features', p), f, False)
 
     for assets_dir in assets_dirs:
         finder = FileFinder(assets_dir)
         for p, f in finder.find('**'):
-            compress = None  # Take default from Jarrer.
-            if p.endswith('.so'):
-                # Asset libraries are special.
-                if f.open().read(5)[1:] == '7zXZ':
-                    print('%s is already compressed' % p)
-                    # We need to store (rather than deflate) compressed libraries
-                    # (even if we don't compress them ourselves).
-                    compress = False
-
-            add(mozpath.join('assets', p), f, compress=compress)
+            add(mozpath.join('assets', p), f)
 
     for lib_dir in lib_dirs:
         finder = FileFinder(lib_dir)
         for p, f in finder.find('**'):
             add(mozpath.join('lib', p), f)
 
     for root_file in root_files:
         add(os.path.basename(root_file), File(root_file))