forked from MarcoBuster/Magisk
Store data in intent for OTA
This commit is contained in:
parent
343161b195
commit
4a5d033efb
@ -15,9 +15,8 @@ import java.io.File;
|
||||
public class ManagerUpdate extends BroadcastReceiver {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
MagiskManager magiskManager = Utils.getMagiskManager(context);
|
||||
Utils.dlAndReceive(
|
||||
magiskManager,
|
||||
context,
|
||||
new DownloadReceiver() {
|
||||
@Override
|
||||
public void onDownloadDone(Uri uri) {
|
||||
@ -36,8 +35,8 @@ public class ManagerUpdate extends BroadcastReceiver {
|
||||
}
|
||||
}
|
||||
},
|
||||
magiskManager.managerLink,
|
||||
intent.getStringExtra("link"),
|
||||
Utils.getLegalFilename("MagiskManager-v" +
|
||||
magiskManager.remoteManagerVersionString + ".apk"));
|
||||
intent.getStringExtra("version") + ".apk"));
|
||||
}
|
||||
}
|
||||
|
@ -237,6 +237,8 @@ public class Utils {
|
||||
.setVibrate(new long[]{0, 100, 100, 100})
|
||||
.setAutoCancel(true);
|
||||
Intent intent = new Intent(magiskManager, ManagerUpdate.class);
|
||||
intent.putExtra("link", magiskManager.managerLink);
|
||||
intent.putExtra("version", magiskManager.remoteManagerVersionString);
|
||||
PendingIntent pendingIntent = PendingIntent.getBroadcast(magiskManager,
|
||||
APK_UPDATE_NOTIFICATION_ID, intent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
builder.setContentIntent(pendingIntent);
|
||||
|
Loading…
Reference in New Issue
Block a user