Skip to content

Commit 4f620ce

Browse files
committed
fix: don't assert call
Proguard optimizes out the entire assert and breaks it.
1 parent 3db3970 commit 4f620ce

File tree

4 files changed

+13
-8
lines changed

4 files changed

+13
-8
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ respositories {
1010
maven("https://maven.aliucord.com/snapshots")
1111
}
1212
dependencies {
13-
implementation("com.aliucord:binary-resources:2.0.0")
13+
implementation("com.aliucord:binary-resources:2.0.1")
1414
}
1515
```

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ plugins {
33
id("com.android.library") version "8.3.0"
44
}
55

6-
version = "2.0.0"
6+
version = "2.0.1"
77

88
android {
99
compileSdk = 34

src/main/java/com/google/devrel/gmscore/tools/apk/arsc/BinaryResourceConfiguration.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,12 @@
2424
import com.google.common.primitives.UnsignedBytes;
2525

2626
import java.nio.ByteBuffer;
27-
import java.util.*;
27+
import java.util.Arrays;
28+
import java.util.Collection;
29+
import java.util.Collections;
30+
import java.util.LinkedHashMap;
31+
import java.util.Map;
32+
import java.util.Objects;
2833

2934
/**
3035
* Describes a particular resource configuration.
@@ -547,8 +552,6 @@ private String unpackLanguageOrRegion(byte[] value, int base) {
547552
public final boolean isDefault() {
548553
return mcc() == 0
549554
&& mnc() == 0
550-
&& Arrays.equals(language(), new byte[2])
551-
&& Arrays.equals(region(), new byte[2])
552555
&& orientation() == 0
553556
&& touchscreen() == 0
554557
&& density() == 0
@@ -564,9 +567,11 @@ && uiMode() == 0
564567
&& smallestScreenWidthDp() == 0
565568
&& screenWidthDp() == 0
566569
&& screenHeightDp() == 0
570+
&& screenLayout2() == 0
571+
&& Arrays.equals(language(), new byte[2])
572+
&& Arrays.equals(region(), new byte[2])
567573
&& Arrays.equals(localeScript(), new byte[4])
568-
&& Arrays.equals(localeVariant(), new byte[8])
569-
&& screenLayout2() == 0;
574+
&& Arrays.equals(localeVariant(), new byte[8]);
570575
}
571576

572577
@Override

src/main/java/com/google/devrel/gmscore/tools/apk/arsc/TypeSpecChunk.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public int getResourceFlags(int index) {
8888
* @return The index of the new resource.
8989
*/
9090
public int addResource(int flags) {
91-
assert resourceFlags.add(flags);
91+
resourceFlags.add(flags);
9292
return resourceFlags.getSize() - 1;
9393
}
9494

0 commit comments

Comments
 (0)