Use /twres instead of /res for theme resources
AOSP and other ROM trees now do a rm -rf of the res folder during
the ramdisk creation process that removes the TWRP resources.
Using /twres instead of /res works around this issue making TWRP
more compatible with AOSP and other build trees.
Change-Id: I0d4c7e06ca381ac5aa0069b6f2b8c47f7dec49e7
diff --git a/twrp-functions.cpp b/twrp-functions.cpp
index 50f05a7..15f442f 100644
--- a/twrp-functions.cpp
+++ b/twrp-functions.cpp
@@ -354,30 +354,30 @@
return;
gui_print("Installing HTC Dumlock to system...\n");
- copy_file("/res/htcd/htcdumlocksys", "/system/bin/htcdumlock", 0755);
+ copy_file(TWHTCD_PATH "htcdumlocksys", "/system/bin/htcdumlock", 0755);
if (!Path_Exists("/system/bin/flash_image")) {
gui_print("Installing flash_image...\n");
- copy_file("/res/htcd/flash_imagesys", "/system/bin/flash_image", 0755);
+ copy_file(TWHTCD_PATH "flash_imagesys", "/system/bin/flash_image", 0755);
need_libs = 1;
} else
gui_print("flash_image is already installed, skipping...\n");
if (!Path_Exists("/system/bin/dump_image")) {
gui_print("Installing dump_image...\n");
- copy_file("/res/htcd/dump_imagesys", "/system/bin/dump_image", 0755);
+ copy_file(TWHTCD_PATH "dump_imagesys", "/system/bin/dump_image", 0755);
need_libs = 1;
} else
gui_print("dump_image is already installed, skipping...\n");
if (need_libs) {
gui_print("Installing libs needed for flash_image and dump_image...\n");
- copy_file("/res/htcd/libbmlutils.so", "/system/lib/libbmlutils.so", 0755);
- copy_file("/res/htcd/libflashutils.so", "/system/lib/libflashutils.so", 0755);
- copy_file("/res/htcd/libmmcutils.so", "/system/lib/libmmcutils.so", 0755);
- copy_file("/res/htcd/libmtdutils.so", "/system/lib/libmtdutils.so", 0755);
+ copy_file(TWHTCD_PATH "libbmlutils.so", "/system/lib/libbmlutils.so", 0644);
+ copy_file(TWHTCD_PATH "libflashutils.so", "/system/lib/libflashutils.so", 0644);
+ copy_file(TWHTCD_PATH "libmmcutils.so", "/system/lib/libmmcutils.so", 0644);
+ copy_file(TWHTCD_PATH "libmtdutils.so", "/system/lib/libmtdutils.so", 0644);
}
gui_print("Installing HTC Dumlock app...\n");
mkdir("/data/app", 0777);
unlink("/data/app/com.teamwin.htcdumlock*");
- copy_file("/res/htcd/HTCDumlock.apk", "/data/app/com.teamwin.htcdumlock.apk", 0777);
+ copy_file(TWHTCD_PATH "HTCDumlock.apk", "/data/app/com.teamwin.htcdumlock.apk", 0777);
sync();
gui_print("HTC Dumlock is installed.\n");
}