diff --git a/brut.apktool/apktool-lib/src/main/java/brut/androlib/apk/ApkInfo.java b/brut.apktool/apktool-lib/src/main/java/brut/androlib/apk/ApkInfo.java index 0d674ab0..0f1b82d0 100644 --- a/brut.apktool/apktool-lib/src/main/java/brut/androlib/apk/ApkInfo.java +++ b/brut.apktool/apktool-lib/src/main/java/brut/androlib/apk/ApkInfo.java @@ -146,15 +146,13 @@ public class ApkInfo implements YamlSerializable { } public static ApkInfo load(InputStream is) throws AndrolibException { - // return getYaml().loadAs(is, ApkInfo.class); YamlReader reader = new YamlReader(is); ApkInfo apkInfo = new ApkInfo(); reader.readRoot(apkInfo); return apkInfo; } - public static ApkInfo load(File appDir) - throws AndrolibException { + public static ApkInfo load(File appDir) throws AndrolibException { try( InputStream in = new FileDirectory(appDir).getFileInput("apktool.yml"); ) { diff --git a/brut.apktool/apktool-lib/src/main/java/brut/androlib/apk/PackageInfo.java b/brut.apktool/apktool-lib/src/main/java/brut/androlib/apk/PackageInfo.java index 3ba489a8..52fb3979 100644 --- a/brut.apktool/apktool-lib/src/main/java/brut/androlib/apk/PackageInfo.java +++ b/brut.apktool/apktool-lib/src/main/java/brut/androlib/apk/PackageInfo.java @@ -16,14 +16,12 @@ */ package brut.androlib.apk; -import brut.androlib.exceptions.AndrolibException; - public class PackageInfo implements YamlSerializable { public String forcedPackageId; public String renameManifestPackage; @Override - public void readItem(YamlReader reader) throws AndrolibException { + public void readItem(YamlReader reader) { YamlLine line = reader.getLine(); switch (line.getKey()) { case "forcedPackageId": { @@ -42,5 +40,4 @@ public class PackageInfo implements YamlSerializable { writer.writeString("forcedPackageId", forcedPackageId); writer.writeString("renameManifestPackage", renameManifestPackage); } - } diff --git a/brut.apktool/apktool-lib/src/main/java/brut/androlib/apk/VersionInfo.java b/brut.apktool/apktool-lib/src/main/java/brut/androlib/apk/VersionInfo.java index 54b6319e..c3ac06c2 100644 --- a/brut.apktool/apktool-lib/src/main/java/brut/androlib/apk/VersionInfo.java +++ b/brut.apktool/apktool-lib/src/main/java/brut/androlib/apk/VersionInfo.java @@ -16,14 +16,12 @@ */ package brut.androlib.apk; -import brut.androlib.exceptions.AndrolibException; - public class VersionInfo implements YamlSerializable { public String versionCode; public String versionName; @Override - public void readItem(YamlReader reader) throws AndrolibException { + public void readItem(YamlReader reader) { YamlLine line = reader.getLine(); switch (line.getKey()) { case "versionCode": { diff --git a/brut.apktool/apktool-lib/src/main/java/brut/androlib/apk/YamlLine.java b/brut.apktool/apktool-lib/src/main/java/brut/androlib/apk/YamlLine.java index f31dd62a..50091f6a 100644 --- a/brut.apktool/apktool-lib/src/main/java/brut/androlib/apk/YamlLine.java +++ b/brut.apktool/apktool-lib/src/main/java/brut/androlib/apk/YamlLine.java @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2010 Ryszard Wiśniewski + * Copyright (C) 2010 Connor Tumbleson + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package brut.androlib.apk; import java.util.Objects; diff --git a/brut.apktool/apktool-lib/src/main/java/brut/androlib/apk/YamlReader.java b/brut.apktool/apktool-lib/src/main/java/brut/androlib/apk/YamlReader.java index a75bd8ef..33024c6e 100644 --- a/brut.apktool/apktool-lib/src/main/java/brut/androlib/apk/YamlReader.java +++ b/brut.apktool/apktool-lib/src/main/java/brut/androlib/apk/YamlReader.java @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2010 Ryszard Wiśniewski + * Copyright (C) 2010 Connor Tumbleson + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package brut.androlib.apk; import brut.androlib.exceptions.AndrolibException; diff --git a/brut.apktool/apktool-lib/src/main/java/brut/androlib/apk/YamlSerializable.java b/brut.apktool/apktool-lib/src/main/java/brut/androlib/apk/YamlSerializable.java index 2ff10760..f477bba5 100644 --- a/brut.apktool/apktool-lib/src/main/java/brut/androlib/apk/YamlSerializable.java +++ b/brut.apktool/apktool-lib/src/main/java/brut/androlib/apk/YamlSerializable.java @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2010 Ryszard Wiśniewski + * Copyright (C) 2010 Connor Tumbleson + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package brut.androlib.apk; import brut.androlib.exceptions.AndrolibException; diff --git a/brut.apktool/apktool-lib/src/main/java/brut/androlib/apk/YamlStringEscapeUtils.java b/brut.apktool/apktool-lib/src/main/java/brut/androlib/apk/YamlStringEscapeUtils.java index 0b338807..574409c3 100644 --- a/brut.apktool/apktool-lib/src/main/java/brut/androlib/apk/YamlStringEscapeUtils.java +++ b/brut.apktool/apktool-lib/src/main/java/brut/androlib/apk/YamlStringEscapeUtils.java @@ -26,22 +26,20 @@ import java.io.Writer; public class YamlStringEscapeUtils { public static String escapeString(String str) { - return escapeJavaStyleString(str, false, false); + return escapeJavaStyleString(str); } /** * @param str String to escape values in, may be null - * @param escapeSingleQuotes escapes single quotes if true - * @param escapeForwardSlash TODO * @return the escaped string */ - private static String escapeJavaStyleString(String str, boolean escapeSingleQuotes, boolean escapeForwardSlash) { + private static String escapeJavaStyleString(String str) { if (str == null) { return null; } try { StringWriter writer = new StringWriter(str.length() * 2); - escapeJavaStyleString(writer, str, escapeSingleQuotes, escapeForwardSlash); + escapeJavaStyleString(writer, str); return writer.toString(); } catch (IOException ioe) { // this should never ever happen while writing to a StringWriter @@ -50,14 +48,11 @@ public class YamlStringEscapeUtils { } /** - * @param out write to receieve the escaped string + * @param out write to receive the escaped string * @param str String to escape values in, may be null - * @param escapeSingleQuote escapes single quotes if true - * @param escapeForwardSlash TODO * @throws IOException if an IOException occurs */ - private static void escapeJavaStyleString(Writer out, String str, boolean escapeSingleQuote, - boolean escapeForwardSlash) throws IOException { + private static void escapeJavaStyleString(Writer out, String str) throws IOException { if (out == null) { throw new IllegalArgumentException("The Writer must not be null"); } @@ -101,7 +96,7 @@ public class YamlStringEscapeUtils { } else { switch (ch) { case '\'' : - if (escapeSingleQuote) { + if (false) { out.write('\\'); } out.write('\''); @@ -115,7 +110,7 @@ public class YamlStringEscapeUtils { out.write('\\'); break; case '/' : - if (escapeForwardSlash) { + if (false) { out.write('\\'); } out.write('/'); diff --git a/brut.apktool/apktool-lib/src/main/java/brut/androlib/apk/YamlWriter.java b/brut.apktool/apktool-lib/src/main/java/brut/androlib/apk/YamlWriter.java index 6750212b..902b96e8 100644 --- a/brut.apktool/apktool-lib/src/main/java/brut/androlib/apk/YamlWriter.java +++ b/brut.apktool/apktool-lib/src/main/java/brut/androlib/apk/YamlWriter.java @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2010 Ryszard Wiśniewski + * Copyright (C) 2010 Connor Tumbleson + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package brut.androlib.apk; import java.io.*; diff --git a/brut.apktool/apktool-lib/src/test/java/brut/androlib/apk/ApkInfoReaderTest.java b/brut.apktool/apktool-lib/src/test/java/brut/androlib/apk/ApkInfoReaderTest.java index 419b7a3d..ff2c9ad9 100644 --- a/brut.apktool/apktool-lib/src/test/java/brut/androlib/apk/ApkInfoReaderTest.java +++ b/brut.apktool/apktool-lib/src/test/java/brut/androlib/apk/ApkInfoReaderTest.java @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2010 Ryszard Wiśniewski + * Copyright (C) 2010 Connor Tumbleson + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package brut.androlib.apk; import brut.androlib.exceptions.AndrolibException; diff --git a/brut.apktool/apktool-lib/src/test/java/brut/androlib/apk/DoNotCompressHieroglyphTest.java b/brut.apktool/apktool-lib/src/test/java/brut/androlib/apk/DoNotCompressHieroglyphTest.java index ff116eaf..18251394 100644 --- a/brut.apktool/apktool-lib/src/test/java/brut/androlib/apk/DoNotCompressHieroglyphTest.java +++ b/brut.apktool/apktool-lib/src/test/java/brut/androlib/apk/DoNotCompressHieroglyphTest.java @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2010 Ryszard Wiśniewski + * Copyright (C) 2010 Connor Tumbleson + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package brut.androlib.apk; import brut.androlib.exceptions.AndrolibException; diff --git a/brut.apktool/apktool-lib/src/test/java/brut/androlib/apk/YamlLineTest.java b/brut.apktool/apktool-lib/src/test/java/brut/androlib/apk/YamlLineTest.java index 1e261a17..c4b3d79d 100644 --- a/brut.apktool/apktool-lib/src/test/java/brut/androlib/apk/YamlLineTest.java +++ b/brut.apktool/apktool-lib/src/test/java/brut/androlib/apk/YamlLineTest.java @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2010 Ryszard Wiśniewski + * Copyright (C) 2010 Connor Tumbleson + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package brut.androlib.apk; import org.junit.Test;