How to copy files to system folder via TWRP?


Jarychen

Members
May 25, 2019
28
15
I want to replace some system fonts with anotherone,but file manager of TWRP can't do it.
And I downloaded some fonts of TWRP zip format and flashed it and files were extracted to system\font but TWRP ist mounting "system_root" instead of "system".
How to fix that?

Here is the updater-script

show_progress(1.000000, 0);
ui_print("Mounting filesystems...");
run_program("/sbin/busybox", "mount", "/system");
set_progress(0.100000);

ui_print("Extracting files...");
package_extract_dir("system", "/system");
set_progress(0.300000);

ui_print("Setting permissions...");
set_perm(0, 0, 0644, "/system/etc/fonts.xml");
set_progress(0.400000);
set_progress(0.500000);
set_perm_recursive(0, 0, 0755, 0644, "/system/fonts");
set_progress(0.700000);

# Unmounting filesystems...
run_program("/sbin/busybox", "umount", "/system");
set_progress(0.900000);


set_progress(1.000000);
ui_print("****************************************");
ui_print("* Install Complete! *");
ui_print("****************************************");
 

LOLO9393

Members
Feb 8, 2016
3,207
322
I want to replace some system fonts with anotherone,but file manager of TWRP can't do it.
And I downloaded some fonts of TWRP zip format and flashed it and files were extracted to system\font but TWRP ist mounting "system_root" instead of "system".
How to fix that?

Here is the updater-script

show_progress(1.000000, 0);
ui_print("Mounting filesystems...");
run_program("/sbin/busybox", "mount", "/system");
set_progress(0.100000);

ui_print("Extracting files...");
package_extract_dir("system", "/system");
set_progress(0.300000);

ui_print("Setting permissions...");
set_perm(0, 0, 0644, "/system/etc/fonts.xml");
set_progress(0.400000);
set_progress(0.500000);
set_perm_recursive(0, 0, 0755, 0644, "/system/fonts");
set_progress(0.700000);

# Unmounting filesystems...
run_program("/sbin/busybox", "umount", "/system");
set_progress(0.900000);


set_progress(1.000000);
ui_print("****************************************");
ui_print("* Install Complete! *");
ui_print("****************************************");
It looks like you don't search too much understanding why....
On latest phone model you can not modify/touch system file via TWRP, because..................they are locked!
Bur, You can do it via Magisk if you want to use it.
sorry
 

Jarychen

Members
May 25, 2019
28
15
It looks like you don't search too much understanding why....
On latest phone model you can not modify/touch system file via TWRP, because..................they are locked!
Bur, You can do it via Magisk if you want to use it.
sorry
I got it and I use Magisk till yesterday.
Because of Magisk will remove magisk hide later,I try to find some other way.
Thanks for replying.
 
  • Like
Reactions: LOLO9393

Poney70

Donator
Oct 3, 2019
5,499
337
@Jarychen: What's your device? What TWRP version are you using?

To make a zip file for TWRP, my advices are:

1) Always include the busybox in zip file (do not use "/sbin/busybox")

2) Create a script to find the System partition mount point

You can download this zip file: TWRP_Fonts_Changer_v1.0.zip

INFO: Modify this zip file by adding your fonts.xml file in "tmp/installer/system/etc/" and your font(s) in "tmp/installer/system/fonts/".

;)
 

alrasbi

Members
Mar 30, 2011
17
15
@Jarychen: What's your device? What TWRP version are you using?

To make a zip file for TWRP, my advices are:

1) Always include the busybox in zip file (do not use "/sbin/busybox")

2) Create a script to find the System partition mount point

You can download this zip file: TWRP_Fonts_Changer_v1.0.zip

INFO: Modify this zip file by adding your fonts.xml file in "tmp/installer/system/etc/" and your font(s) in "tmp/installer/system/fonts/".

;)
Thanx Dear,
i try to use your file via TWRP, but i got this error ( Please mount 'system' partition )

how can resolve this?

Regards
 

katerpanne

Members
Apr 19, 2014
2,535
332
  • Like
Reactions: geoorg and Poney70

alrasbi

Members
Mar 30, 2011
17
15
hi ... twrp modules sometimes are working and sometimes not

its easier to use a magisk module instead, here is an example

delete the ringtones and put your system/fonts files into the folder
Thanx Dear,
the problem with magisk some apps notworking with its ex. banks applications,,

also i try to do that with root explorer but can not, its not get permission in root folder
 
Last edited:

katerpanne

Members
Apr 19, 2014
2,535
332
Thanx Dear,
the problem with magisk some apps notworking with its ex. banks applications,,

also i try to do that with root explorer but can not, its not get permission in root folder
how to get banking apps working…

root explorer is not the solution... if you want to use explorer, try mix explorer and grant… settings - more settings - allow root. But for that you have to use magisk as well :)

to install magisk for a12 follow this…
you have to patch boot.img and install it with fastboot

https://xiaomi.eu/community/threads/21-6-30.62035/page-2#post-617162

use canary version magisk for a12 example links

https://raw.githubusercontent.com/topjohnwu/magisk-files/canary/app-debug.apk
 
Last edited:

alrasbi

Members
Mar 30, 2011
17
15
how to get banking apps working…

root explorer is not the solution... if you want to use explorer, try mix explorer and grant… settings - more settings - allow root. But for that you have to use magisk as well :)

to install magisk for a12 follow this…
you have to patch boot.img and install it with fastboot

https://xiaomi.eu/community/threads/21-6-30.62035/page-2#post-617162

use canary version magisk for a12 example links

https://raw.githubusercontent.com/topjohnwu/magisk-files/canary/app-debug.apk
Same problem Dear, can not copy in system or delete, i have Mi 11 lite 4g