| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.mojo_shell_apk; | 5 package org.chromium.mojo_shell_apk; |
| 6 | 6 |
| 7 import android.content.Context; | 7 import android.content.Context; |
| 8 import android.util.Log; | 8 import android.util.Log; |
| 9 | 9 |
| 10 import dalvik.system.DexClassLoader; | 10 import dalvik.system.DexClassLoader; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 * into the application MojoMain. On the Java side
this is opaque | 74 * into the application MojoMain. On the Java side
this is opaque |
| 75 * payload. | 75 * payload. |
| 76 */ | 76 */ |
| 77 @CalledByNative | 77 @CalledByNative |
| 78 private static boolean bootstrap(Context context, String archivePath, int ha
ndle, | 78 private static boolean bootstrap(Context context, String archivePath, int ha
ndle, |
| 79 long runApplicationPtr) { | 79 long runApplicationPtr) { |
| 80 File bootstrap_java_library; | 80 File bootstrap_java_library; |
| 81 File bootstrap_native_library; | 81 File bootstrap_native_library; |
| 82 try { | 82 try { |
| 83 bootstrap_java_library = FileHelper.extractFromAssets(context, BOOTS
TRAP_JAVA_LIBRARY, | 83 bootstrap_java_library = FileHelper.extractFromAssets(context, BOOTS
TRAP_JAVA_LIBRARY, |
| 84 getAssetDir(context)); | 84 getAssetDir(context), true); |
| 85 bootstrap_native_library = FileHelper.extractFromAssets(context, | 85 bootstrap_native_library = FileHelper.extractFromAssets(context, |
| 86 BOOTSTRAP_NATIVE_LIBRARY, getAssetDir(context)); | 86 BOOTSTRAP_NATIVE_LIBRARY, getAssetDir(context), true); |
| 87 } catch (Exception e) { | 87 } catch (Exception e) { |
| 88 Log.e(TAG, "Extraction of bootstrap files from assets failed.", e); | 88 Log.e(TAG, "Extraction of bootstrap files from assets failed.", e); |
| 89 return false; | 89 return false; |
| 90 } | 90 } |
| 91 | 91 |
| 92 File application_java_library; | 92 File application_java_library; |
| 93 File application_native_library; | 93 File application_native_library; |
| 94 try { | 94 try { |
| 95 File archive = new File(archivePath); | 95 File archive = new File(archivePath); |
| 96 application_java_library = FileHelper.extractFromArchive(archive, JA
VA_LIBRARY_SUFFIX, | 96 application_java_library = FileHelper.extractFromArchive(archive, JA
VA_LIBRARY_SUFFIX, |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 } | 129 } |
| 130 | 130 |
| 131 private static File getAppDir(Context context) { | 131 private static File getAppDir(Context context) { |
| 132 return context.getDir(APP_DIRECTORY, Context.MODE_PRIVATE); | 132 return context.getDir(APP_DIRECTORY, Context.MODE_PRIVATE); |
| 133 } | 133 } |
| 134 | 134 |
| 135 private static File getAssetDir(Context context) { | 135 private static File getAssetDir(Context context) { |
| 136 return context.getDir(ASSET_DIRECTORY, Context.MODE_PRIVATE); | 136 return context.getDir(ASSET_DIRECTORY, Context.MODE_PRIVATE); |
| 137 } | 137 } |
| 138 } | 138 } |
| OLD | NEW |