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

Method getAppVersionCode

java/com/facebook/soloader/SysUtil.java:395–410  ·  view source on GitHub ↗
(final Context context)

Source from the content-addressed store, hash-verified

393 }
394
395 public static int getAppVersionCode(final Context context) {
396 final PackageManager pm = context.getPackageManager();
397 if (pm != null) {
398 try {
399 PackageInfo pi = pm.getPackageInfo(context.getPackageName(), 0);
400 return pi.versionCode;
401 } catch (PackageManager.NameNotFoundException e) {
402 // That should not happen
403 } catch (RuntimeException e) {
404 // To catch RuntimeException("Package manager has died") that can occur
405 // on some version of Android, when the remote PackageManager is
406 // unavailable. I suspect this sometimes occurs when the App is being reinstalled.
407 }
408 }
409 return 0;
410 }
411
412 @SuppressLint("CatchGeneralException")
413 public static boolean is64Bit() {

Callers 2

getDepsBlockMethod · 0.95
makeApkDepBlockMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected