Skip to content

Commit

Permalink
isSupportedDirectLoad returns true unconditionally on system apps
Browse files Browse the repository at this point in the history
Reviewed By: vener91

Differential Revision: D50846745

fbshipit-source-id: ecfc8993e535c65a2c76bb3b5117d18b070c522e
  • Loading branch information
simpleton authored and facebook-github-bot committed Oct 31, 2023
1 parent 1bd762f commit 60586bb
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions java/com/facebook/soloader/SysUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -246,15 +246,8 @@ public static boolean is64Bit() {
return android.os.Process.is64Bit();
}

public static boolean isSupportedDirectLoad(@Nullable Context context, int appType)
throws IOException {
public static boolean isSupportedDirectLoad(@Nullable Context context, int appType) {
if (appType == SoLoader.AppType.SYSTEM_APP) {
if (context != null && context.getApplicationContext() != null) {
// Ideally, system_app permanently stores dso files uncompressed and page-aligned, even
// with FLAG_EXTRACT_NATIVE_LIBS flag. But to support a specific Oculus's sideload method,
// we need this extra checking. ref: D27831042
return isApkUncompressedDso(context);
}
return true;
} else {
return isDisabledExtractNativeLibs(context);
Expand Down Expand Up @@ -416,8 +409,7 @@ public static boolean is64Bit() {
return is64bit;
}

public static boolean isSupportedDirectLoad(@Nullable Context context, int appType)
throws IOException {
public static boolean isSupportedDirectLoad(@Nullable Context context, int appType) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
// Android starts to support directly loading from API 23.
// https://android.googlesource.com/platform/bionic/+/master/android-changes-for-ndk-developers.md#opening-shared-libraries-directly-from-an-apk
Expand Down

0 comments on commit 60586bb

Please sign in to comment.