mirror of
				https://github.com/topjohnwu/Magisk.git
				synced 2025-10-31 21:01:18 +00:00 
			
		
		
		
	Fix bootloop when upgrading from older Magisk
This commit is contained in:
		
							
								
								
									
										2
									
								
								build.py
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								build.py
									
									
									
									
									
								
							| @@ -106,7 +106,7 @@ def build_binary(args): | |||||||
| 	header('* Building binaries: ' + ' '.join(targets)) | 	header('* Building binaries: ' + ' '.join(targets)) | ||||||
|  |  | ||||||
| 	# Force update logging.h timestamp to trigger recompilation for the flags to make a difference | 	# Force update logging.h timestamp to trigger recompilation for the flags to make a difference | ||||||
|  | 	os.utime(os.path.join('native', 'jni', 'include', 'logging.h')) | ||||||
|  |  | ||||||
| 	# Basic flags | 	# Basic flags | ||||||
| 	base_flags = 'MAGISK_VERSION=\"{}\" MAGISK_VER_CODE={} MAGISK_DEBUG={}'.format(config['version'], config['versionCode'], | 	base_flags = 'MAGISK_VERSION=\"{}\" MAGISK_VER_CODE={} MAGISK_DEBUG={}'.format(config['version'], config['versionCode'], | ||||||
|   | |||||||
| @@ -585,7 +585,7 @@ void startup() { | |||||||
| 	close(root); | 	close(root); | ||||||
|  |  | ||||||
| 	// Alternative binaries paths | 	// Alternative binaries paths | ||||||
| 	char *alt_bin[] = { "/cache/data_bin", "/data/magisk", | 	char *alt_bin[] = { "/cache/data_bin", "/data/.magisk", | ||||||
| 						"/data/data/com.topjohnwu.magisk/install", | 						"/data/data/com.topjohnwu.magisk/install", | ||||||
| 						"/data/user_de/0/com.topjohnwu.magisk/install", NULL }; | 						"/data/user_de/0/com.topjohnwu.magisk/install", NULL }; | ||||||
| 	char *bin_path = NULL; | 	char *bin_path = NULL; | ||||||
| @@ -602,6 +602,7 @@ void startup() { | |||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	// Remove legacy stuffs | 	// Remove legacy stuffs | ||||||
|  | 	rm_rf("/data/magisk"); | ||||||
| 	unlink("/data/magisk.img"); | 	unlink("/data/magisk.img"); | ||||||
| 	unlink("/data/magisk_debug.log"); | 	unlink("/data/magisk_debug.log"); | ||||||
|  |  | ||||||
|   | |||||||
| @@ -27,7 +27,7 @@ initialize() { | |||||||
|   . $MAGISKBIN/util_functions.sh |   . $MAGISKBIN/util_functions.sh | ||||||
|  |  | ||||||
|   APK=/data/adb/magisk.apk |   APK=/data/adb/magisk.apk | ||||||
|   [ -f $APK ] || APK=/data/magisk/magisk.apk |   [ -f $APK ] || APK=/data/.magisk/magisk.apk | ||||||
|   [ -f $APK ] || APK=/data/app/com.topjohnwu.magisk*/*.apk |   [ -f $APK ] || APK=/data/app/com.topjohnwu.magisk*/*.apk | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -79,7 +79,7 @@ ui_print "- Constructing environment" | |||||||
| check_data | check_data | ||||||
|  |  | ||||||
| if $DATA; then | if $DATA; then | ||||||
|   MAGISKBIN=/data/magisk |   MAGISKBIN=/data/.magisk | ||||||
|   $DATA_DE && MAGISKBIN=/data/adb/magisk |   $DATA_DE && MAGISKBIN=/data/adb/magisk | ||||||
|   run_migrations |   run_migrations | ||||||
| else | else | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 topjohnwu
					topjohnwu