Skip to content

Commit

Permalink
FIX: Strange ClassCastException crash caused by R8.
Browse files Browse the repository at this point in the history
@keep mirrored hacks in Hacks.AppOpsManager to workaround.
  • Loading branch information
oasisfeng committed Oct 31, 2019
1 parent 05ffc12 commit 2360a71
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions shared/src/main/java/com/oasisfeng/island/util/Hacks.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

import javax.annotation.ParametersAreNonnullByDefault;

import androidx.annotation.Keep;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.annotation.RequiresPermission;
Expand Down Expand Up @@ -139,15 +140,15 @@ public class Hacks {
AddressCache_put = Hack.onlyIf(SDK_INT <= P).into("java.net.AddressCache").method("put")
.withParams(String.class, int.class, InetAddress[].class);

@ParametersAreNonnullByDefault public interface AppOpsManager extends Hack.Mirror<android.app.AppOpsManager> {
@Keep @ParametersAreNonnullByDefault public interface AppOpsManager extends Hack.Mirror<android.app.AppOpsManager> {

interface PackageOps extends Hack.Mirror {
@Keep interface PackageOps extends Hack.Mirror {
String getPackageName();
int getUid();
List<OpEntry> getOps();
}

interface OpEntry extends Hack.Mirror {
@Keep interface OpEntry extends Hack.Mirror {
int getOp();
int getMode();
}
Expand Down

0 comments on commit 2360a71

Please sign in to comment.