mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-04-28 12:17:57 +03:00
AssetManager: use AndroidManifest.xml to identify apks
resources.arsc may be missing in rare cases
This commit is contained in:
parent
58745f23ea
commit
060ea72f94
1 changed files with 2 additions and 2 deletions
|
@ -110,7 +110,7 @@ public final class AssetManager {
|
|||
Log.v(TAG, "New asset manager: " + this);
|
||||
// ensureSystemAssets()
|
||||
try {
|
||||
Enumeration<URL> resources = ClassLoader.getSystemClassLoader().getResources("resources.arsc");
|
||||
Enumeration<URL> resources = ClassLoader.getSystemClassLoader().getResources("AndroidManifest.xml");
|
||||
ArrayList<String> paths = new ArrayList<String>();
|
||||
paths.add(null); // reserve first slot for framework-res.apk
|
||||
while (resources.hasMoreElements()) {
|
||||
|
@ -123,7 +123,7 @@ public final class AssetManager {
|
|||
}
|
||||
for (String path : paths) {
|
||||
if (path != null) {
|
||||
path = path.substring(path.indexOf("file:") + 5, path.indexOf("!/resources.arsc"));
|
||||
path = path.substring(path.indexOf("file:") + 5, path.indexOf("!/AndroidManifest.xml"));
|
||||
addAssetPath(path);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue