1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
From: Markus Koschany <apo@debian.org>
Date: Sun, 8 Apr 2018 22:34:03 +0200
Subject: use_system_framework
Rather than including a package provided apk in the jar,
just read it directly from where it gets installed.
---
--- a/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/AndrolibResources.java
+++ b/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/AndrolibResources.java
@@ -1025,7 +1025,13 @@
}
public InputStream getAndroidFrameworkResourcesAsStream() {
- return Jar.class.getResourceAsStream("/brut/androlib/android-framework.jar");
+ String resourcePath = "/usr/share/android-framework-res/framework-res.apk";
+ try {
+ return new FileInputStream(resourcePath);
+ } catch (IOException ex) {
+ System.out.println("Could not extract resource: " + resourcePath);
+ return null;
+ }
}
public void close() throws IOException {
|