Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d82f7799 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Add additional checks for overriding ABI for apps"

parents 49752e30 b40ee543
Loading
Loading
Loading
Loading
+21 −10
Original line number Diff line number Diff line
@@ -499,17 +499,28 @@ static int findSupportedAbi(JNIEnv *env, jlong apkHandle, jobjectArray supported
            }
        }
    }
    int asset_status = NO_NATIVE_LIBRARIES;

    if(status <= 0) {
        // Scan the 'assets' folder only if
        // the abi (after scanning the lib folder)
        // is not already set to 32-bit (i.e '1' or '2').

        int asset_status = NO_NATIVE_LIBRARIES;
        int rc = initAssetsVerifierLib();

        if (rc == LIB_INITED_AND_SUCCESS) {
            asset_status = GetAssetsStatusFunc(zipFile, supportedAbis, numAbis);
        } else {
            ALOGE("Failed to load assets verifier: %d", rc);
        }
    if (asset_status == 1) {
        // override the status if asset_status hints at 32-bit abi
        status = 1;
        if(asset_status >= 0) {
            // Override the ABI only if
            // 'asset_status' is a valid ABI (64-bit or 32-bit).
            // This is to prevent cases where 'lib' folder
            // has native libraries, but
            // 'assets' folder has none.
            status = asset_status;
        }
    }

    for (int i = 0; i < numAbis; ++i) {