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

Commit 090892fa authored by Jeff Hao's avatar Jeff Hao
Browse files

Prepend shared libraries in their original order.

This change fixes ordering issues for apks with multiple shared
libraries.

Bug: 26880306
Test: cts-tradefed run singleCommand cts -d --module
CtsAppSecurityHostTestCases -t
android.appsecurity.cts.IsolatedSplitsTests

Change-Id: Id0559603cde29fb8447b6ed683d8baca701f9d64
parent f86ddac9
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -448,10 +448,13 @@ public final class LoadedApk {
            }
        }

        // Prepend the shared libraries, maintaining their original order where possible.
        if (sharedLibraries != null) {
            int index = 0;
            for (String lib : sharedLibraries) {
                if (!outZipPaths.contains(lib)) {
                    outZipPaths.add(0, lib);
                    outZipPaths.add(index, lib);
                    index++;
                }
            }
        }