aapt2: copy "BuildAndDecodeTest" to aapt2 for temporary testing

This commit is contained in:
Connor Tumbleson 2018-02-15 18:02:31 -05:00
parent ac1402aa7e
commit f57c73d421
95 changed files with 1126 additions and 0 deletions

View File

@ -0,0 +1,640 @@
/**
* Copyright (C) 2017 Ryszard Wiśniewski <brut.alll@gmail.com>
* Copyright (C) 2017 Connor Tumbleson <connor.tumbleson@gmail.com>
*
* 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
*
* http://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.aapt2;
import brut.androlib.Androlib;
import brut.androlib.ApkDecoder;
import brut.androlib.ApkOptions;
import brut.androlib.TestUtils;
import brut.androlib.meta.MetaInfo;
import brut.common.BrutException;
import brut.directory.ExtFile;
import brut.directory.FileDirectory;
import brut.util.OS;
import brut.util.OSDetection;
import org.custommonkey.xmlunit.DetailedDiff;
import org.custommonkey.xmlunit.Diff;
import org.custommonkey.xmlunit.ElementNameAndAttributeQualifier;
import org.custommonkey.xmlunit.ElementQualifier;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.xml.sax.SAXException;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;
import java.util.Map;
import java.util.Set;
import java.util.logging.Logger;
import static org.junit.Assert.*;
import static org.junit.Assume.assumeTrue;
/**
* @author Ryszard Wiśniewski <brut.alll@gmail.com>
*/
public class BuildAndDecodeTest {
@BeforeClass
public static void beforeClass() throws Exception {
TestUtils.cleanFrameworkFile();
sTmpDir = new ExtFile(OS.createTempDirectory());
sTestOrigDir = new ExtFile(sTmpDir, "testapp-orig");
sTestNewDir = new ExtFile(sTmpDir, "testapp-new");
LOGGER.info("Unpacking testapp...");
TestUtils.copyResourceDir(BuildAndDecodeTest.class, "brut/apktool/aapt2/testapp/", sTestOrigDir);
ApkOptions apkOptions = new ApkOptions();
apkOptions.useAapt2 = true;
apkOptions.verbose = true;
LOGGER.info("Building testapp.apk...");
File testApk = new File(sTmpDir, "testapp.apk");
new Androlib(apkOptions).build(sTestOrigDir, testApk);
LOGGER.info("Decoding testapp.apk...");
ApkDecoder apkDecoder = new ApkDecoder(testApk);
apkDecoder.setOutDir(sTestNewDir);
apkDecoder.decode();
}
@AfterClass
public static void afterClass() throws BrutException {
OS.rmdir(sTmpDir);
}
@Test
public void buildAndDecodeTest() throws BrutException {
assertTrue(sTestNewDir.isDirectory());
}
@Test
public void manifestTaggingNotSupressed() throws BrutException {
compareXmlFiles("AndroidManifest.xml");
}
@Test
public void valuesAnimsTest() throws BrutException {
compareValuesFiles("values-mcc001/anims.xml");
}
@Test
public void valuesArraysTest() throws BrutException {
compareValuesFiles("values-mcc001/arrays.xml");
}
@Test
public void valuesArraysCastingTest() throws BrutException {
compareValuesFiles("values-mcc002/arrays.xml");
compareValuesFiles("values-mcc003/arrays.xml");
}
@Test
public void valuesAttrsTest() throws BrutException {
compareValuesFiles("values/attrs.xml");
}
@Test
public void valuesBoolsTest() throws BrutException {
compareValuesFiles("values-mcc001/bools.xml");
}
@Test
public void valuesColorsTest() throws BrutException {
compareValuesFiles("values-mcc001/colors.xml");
}
@Test
public void bug702Test() throws BrutException {
compareValuesFiles("values-mcc001-mnc00/strings.xml");
}
@Test
public void valuesDimensTest() throws BrutException {
compareValuesFiles("values-mcc001/dimens.xml");
}
@Test
public void valuesDrawablesTest() throws BrutException {
compareValuesFiles("values-mcc001/drawables.xml");
}
@Test
public void valuesIdsTest() throws BrutException {
compareValuesFiles("values-mcc001/ids.xml");
}
@Test
public void valuesIntegersTest() throws BrutException {
compareValuesFiles("values-mcc001/integers.xml");
}
@Test
public void valuesLayoutsTest() throws BrutException {
compareValuesFiles("values-mcc001/layouts.xml");
}
@Test
public void xmlPluralsTest() throws BrutException {
compareValuesFiles("values-mcc001/plurals.xml");
}
@Test
public void valuesStringsTest() throws BrutException {
compareValuesFiles("values-mcc001/strings.xml");
}
@Test
public void valuesStylesTest() throws BrutException {
compareValuesFiles("values-mcc001/styles.xml");
}
@Test
public void valuesReferencesTest() throws BrutException {
compareValuesFiles("values-mcc002/strings.xml");
}
@Test
public void valuesExtraLongTest() throws BrutException {
compareValuesFiles("values-en/strings.xml");
}
@Test
public void valuesExtraLongExactLengthTest() throws BrutException {
Map<String, String> strs = TestUtils.parseStringsXml(new File(sTestNewDir, "res/values-en/strings.xml"));
// long_string6 should be exactly 0x8888 chars of "a"
// the valuesExtraLongTest() should handle this
// but such an edge case, want a specific test
String aaaa = strs.get("long_string6");
assertEquals(0x8888, aaaa.length());
}
@Test
public void crossTypeTest() throws BrutException {
compareValuesFiles("values-mcc003/strings.xml");
compareValuesFiles("values-mcc003/integers.xml");
compareValuesFiles("values-mcc003/bools.xml");
}
@Test
public void xmlLiteralsTest() throws BrutException {
compareXmlFiles("res/xml/literals.xml");
}
@Test
public void xmlReferencesTest() throws BrutException {
compareXmlFiles("res/xml/references.xml");
}
@Test
public void xmlReferenceAttributeTest() throws BrutException {
compareXmlFiles("res/layout/issue1040.xml");
}
@Test
public void xmlCustomAttributeTest() throws BrutException {
compareXmlFiles("res/layout/issue1063.xml");
}
@Test
public void xmlSmallNumbersDontEscapeTest() throws BrutException {
compareXmlFiles("res/layout/issue1130.xml");
}
@Test
public void xmlUniformAutoTextTest() throws BrutException {
compareXmlFiles("res/layout/issue1674.xml");
}
@Test(expected = AssertionError.class)
public void xmlFillParentBecomesMatchTest() throws BrutException {
compareXmlFiles("res/layout/issue1274.xml");
}
@Test
public void xmlCustomAttrsNotAndroidTest() throws BrutException {
compareXmlFiles("res/layout/issue1157.xml");
}
@Test
public void qualifiersTest() throws BrutException {
compareValuesFiles("values-mcc004-mnc4-en-rUS-ldrtl-sw100dp-w200dp-h300dp"
+ "-xlarge-long-round-highdr-land-desk-night-xhdpi-finger-keyssoft-12key"
+ "-navhidden-dpad-v26/strings.xml");
}
@Test
public void shortendedMncTest() throws BrutException {
compareValuesFiles("values-mcc001-mnc1/strings.xml");
}
@Test
public void shortMncHtcTest() throws BrutException {
compareValuesFiles("values-mnc1/strings.xml");
}
@Test
public void shortMncv2Test() throws BrutException {
compareValuesFiles("values-mcc238-mnc6/strings.xml");
}
@Test
public void longMncTest() throws BrutException {
compareValuesFiles("values-mcc238-mnc870/strings.xml");
}
@Test
public void anyDpiTest() throws BrutException, IOException {
compareValuesFiles("values-watch/strings.xml");
}
@Test
public void packed3CharsTest() throws BrutException, IOException {
compareValuesFiles("values-ast-rES/strings.xml");
}
@Test
public void rightToLeftTest() throws BrutException, IOException {
compareValuesFiles("values-ldrtl/strings.xml");
}
@Test
public void scriptBcp47Test() throws BrutException, IOException {
compareValuesFiles("values-b+en+Latn+US/strings.xml");
}
@Test
public void threeLetterLangBcp47Test() throws BrutException, IOException {
compareValuesFiles("values-ast/strings.xml");
}
@Test
public void androidOStringTest() throws BrutException, IOException {
compareValuesFiles("values-ast/strings.xml");
}
@Test
public void twoLetterNotHandledAsBcpTest() throws BrutException, IOException {
checkFolderExists("res/values-fr");
}
@Test
public void twoLetterLangBcp47Test() throws BrutException, IOException {
compareValuesFiles("values-en-rUS/strings.xml");
}
@Test
public void variantBcp47Test() throws BrutException, IOException {
compareValuesFiles("values-b+en+US+POSIX/strings.xml");
}
@Test
public void fourpartBcp47Test() throws BrutException, IOException {
compareValuesFiles("values-b+ast+Latn+IT+AREVELA/strings.xml");
}
@Test
public void RegionLocaleBcp47Test() throws BrutException, IOException {
compareValuesFiles("values-b+en+Latn+419/strings.xml");
}
@Test
public void numericalRegionBcp47Test() throws BrutException, IOException {
compareValuesFiles("values-b+eng+419/strings.xml");
}
@Test
public void api23ConfigurationsTest() throws BrutException, IOException {
compareValuesFiles("values-round/strings.xml");
compareValuesFiles("values-notround/strings.xml");
}
@Test
public void api26ConfigurationsTest() throws BrutException, IOException {
compareValuesFiles("values-widecg-v26/strings.xml");
compareValuesFiles("values-lowdr-v26/strings.xml");
compareValuesFiles("values-nowidecg-v26/strings.xml");
compareValuesFiles("values-vrheadset-v26/strings.xml");
}
@Test
public void fontTest() throws BrutException, IOException {
File fontXml = new File((sTestNewDir + "/res/font"), "lobster.xml");
File fontFile = new File((sTestNewDir + "/res/font"), "lobster_regular.otf");
// Per #1662, ensure font file is not encoded.
assertTrue(fontXml.isFile());
compareXmlFiles("/res/font/lobster.xml");
// If we properly skipped decoding the font (otf) file, this file should not exist
assertFalse((new File((sTestNewDir + "/res/values"), "fonts.xml")).isFile());
assertTrue(fontFile.isFile());
}
@Test
public void drawableNoDpiTest() throws BrutException, IOException {
compareResFolder("drawable-nodpi");
}
@Test
public void drawableAnyDpiTest() throws BrutException, IOException {
compareResFolder("drawable-anydpi");
}
@Test
public void drawableNumberedDpiTest() throws BrutException, IOException {
compareResFolder("drawable-534dpi");
}
@Test
public void drawableLdpiTest() throws BrutException, IOException {
compareResFolder("drawable-ldpi");
}
@Test
public void drawableMdpiTest() throws BrutException, IOException {
compareResFolder("drawable-mdpi");
}
@Test
public void drawableTvdpiTest() throws BrutException, IOException {
compareResFolder("drawable-tvdpi");
}
@Test
public void drawableXhdpiTest() throws BrutException, IOException {
compareResFolder("drawable-xhdpi");
}
@Test
public void ninePatchImageColorTest() throws BrutException, IOException {
char slash = File.separatorChar;
String location = slash + "res" + slash + "drawable-xhdpi" + slash;
File control = new File((sTestOrigDir + location), "9patch.9.png");
File test = new File((sTestNewDir + location), "9patch.9.png");
BufferedImage controlImage = ImageIO.read(control);
BufferedImage testImage = ImageIO.read(test);
// lets start with 0,0 - empty
assertEquals(controlImage.getRGB(0, 0), testImage.getRGB(0, 0));
// then with 30, 0 - black
assertEquals(controlImage.getRGB(30, 0), testImage.getRGB(30, 0));
// then 30, 30 - blue
assertEquals(controlImage.getRGB(30, 30), testImage.getRGB(30, 30));
}
@Test
public void issue1508Test() throws BrutException, IOException {
char slash = File.separatorChar;
String location = slash + "res" + slash + "drawable-xhdpi" + slash;
File control = new File((sTestOrigDir + location), "btn_zoom_up_normal.9.png");
File test = new File((sTestNewDir + location), "btn_zoom_up_normal.9.png");
BufferedImage controlImage = ImageIO.read(control);
BufferedImage testImage = ImageIO.read(test);
// 0, 0 = clear
assertEquals(controlImage.getRGB(0, 0), testImage.getRGB(0, 0));
// 30, 0 = black line
assertEquals(controlImage.getRGB(0, 30), testImage.getRGB(0, 30));
// 30, 30 = greyish button
assertEquals(controlImage.getRGB(30, 30), testImage.getRGB(30, 30));
}
@Test
public void issue1511Test() throws BrutException, IOException {
char slash = File.separatorChar;
String location = slash + "res" + slash + "drawable-xxhdpi" + slash;
File control = new File((sTestOrigDir + location), "textfield_activated_holo_dark.9.png");
File test = new File((sTestNewDir + location), "textfield_activated_holo_dark.9.png");
BufferedImage controlImage = ImageIO.read(control);
BufferedImage testImage = ImageIO.read(test);
// Check entire image as we cannot mess this up
final int w = controlImage.getWidth(),
h = controlImage.getHeight();
final int[] controlImageGrid = controlImage.getRGB(0, 0, w, h, null, 0, w);
final int[] testImageGrid = testImage.getRGB(0, 0, w, h, null, 0, w);
for (int i = 0; i < controlImageGrid.length; i++) {
assertEquals("Image lost Optical Bounds at i = " + i, controlImageGrid[i], testImageGrid[i]);
}
}
@Test
public void robust9patchTest() throws BrutException, IOException {
String[] ninePatches = {"ic_notification_overlay.9.png", "status_background.9.png",
"search_bg_transparent.9.png", "screenshot_panel.9.png", "recents_lower_gradient.9.png"};
char slash = File.separatorChar;
String location = slash + "res" + slash + "drawable-xxhdpi" + slash;
for (String ninePatch : ninePatches) {
File control = new File((sTestOrigDir + location), ninePatch);
File test = new File((sTestNewDir + location), ninePatch);
BufferedImage controlImage = ImageIO.read(control);
BufferedImage testImage = ImageIO.read(test);
int w = controlImage.getWidth(), h = controlImage.getHeight();
// Check the entire horizontal line
for (int i = 1; i < w; i++) {
if (isTransparent(controlImage.getRGB(i, 0))) {
assertTrue(isTransparent(testImage.getRGB(i, 0)));
} else {
assertEquals("Image lost npTc chunk on image " + ninePatch + " at (x, y) (" + i + "," + 0 + ")",
controlImage.getRGB(i, 0), testImage.getRGB(i, 0));
}
}
// Check the entire vertical line
for (int i = 1; i < h; i++) {
if (isTransparent(controlImage.getRGB(0, i))) {
assertTrue(isTransparent(testImage.getRGB(0, i)));
} else {
assertEquals("Image lost npTc chunk on image " + ninePatch + " at (x, y) (" + 0 + "," + i + ")",
controlImage.getRGB(0, i), testImage.getRGB(0, i));
}
}
}
}
@Test
public void drawableXxhdpiTest() throws BrutException, IOException {
compareResFolder("drawable-xxhdpi");
}
@Test
public void drawableXxxhdpiTest() throws BrutException, IOException {
compareResFolder("drawable-xxxhdpi");
}
@Test
public void resRawTest() throws BrutException, IOException {
compareResFolder("raw");
}
@Test
public void libsTest() throws BrutException, IOException {
compareLibsFolder("libs");
}
@Test
public void unknownFolderTest() throws BrutException, IOException {
compareUnknownFiles();
}
@Test
public void fileAssetTest() throws BrutException, IOException {
compareAssetsFolder("txt");
}
@Test
public void unicodeAssetTest() throws BrutException, IOException {
assumeTrue(! OSDetection.isWindows());
compareAssetsFolder("unicode-txt");
}
@Test
public void multipleDexTest() throws BrutException, IOException {
compareBinaryFolder("/smali_classes2", false);
}
@Test
public void singleDexTest() throws BrutException, IOException {
compareBinaryFolder("/smali", false);
}
@Test
public void confirmKotlinFolderPersistsTest() throws BrutException, IOException {
checkFolderExists("/kotlin");
}
@SuppressWarnings("unchecked")
private void compareUnknownFiles() throws BrutException, IOException {
MetaInfo control = new Androlib().readMetaFile(sTestOrigDir);
MetaInfo test = new Androlib().readMetaFile(sTestNewDir);
assertNotNull(control.unknownFiles);
assertNotNull(test.unknownFiles);
Map<String, String> control_files = control.unknownFiles;
Map<String, String> test_files = test.unknownFiles;
assertTrue(control_files.size() == test_files.size());
// Make sure that the compression methods are still the same
for (Map.Entry<String, String> controlEntry : control_files.entrySet()) {
assertTrue(controlEntry.getValue().equals(test_files.get(controlEntry.getKey())));
}
}
private void compareBinaryFolder(String path, boolean res) throws BrutException, IOException {
Boolean exists = true;
String tmp = "";
if (res) {
tmp = File.separatorChar + "res" + File.separatorChar;
}
String location = tmp + path;
FileDirectory fileDirectory = new FileDirectory(sTestOrigDir, location);
Set<String> files = fileDirectory.getFiles(true);
for (String filename : files) {
File control = new File((sTestOrigDir + location), filename);
File test = new File((sTestNewDir + location), filename);
if (! test.isFile() || ! control.isFile()) {
exists = false;
}
}
assertTrue(exists);
}
private void compareResFolder(String path) throws BrutException, IOException {
compareBinaryFolder(path, true);
}
private void compareLibsFolder(String path) throws BrutException, IOException {
compareBinaryFolder(File.separatorChar + path, false);
}
private void compareAssetsFolder(String path) throws BrutException, IOException {
compareBinaryFolder(File.separatorChar + "assets" + File.separatorChar + path, false);
}
private void compareValuesFiles(String path) throws BrutException {
compareXmlFiles("res/" + path, new ElementNameAndAttributeQualifier("name"));
}
private void compareXmlFiles(String path) throws BrutException {
compareXmlFiles(path, null);
}
private void checkFolderExists(String path) throws BrutException {
File f = new File(sTestNewDir, path);
assertTrue(f.isDirectory());
}
private boolean isTransparent(int pixel) {
return pixel >> 24 == 0x00;
}
private void compareXmlFiles(String path, ElementQualifier qualifier) throws BrutException {
DetailedDiff diff;
try {
Reader control = new FileReader(new File(sTestOrigDir, path));
Reader test = new FileReader(new File(sTestNewDir, path));
diff = new DetailedDiff(new Diff(control, test));
} catch (SAXException | IOException ex) {
throw new BrutException(ex);
}
if (qualifier != null) {
diff.overrideElementQualifier(qualifier);
}
assertTrue(path + ": " + diff.getAllDifferences().toString(), diff.similar());
}
private static ExtFile sTmpDir;
private static ExtFile sTestOrigDir;
private static ExtFile sTestNewDir;
private final static Logger LOGGER = Logger.getLogger(BuildAndDecodeTest.class.getName());
}

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="brut.apktool.testapp" platformBuildVersionCode="23" platformBuildVersionName="6.0-2438415">
<uses-feature android:glEsVersion="0x00020000" />
<uses-feature android:glEsVersion="0x00030002" />
</manifest>

View File

@ -0,0 +1,18 @@
version: 2.0.0
apkFileName: testapp.apk
isFrameworkApk: false
usesFramework:
ids:
- 1
packageInfo:
forced-package-id: '127'
versionInfo:
versionCode: '1'
versionName: '1.0'
compressionType: false
unknownFiles:
hidden.file: '8'
non\u007Fprintable.file: '8'
stored.file: '0'
unk_folder/unknown_file: '8'
lib_bug603/bug603: '8'

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<font-family xmlns:android="http://schemas.android.com/apk/res/android">
<font
android:fontStyle="normal"
android:fontWeight="400"
android:font="@font/lobster_regular" />
</font-family>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView
xmlns:android="http://schemas.android.com/apk/res/android"
android:gravity="@integer/reference_test"
/>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:custom="http://schemas.android.com/apk/res-auto">
<TextView custom:test_attr11="TEST_ONE" />
<TextView custom:test_attr11="TEST_ZERO" />
</LinearLayout>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android">
<TableLayout android:shrinkColumns="1" />
<TableLayout android:shrinkColumns="\ 2147483647" />
<TableLayout android:shrinkColumns="\ 2147483648" />
<TableLayout android:shrinkColumns="\ 555555555555555555" />
</LinearLayout>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen android:title="test" app:min_value="0.2" app:max_value="5.0" app:default_value="1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res/brut.apktool.testapp" />

View File

@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent">
</LinearLayout>

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android" android:autoSizeTextType="uniform" />

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@ -0,0 +1 @@
This file has no extension.

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="test1">"Forgot your username or password?\nVisit google.com/accounts/recovery."</string>
<string name="test2">Forgot your username or password?\n.Visit google.com/accounts/recovery</string>
<string name="test3"> (string8) "Forgot your username or password?\nVisit google.com/accounts/recovery."</string>
<string name="test4">Forgot your username or password?\nVisit google.com/accounts/recovery.</string>
<string name="test5">Forgot your username or password?
Visit google.com/accounts/recovery.</string>
</resources>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="test1">test1</string>
</resources>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="test1">test1</string>
</resources>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="test1">test1</string>
</resources>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="test1">test1</string>
</resources>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="test1">test1</string>
</resources>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="test1">test1</string>
</resources>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="test1">test1</string>
</resources>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="test1">test1</string>
</resources>

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="test_formatting1"><a href="http://www.foo.com" style="text-decoration:none;">http://www.foo.com</a></string>
<string name="test_formatting2"><a href="http://www.foo.com" style="text-decoration:none">http://www.foo.com</a></string>
</resources>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="test1">test1</string>
</resources>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="hello_world">Hello World</string>
</resources>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="test1">test1</string>
</resources>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="test1">test1</string>
</resources>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<item name="test_anims1" type="anim">@android:anim/bounce_interpolator</item>
<item name="test_anims2" type="anim">@android:anim/cycle_interpolator</item>
<item name="test_anims3" type="anim">@android:anim/decelerate_interpolator</item>
<item name="test_anims4" type="anim">@android:anim/fade_in</item>
<item name="test_anims5" type="anim">@android:anim/fade_out</item>
<item name="test_anims6" type="anim">@android:anim/linear_interpolator</item>
<item name="test_anims7" type="anim">@android:anim/overshoot_interpolator</item>
<item name="test_anims8" type="anim">@android:anim/slide_in_left</item>
<item name="test_anims9" type="anim">@android:anim/slide_out_right</item>
</resources>

View File

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="test_array1">
<item>TEST1</item>
<item>TEST2</item>
<item>TEST3</item>
<item>%2$s foo %1$d</item>
<item>http://google.com&amp;boo=1&amp;foo=2</item>
<item>&lt;b>Bolded Text&lt;/b></item>
<item>&lt;font size=16 align=middle>Small&lt;/font></item>
</string-array>
<integer-array name="test_array2">
<item>-1</item>
<item>0</item>
<item>1</item>
</integer-array>
<array name="test_array3">
<item></item>
<item>true</item>
<item>TEST</item>
<item>5</item>
<item>5.5</item>
<item>10.0sp</item>
<item>#ff123456</item>
</array>
<string-array name="issue_409">
<item>@string/test1</item>
<item>foo</item>
<item>foo2</item>
</string-array>
<string-array name="issue_677" formatted="false">
<item>category=temp%temp%foo</item>
</string-array>
<string-array name="issue_329">
<item>res/</item>
<item>view/</item>
</string-array>
</resources>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<bool name="test_bool1">false</bool>
<bool name="test_bool2">true</bool>
</resources>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="test_color1">#ff123456</color>
<color name="test_color2">@android:color/white</color>
<color name="test_color3">#00000000</color>
</resources>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="test_dimen1">10.0dip</dimen>
<dimen name="test_dimen2">10.0sp</dimen>
<dimen name="test_dimen3">10.0pt</dimen>
<dimen name="test_dimen4">10.0px</dimen>
<dimen name="test_dimen5">10.0mm</dimen>
<dimen name="test_dimen6">10.0in</dimen>
</resources>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<item name="test_drawable1" type="drawable">@android:drawable/btn_default</item>
<item name="test_drawable2" type="drawable">#00000000</item>
</resources>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<item type="id" name="test_id1" />
<item type="id" name="test_id2" />
</resources>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<integer name="test_integer1">-1</integer>
<integer name="test_integer2">0</integer>
<integer name="test_integer3">1</integer>
</resources>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<item name="test_layouts1" type="layout">@android:layout/activity_list_item</item>
<item name="test_layouts2" type="layout">@android:layout/browser_link_context_header</item>
<item name="test_layouts3" type="layout">@android:layout/simple_list_item_1</item>
<item name="test_layouts4" type="layout">@android:layout/simple_spinner_item</item>
</resources>

View File

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<plurals name="test_plurals1">
<item quantity="other">%1$s, %2$d foo(s)</item>
<item quantity="one">%1$s, %2$d foo</item>
</plurals>
<plurals name="test_plurals2">
<item quantity="other">%d foos</item>
<item quantity="one">%d foo</item>
</plurals>
<plurals name="test_plurals3">
<item quantity="other">foo %d moos</item>
<item quantity="one">foo %d moo</item>
</plurals>
<plurals name="test_plurals4">
<item quantity="other">foo %d</item>
<item quantity="one">foo 1</item>
</plurals>
<plurals name="issue_658">
<item quantity="other">&lt;b>%d&lt;/b> guide123</item>
<item quantity="one">&lt;b>%d&lt;/b> 1</item>
</plurals>
<plurals name="issue_1431">
<item quantity="other">Vous disposez de &lt;font color=#8c593c>%1$d contenus&lt;/font> sur &lt;font color=#8c593c>%2$d disponibles&lt;/font></item>
<item quantity="one">Vous disposez de &lt;font color=#8c593c>%1$d contenu&lt;/font> sur &lt;font color=#8c593c>%2$d disponibles&lt;/font></item>
</plurals>
</resources>

View File

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="test_string1"></string>
<string name="test_string2">Lorem ipsum...</string>
<string name="test_string3">\@</string>
<string name="test_string4">\?</string>
<string name="test_string5">\#ff123456</string>
<string name="test_string7">&amp;</string>
<string name="test_string8">"'"</string>
<string name="test_string9">\"</string>
<string name="test_string10">\u0005</string>
<string name="test_string11">" foo bar "</string>
<string name="test_string12">"foo
bar"</string>
<string name="test_string13">" foo"<b>bar <i> baz </i></b> <u>foo</u></string>
<string name="test_string14">foo<sometag someattr1="someval1" someattr2="someval2">bar</sometag>baz</string>
<string name="test_string16">foo<b>bar<i>"b
az"</i></b>foo</string>
<string name="test_string17" formatted="false">%d of %d</string>
<string name="test_string18" formatted="false">foo %d bar %</string>
<string name="test_string19">%2$s foo %1$d</string>
<string name="test_string20" formatted="false">%-e foo %,d</string>
<string name="test_string21">%2$-e foo %1$,d</string>
<string name="test_string22" formatted="false">%02d foo %01d</string>
<string name="test_string23" formatted="false">%d foo %1</string>
<string name="test_string24" formatted="false">%1% foo %2%</string>
<string name="test_string25" formatted="false">foo %s bar %2$s baz</string>
<string name="test_string26">賞金鬥士14</string>
<string name="test_string27">{id:65538,v:2,tid:20003,mst:1,x:-1,y:-1,a:6000,b:3000,lm:{chp:1000,rep:0,bt:0,mp:[[101,0,1,0],[101,0,1,1],[101,0,1,2],[101,0,1,3],[101,0,1,4],[101,0,1,5],[100,0,0,0],[100,0,0,1],[100,0,0,2],[100,0,0,3],[100,0,0,4],[100,0,0,5]]},rm:{chp:1000,rep:0,bt:0,mp:[[100,0,1,0],[100,0,1,1],[100,0,1,2],[100,0,1,3],[100,0,1,4],[100,0,1,5],[101,0,0,0],[101,0,0,1],[101,0,0,2],[101,0,0,3],[101,0,0,4],[101,0,0,5]]}}</string>
<string name="test_string28">{al:[[180,0,7,0,0,1000],[109,0,5,0,0],[109,0,5,2,0],[109,0,5,4,0],[100,0,3,0,0],[100,0,3,1,0],[100,0,3,2,0],[100,0,3,3,0],[100,0,3,4,0],[100,0,3,5,0],[103,0,1,0,0],[103,0,1,1,0],[103,0,1,2,0],[103,0,1,3,0],[103,0,1,4,0],[103,0,1,5,0],[106,0,2,0,0],[106,0,2,1,0],[106,0,2,2,0],[106,0,2,3,0],[106,0,2,4,0],[106,0,2,5,0],[800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[850],[950],[900,0],[1000,0,0]],v:4,s:-1575044211,rl:[[180,0,7,0,0,1000],[103,0,0,0,0],[103,0,0,1,0],[103,0,0,2,0],[103,0,0,3,0],[103,0,0,4,0],[103,0,0,5,0],[111,0,3,0,0],[111,0,3,1,0],[111,0,3,2,0],[111,0,3,3,0],[111,0,3,4,0],[111,0,3,5,0],[102,0,4,0,0],[102,0,4,1,0],[102,0,4,2,0],[102,0,4,3,0],[102,0,4,4,0],[102,0,4,5,0],[107,0,5,0,0],[107,0,5,1,0],[107,0,5,2,0],[107,0,5,3,0],[107,0,5,4,0],[107,0,5,5,0],[106,0,2,0,0],[106,0,2,1,0],[106,0,2,2,0],[106,0,2,3,0],[106,0,2,4,0],[106,0,2,5,0],[900],[1000,0,0]],m:[]}</string>
<string name="test_string29" formatted="false">category=temp%temp%foo</string>
<string name="test_string30">res/foo/</string>
<string name="test_string31">res/foo</string>
<string name="test_string32">[<font size="17">TEST STRING</font>]</string>
<string name="test_string33"><font size="17">[TEST STRING]</font></string>
<string name="test_string34">[<font size="17">TEST STRING]</font></string>
<string name="test_string35"><font size="17">[TEST STRING</font>]</string>
<string name="test_string36"><font size="17">TEST STRING</font></string>
<string name="test_string37">[<font size="17">Ţåþ ţö ţýþé þåššŵöŕð one two three]</font></string>
<string name="test_string38">[<font size="17">Ţåþ ţö ţýþé þåššŵöŕð one two three</font>]</string>
<string name="test_string39"><font size="17">[Ţåþ ţö ţýþé þåššŵöŕð one two three</font>]</string>
<string name="test_string40">[<font size="17">]Ţåþ ţö ţýþé þåššŵöŕð one two three</font></string>
<string name="test_string41"><font size="17">[Ţåþ ţö ţýþé þåššŵöŕð one two three]</font></string>
</resources>

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="TextAppearance" parent="@android:style/TextAppearance" />
<style name="TextAppearance.EditEvent_Label" parent="@style/TextAppearance">
<item name="android:gravity">center_vertical</item>
<item name="android:popupAnimationStyle">@empty</item>
</style>
<style name="TextAppearance.EditEvent_Button" parent="@style/TextAppearance.EditEvent_Label">
<item name="android:textColor">#ff777777</item>
<item name="android:color">?android:dividerVertical</item>
</style>
<style name="Foo.Bar" parent=""/>
<style name="IssueStyle">
<item name="android:color">@null</item>
</style>
</resources>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="test_array4">
<item>@string/test_string1</item>
<item>@string/test_string2</item>
</string-array>
</resources>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="test_reference1">@string/test1</string>
<string name="test_reference2">@android:string/ok</string>
<string name="test_reference3">?android:textStyle</string>
</resources>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="test_array4">
<item>3.0in</item>
</string-array>
<string-array name="test_array5">
<item>65.0%</item>
<item>65%</item>
</string-array>
</resources>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<item type="bool" name="test_crossType_str2bool">TEST</item>
</resources>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<item type="integer" name="test_crossType_str2int">TEST</item>
</resources>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<item type="string" name="test_crossType_bool2str">true</item>
<item type="string" name="test_crossType_int2str">5</item>
</resources>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="test1">test1</string>
</resources>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="test1">test1</string>
</resources>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="test1">test1</string>
</resources>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="hello_world">Hello World</string>
</resources>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="hello_world">Hello World</string>
</resources>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="hello_world">Hello World</string>
</resources>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="hello_world">Hello World</string>
</resources>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="test1">test1</string>
</resources>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="hello_world">Hello World</string>
</resources>

View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<attr format="integer" name="test_attr1"/>
<attr format="reference" name="test_attr2"/>
<attr format="reference" name="test_attr3"/>
<attr format="string" name="test_attr4"/>
<attr name="test_attr5">
<enum name="out_test" value="0"/>
<enum name="in_test" value="1"/>
</attr>
<attr format="reference" name="test_attr6"/>
<attr format="reference" name="test_attr7"/>
<attr format="reference|color" name="test_attr8"/>
<attr format="color" name="test_attr9"/>
<attr format="boolean" name="test_attr10"/>
<attr name="test_attr11">
<enum name="TEST_ZERO" value="0" />
<enum name="TEST_ONE" value="1" />
</attr>
<attr name="min_value" format="float" />
<attr name="max_value" format="float" />
<attr name="default_value" format="float" />
</resources>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<integer name="test_integer1">-1</integer>
<integer name="test_integer2">0</integer>
<integer name="test_integer3">1</integer>
<integer name="reference_test">0</integer>
<integer name="issue_1223_1">700</integer>
<integer name="issue_1223_2">@integer/issue_1223_1</integer>
</resources>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<public type="string" name="hello_world" id="0x7f020000" />
</resources>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="test1" />
<string name="hello_world">Hello World</string>
<string name="issue_477">divider</string>
<string name="issue_1123">divider</string>
</resources>

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<View xmlns:android="http://schemas.android.com/apk/res/android"
test1=""
test2="Lorem ipsum"
test3="\@"
test4="\?"
test5="#ff123456"
test6="\#ff123456"
test7="&amp;"
test8="'"
test9="&quot;"
test10="\u0005"
test11=" foo bar "
test12="foo \n bar"
test15="005"
/>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<View xmlns:android="http://schemas.android.com/apk/res/android"
test1="@string/test1"
test2="@android:string/ok"
test3="?android:textStyle"
/>

View File

@ -0,0 +1,15 @@
.class public LHelloWorld;
.super Ljava/lang/Object;
.method public static main([Ljava/lang/String;)V
.registers 2
sget-object v0, Ljava/lang/System;->out:Ljava/io/PrintStream;
const/high16 v1, 0x7f020000
invoke-virtual {v0, v1}, Ljava/io/PrintStream;->println(Ljava/lang/String;)V
return-void
.end method

View File

@ -0,0 +1,15 @@
.class public LHelloDualDexSupport;
.super Ljava/lang/Object;
.method public static main([Ljava/lang/String;)V
.registers 2
sget-object v0, Ljava/lang/System;->out:Ljava/io/PrintStream;
const/high16 v1, 0x7f020000
invoke-virtual {v0, v1}, Ljava/io/PrintStream;->println(Ljava/lang/String;)V
return-void
.end method

View File

@ -0,0 +1 @@
This file is unknown.

View File

@ -0,0 +1 @@
https://code.google.com/p/android-apktool/issues/detail?id=603

View File

@ -0,0 +1 @@
This file's name contains a non-printable character.

View File

@ -0,0 +1 @@
This file is not compressed.

View File

@ -0,0 +1 @@
I am a hidden file. Put here by a developer to make recompilation difficult.