Skip to content

Commit

Permalink
fix: support 10mb apktool.yml parsing (#3015)
Browse files Browse the repository at this point in the history
  • Loading branch information
iBotPeaches authored Mar 4, 2023
1 parent 1d60523 commit 9153a27
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package brut.androlib.meta;

import org.yaml.snakeyaml.DumperOptions;
import org.yaml.snakeyaml.LoaderOptions;
import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.introspector.PropertyUtils;

Expand All @@ -40,14 +41,17 @@ public class MetaInfo {
public Collection<String> doNotCompress;

private static Yaml getYaml() {
DumperOptions options = new DumperOptions();
options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
DumperOptions dumpOptions = new DumperOptions();
dumpOptions.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);

EscapedStringRepresenter representer = new EscapedStringRepresenter();
PropertyUtils propertyUtils = representer.getPropertyUtils();
propertyUtils.setSkipMissingProperties(true);

return new Yaml(new ClassSafeConstructor(), representer, options);
LoaderOptions loaderOptions = new LoaderOptions();
loaderOptions.setCodePointLimit(10 * 1024 * 1024); // 10mb

return new Yaml(new ClassSafeConstructor(), representer, dumpOptions, loaderOptions);
}

public void save(Writer output) {
Expand Down

0 comments on commit 9153a27

Please sign in to comment.