mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-04-19 02:11:28 +00:00
Don't backup ramdisk created by Magisk
Fix topjohnwu#5938, fix topjohnwu#5944
This commit is contained in:
parent
7bf9c74216
commit
89ff3c6572
@ -115,6 +115,14 @@ char *magisk_cpio::sha1() {
|
|||||||
for (str = (char *) buf; str < (char *) buf + size; str = str += strlen(str) + 1)
|
for (str = (char *) buf; str < (char *) buf + size; str = str += strlen(str) + 1)
|
||||||
|
|
||||||
void magisk_cpio::restore() {
|
void magisk_cpio::restore() {
|
||||||
|
// If the backup init is missing, this means that the boot ramdisk
|
||||||
|
// was created from scratch by us. Nothing needs to be restored.
|
||||||
|
if (exists(".backup") && !exists(".backup/init")) {
|
||||||
|
fprintf(stderr, "Remove all in ramdisk\n");
|
||||||
|
entries.clear();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (auto it = entries.find(".backup/.rmlist"); it != entries.end()) {
|
if (auto it = entries.find(".backup/.rmlist"); it != entries.end()) {
|
||||||
char *file;
|
char *file;
|
||||||
for_each_str(file, it->second->data, it->second->filesize) {
|
for_each_str(file, it->second->data, it->second->filesize) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user