MCPcopy Create free account
hub / github.com/facebook/SoLoader / initDeps

Method initDeps

java/com/facebook/soloader/NativeDeps.java:217–231  ·  view source on GitHub ↗
(final Context context, boolean extractToDisk)

Source from the content-addressed store, hash-verified

215 }
216
217 private static boolean initDeps(final Context context, boolean extractToDisk) throws IOException {
218 verifyUninitialized();
219 byte[] depsBytes = null;
220 byte[] apkId = null;
221 if (extractToDisk) {
222 File apkFile = new File(context.getApplicationInfo().sourceDir);
223 apkId = SysUtil.makeApkDepBlock(apkFile, context);
224 depsBytes = NativeDepsUnpacker.readNativeDepsFromDisk(context);
225 } else {
226 depsBytes = NativeDepsUnpacker.readNativeDepsFromApk(context);
227 // ApkDepBlock is not needed if we are reading directly from APK
228 }
229
230 return processDepsBytes(apkId, depsBytes);
231 }
232
233 // Given the offset where the dependencies for a library begin in
234 // sEncodedDeps, stores indices for mapping from lib name hash to offset,

Callers 1

Calls 5

verifyUninitializedMethod · 0.95
makeApkDepBlockMethod · 0.95
readNativeDepsFromApkMethod · 0.95
processDepsBytesMethod · 0.95

Tested by

no test coverage detected