Merge pull request #1226 from iBotPeaches/issue/1223

Android N Support
This commit is contained in:
Connor Tumbleson 2016-09-18 16:46:25 -04:00 committed by GitHub
commit aa038a6499
8 changed files with 15 additions and 2 deletions

View File

@ -56,6 +56,11 @@ public class TypedValue {
* resolved before it can be used like TYPE_REFERENCE
*/
public static final int TYPE_DYNAMIC_REFERENCE = 0x07;
/**
* The <var>data</var> an attribute resource identifier, which needs to be resolved
* before it can be used like a TYPE_ATTRIBUTE.
*/
public static final int TYPE_DYNAMIC_ATTRIBUTE = 0x08;
/**
* Identifies the start of plain integer values. Any type value from this to
* {@link #TYPE_LAST_INT} means the <var>data</var> field holds a generic

View File

@ -752,6 +752,6 @@ public class Androlib {
// Taken from AOSP's frameworks/base/tools/aapt/Package.cpp
private final static Pattern NO_COMPRESS_PATTERN = Pattern.compile("\\.(" +
"jpg|jpeg|png|gif|wav|mp2|mp3|ogg|aac|mpg|mpeg|mid|midi|smf|jet|rtttl|imy|xmf|mp4|" +
"m4a|m4v|3gp|3gpp|3g2|3gpp2|amr|awb|wma|wmv)$");
"m4a|m4v|3gp|3gpp|3g2|3gpp2|amr|awb|wma|wmv|webm|mkv)$");
}

View File

@ -55,6 +55,7 @@ public class ResValueFactory {
case TypedValue.TYPE_INT_BOOLEAN:
return new ResBoolValue(value != 0, value, rawValue);
case TypedValue.TYPE_DYNAMIC_REFERENCE:
case TypedValue.TYPE_DYNAMIC_ATTRIBUTE:
return newReference(value, rawValue);
}

View File

@ -375,6 +375,11 @@ public class ARSCDecoder {
read = 52;
}
if (size >= 56) {
mIn.skipBytes(4);
read = 56;
}
int exceedingSize = size - KNOWN_CONFIG_BYTES;
if (exceedingSize > 0) {
byte[] buf = new byte[exceedingSize];
@ -550,7 +555,7 @@ public class ARSCDecoder {
}
private static final Logger LOGGER = Logger.getLogger(ARSCDecoder.class.getName());
private static final int KNOWN_CONFIG_BYTES = 52;
private static final int KNOWN_CONFIG_BYTES = 56;
public static class ARSCData {

View File

@ -4,4 +4,6 @@
<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>