Skip to content

Commit

Permalink
remove dependencies from snakeyaml
Browse files Browse the repository at this point in the history
  • Loading branch information
sv99 authored and iBotPeaches committed Jul 22, 2023
1 parent 4368c31 commit 3644a26
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 149 deletions.
1 change: 0 additions & 1 deletion brut.apktool/apktool-cli/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ tasks.register('proguard', ProGuardTask) {
dontwarn 'javax.xml.xpath.**'
dontnote '**'
// between Java 1.8 and 1.9, the signature of `flip()` changed, which trips up proguard.
dontwarn 'org.yaml.snakeyaml.scanner.ScannerImpl'

def outPath = jar.getDestinationDirectory().getAsFile().get().toString()
def extension = jar.archiveExtension.get().toString()
Expand Down
1 change: 0 additions & 1 deletion brut.apktool/apktool-lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ dependencies {

implementation depends.baksmali
implementation depends.smali
implementation depends.snakeyaml
implementation depends.xmlpull
implementation depends.guava
implementation depends.commons_lang
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
import brut.androlib.res.data.ResConfigFlags;
import brut.directory.DirectoryException;
import brut.directory.FileDirectory;
import org.yaml.snakeyaml.DumperOptions;
import org.yaml.snakeyaml.LoaderOptions;
import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.introspector.PropertyUtils;

import java.io.*;
import java.util.ArrayList;
Expand Down Expand Up @@ -54,26 +50,6 @@ public ApkInfo() {
this.version = ApktoolProperties.getVersion();
}

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

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

LoaderOptions loaderOptions = new LoaderOptions();
loaderOptions.setCodePointLimit(10 * 1024 * 1024); // 10mb

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

public void save(Writer output) {
DumperOptions options = new DumperOptions();
options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
getYaml().dump(this, output);
}

public String checkTargetSdkVersionBounds() {
int target = mapSdkShorthandToVersion(getTargetSdkVersion());

Expand Down Expand Up @@ -157,16 +133,6 @@ private int mapSdkShorthandToVersion(String sdkVersion) {
}
}

// public void save(File file) throws IOException {
// try(
// FileOutputStream fos = new FileOutputStream(file);
// OutputStreamWriter outputStreamWriter = new OutputStreamWriter(fos, StandardCharsets.UTF_8);
// Writer writer = new BufferedWriter(outputStreamWriter)
// ) {
// save(writer);
// }
// }

public void save(File file) throws AndrolibException {
try (
YamlWriter writer = new YamlWriter(new FileOutputStream(file));
Expand All @@ -187,17 +153,6 @@ public static ApkInfo load(InputStream is) throws AndrolibException {
return apkInfo;
}

// public static ApkInfo load(File appDir)
// throws AndrolibException {
// try(
// InputStream in = new FileDirectory(appDir).getFileInput("apktool.yml")
// ) {
// return ApkInfo.load(in);
// } catch (DirectoryException | IOException ex) {
// throw new AndrolibException(ex);
// }
// }

public static ApkInfo load(File appDir)
throws AndrolibException {
try(
Expand Down

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ buildscript {
guava : 'com.google.guava:guava:32.0.1-jre',
junit : 'junit:junit:4.13.2',
proguard_gradle: 'com.guardsquare:proguard-gradle:7.3.2',
snakeyaml : 'org.yaml:snakeyaml:1.32:android',
smali : 'com.android.tools.smali:smali:3.0.3',
xmlpull : 'xpp3:xpp3:1.1.4c',
xmlunit : 'xmlunit:xmlunit:1.6',
Expand Down

0 comments on commit 3644a26

Please sign in to comment.