File: use_system_framework.patch

package info (click to toggle)
apktool 2.3.4-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 8,496 kB
  • sloc: java: 11,932; xml: 372; sh: 201; makefile: 31
file content (38 lines) | stat: -rw-r--r-- 1,746 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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.
---
 .../src/main/java/brut/androlib/res/AndrolibResources.java     | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git 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
index b8ceeec..7a90e02 100644
--- 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
@@ -767,7 +767,7 @@ final public class AndrolibResources {
         }
 
         if (id == 1) {
-            try (InputStream in = AndrolibResources.class.getResourceAsStream("/brut/androlib/android-framework.jar");
+            try (InputStream in = new FileInputStream("/usr/share/android-framework-res/framework-res.apk");
                  OutputStream out = new FileOutputStream(apk)) {
                 IOUtils.copy(in, out);
                 return apk;
@@ -968,12 +968,8 @@ final public class AndrolibResources {
         return apkOptions.isAapt2() ? 2 : 1;
     }
 
-    public File getAndroidResourcesFile() throws AndrolibException {
-        try {
-            return Jar.getResourceAsFile("/brut/androlib/android-framework.jar");
-        } catch (BrutException ex) {
-            throw new AndrolibException(ex);
-        }
+    public File getAndroidResourcesFile() {
+        return new File("/usr/share/android-framework-res/framework-res.apk");
     }
 
     public void close() throws IOException {