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

Method makeApkDepBlock

java/com/facebook/soloader/SysUtil.java:381–393  ·  view source on GitHub ↗

N.B. If this method is changed, the above method #getApkDepBlockLength must also be updated to reflect the expected size of the dep block @param apkFile apk file @param context application context @return dependency file in bytes @throws IOException IOException

(File apkFile, final Context context)

Source from the content-addressed store, hash-verified

379 * @throws IOException IOException
380 */
381 public static byte[] makeApkDepBlock(File apkFile, final Context context) throws IOException {
382 apkFile = apkFile.getCanonicalFile();
383 Parcel parcel = Parcel.obtain();
384 try {
385 parcel.writeByte(APK_SIGNATURE_VERSION);
386 parcel.writeString(apkFile.getPath());
387 parcel.writeLong(apkFile.lastModified());
388 parcel.writeInt(getAppVersionCode(context));
389 return parcel.marshall();
390 } finally {
391 parcel.recycle();
392 }
393 }
394
395 public static int getAppVersionCode(final Context context) {
396 final PackageManager pm = context.getPackageManager();

Callers 2

getApkIdentifierMethod · 0.95
initDepsMethod · 0.95

Calls 1

getAppVersionCodeMethod · 0.95

Tested by

no test coverage detected