21
21
import brut .androlib .res .data .ResConfigFlags ;
22
22
import brut .directory .DirectoryException ;
23
23
import brut .directory .FileDirectory ;
24
- import org .yaml .snakeyaml .DumperOptions ;
25
- import org .yaml .snakeyaml .LoaderOptions ;
26
- import org .yaml .snakeyaml .Yaml ;
27
- import org .yaml .snakeyaml .introspector .PropertyUtils ;
28
24
29
25
import java .io .*;
30
26
import java .util .ArrayList ;
@@ -54,26 +50,6 @@ public ApkInfo() {
54
50
this .version = ApktoolProperties .getVersion ();
55
51
}
56
52
57
- private static Yaml getYaml () {
58
- DumperOptions dumpOptions = new DumperOptions ();
59
- dumpOptions .setDefaultFlowStyle (DumperOptions .FlowStyle .BLOCK );
60
-
61
- EscapedStringRepresenter representer = new EscapedStringRepresenter ();
62
- PropertyUtils propertyUtils = representer .getPropertyUtils ();
63
- propertyUtils .setSkipMissingProperties (true );
64
-
65
- LoaderOptions loaderOptions = new LoaderOptions ();
66
- loaderOptions .setCodePointLimit (10 * 1024 * 1024 ); // 10mb
67
-
68
- return new Yaml (new ClassSafeConstructor (), representer , dumpOptions , loaderOptions );
69
- }
70
-
71
- public void save (Writer output ) {
72
- DumperOptions options = new DumperOptions ();
73
- options .setDefaultFlowStyle (DumperOptions .FlowStyle .BLOCK );
74
- getYaml ().dump (this , output );
75
- }
76
-
77
53
public String checkTargetSdkVersionBounds () {
78
54
int target = mapSdkShorthandToVersion (getTargetSdkVersion ());
79
55
@@ -157,16 +133,6 @@ private int mapSdkShorthandToVersion(String sdkVersion) {
157
133
}
158
134
}
159
135
160
- // public void save(File file) throws IOException {
161
- // try(
162
- // FileOutputStream fos = new FileOutputStream(file);
163
- // OutputStreamWriter outputStreamWriter = new OutputStreamWriter(fos, StandardCharsets.UTF_8);
164
- // Writer writer = new BufferedWriter(outputStreamWriter)
165
- // ) {
166
- // save(writer);
167
- // }
168
- // }
169
-
170
136
public void save (File file ) throws AndrolibException {
171
137
try (
172
138
YamlWriter writer = new YamlWriter (new FileOutputStream (file ));
@@ -187,17 +153,6 @@ public static ApkInfo load(InputStream is) throws AndrolibException {
187
153
return apkInfo ;
188
154
}
189
155
190
- // public static ApkInfo load(File appDir)
191
- // throws AndrolibException {
192
- // try(
193
- // InputStream in = new FileDirectory(appDir).getFileInput("apktool.yml")
194
- // ) {
195
- // return ApkInfo.load(in);
196
- // } catch (DirectoryException | IOException ex) {
197
- // throw new AndrolibException(ex);
198
- // }
199
- // }
200
-
201
156
public static ApkInfo load (File appDir )
202
157
throws AndrolibException {
203
158
try (
0 commit comments