You've already forked Magisk
mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-09-06 06:36:58 +00:00
Catch possible exceptions when the receiver is already unregistered
This commit is contained in:
@@ -116,7 +116,10 @@ public final class APKInstall {
|
|||||||
if (onFailure != null) {
|
if (onFailure != null) {
|
||||||
onFailure.run();
|
onFailure.run();
|
||||||
}
|
}
|
||||||
context.getApplicationContext().unregisterReceiver(this);
|
try {
|
||||||
|
context.getApplicationContext().unregisterReceiver(this);
|
||||||
|
} catch (IllegalArgumentException ignored) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
latch.countDown();
|
latch.countDown();
|
||||||
@@ -126,7 +129,10 @@ public final class APKInstall {
|
|||||||
private void onSuccess(Context context) {
|
private void onSuccess(Context context) {
|
||||||
if (onSuccess != null)
|
if (onSuccess != null)
|
||||||
onSuccess.run();
|
onSuccess.run();
|
||||||
context.getApplicationContext().unregisterReceiver(this);
|
try {
|
||||||
|
context.getApplicationContext().unregisterReceiver(this);
|
||||||
|
} catch (IllegalArgumentException ignored) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user