File: use_system_framework.patch

package info (click to toggle)
apktool 2.7.0%2Bdfsg-7.1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 11,576 kB
  • sloc: java: 13,070; xml: 445; sh: 170; makefile: 14
file content (24 lines) | stat: -rw-r--r-- 939 bytes parent folder | download | duplicates (3)
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 {