Build.prop file accidentally got empty and haven't rebooted yet. Any ways to restore it? - Android Q&A, Help & Troubleshooting

Build.prop file accidentally got empty and haven't rebooted yet. Any ways to restore it?
Am i screwed?

You have a customer recovery? Then you can dirty flash your rom

I definitely would have done that if i did.
But TWRP was never released for my phone (poco x3 gt)

Depends the device and android version I guess...
I would do getprop and edit the output to build.prop form.
Notice to chmod the file correctly, 644 or whatever..

I think you can reboot safely because build.prop is inside super partition and therefore read-only.
of course you can download stock ROM from xiaomifirmwareupdater and extract build.prop from super.img, but it's more easy to flash super.img from fastboot.

aIecxs said:
I think you can reboot safely because build.prop is inside super partition and therefore read-only.
of course you can download stock ROM from xiaomifirmwareupdater and extract build.prop from super.img, but it's more easy to flash super.img from fastboot.
Click to expand...
Click to collapse
Nvm my phone just got an OTA update.
I just have to restore the root now

aIecxs said:
I think you can reboot safely because build.prop is inside super partition and therefore read-only.
Click to expand...
Click to collapse
And it's empty like how? Weird crap anyway... ok now, so who cares...

Idk but /system /vendor /product /system_ext /odm are ro dynamic partitions inside super partition, either OP did re-duplicate blocks with e2fsck -E unshare_blocks and disabled avb/dm-verity to allow remount rw / system_root (would break OTA), or it simply wasn't written to build.prop at all (magisk systemless overlay)? "empty" could also mean does not exist/no permissions...
https://github.com/Yuyuko1024/device_xiaomi_chopin/blob/lineage-18.1/rootdir/etc/fstab.mt6891
TWRP is available btw
https://forum.xda-developers.com/t/twrp-unofficial-3-6-0-poco-x3-gt-redmi-note-10-pro-5g.4369207

Related

Setting system root as RW default

Hey there?
I've got a question which I can't seem to find anywhere else and YES I have searched this forum and google. However, I may miss it.
Anyway, I've mapped my android phone as a network drive using Samba and changed the smb.conf file to show the System Root directory as well. However, system root is default set as R/O so to mange files USING my computer I need to change the permission to R/W using a file manager (such as root explorer). This is annoying, as I have to keep doing this in order to write to certail directories.
What I wish to do is create a massive guide on all of this to help out the community, however I need one little bit of information.
I would like the / directory (root) to be mounted as R/W as default so that I can quickly edit files on my PC without having to constantly change it to R/O.
If this has been answered before, I do apologize.
Thanks in advance.
Regards,
xxSHABSxx
EDIT:
To make things a bit clearer.
I want something that will automatically mount my phone's root dir into rw upon boot, without custom apps/having to manually mount as rw everytime it reboots. And yes I understand there are apps that do this.
Yes, the root file system is read-only, but it's also volatile. It's restored from the initramfs in the boot image each time you reboot the phone, so only mounting it writeable, doesn't do you very much anyway.
In /init.rc you find a line:
Code:
mount rootfs rootfs / ro remount
This remounts your root read-only. Remove this, and it'll stay writeable. But again, all edits to the root file system are volatile. To change this, you must flash a new boot.img
An easier way would be a root-app remounting it writable again after boot.
kuisma said:
Yes, the root file system is read-only, but it's also volatile. It's restored from the initramfs in the boot image each time you reboot the phone, so only mounting it writeable, doesn't do you very much anyway.
In /init.rc you find a line:
Code:
mount rootfs rootfs / ro remount
This remounts your root read-only. Remove this, and it's stay writeable. But again, all edits to the root file system are volatile. To change this, you must flash a new boot.img
An easier way would be a root-app remounting it writable again after boot.
Click to expand...
Click to collapse
Ahh I figured as much, since Google didn't offer any solutions to me. And flashing is way much more effort than simply having an app that does it for you.
Anyway thanks for the reply!
xxshabsxx said:
Ahh I figured as much, since Google didn't offer any solutions to me. And flashing is way much more effort than simply having an app that does it for you.
Click to expand...
Click to collapse
Or do like I did, move the root to a real ext3 non-volatile file system instead.

Changing Image to get root

Hello,
i have a Wiko PULP 3G, without a working root method.
I take a look at the Firmware files, there seems no CRC Protection. Even a Satellite Receiver or a TV Firmware have such.
I changed Text in the image with a HEX Editor(ro.sys.usb.storage.type) to get Massstorage. I flashed the modified image.
The Program just done it. Okay i have still no Massstorage. But on the Mobile i can see the build.prop has really changed
like i edit it.
I wonder if i can change Textfiles, it may possible to mount system as r/w.
Its a 1.9GB image difficult to find the Init/fstab.
Questions:
1. What do i need to modify to get mass_storage ?
2. How are the typical Textlines for a phone to make system read-only?
3. If i have write access to /system i can put a "su" file(any?) to system install SuperSU and have root?
Okay i have modified a boot.img, repack it and flashed it.
I set ro.secure=0, ro.debuggable=1 and massstorage in build.prop.
I got masstorage )))))
But how do i get the su to xbin. In the extracted Boot.img or Recovery.img there is no xbin.
Other .img files cant be xtracted.
With adb push this dont work, no permission.
Ideas?
If this is a raw system partition ext4 image, you can just mount it (with -o loop) on your Linux PC and modify the contents.
_that said:
If this is a raw system partition ext4 image, you can just mount it (with -o loop) on your Linux PC and modify the contents.
Click to expand...
Click to collapse
Thanks, but its not a raw image. I think its Android Sparse Image Format.
Linux cant mount it. Yaffey is not able to handle it.
I wonder why there i no tool where you can put a Firmware in and click on "Root it" and ready is the new one?!
Now i found tools to depack/pack the system image.
But the Phone dont boot, it starts and restart in Recovery.
If i do a root filecheck in Recovery it says 1 file added and 1 file changed - FAIL.
There must be something like a modify protection

[Q]SELINUX policy troubles

Hello everyone!
since some time ago I was customizing the ROM of Android 5.0. Everything was in order while I didn't try to change the system files. Obviously after flashing device refuse the normal boot and stacked on boot screen.. The reason was selinux context which I've never applied.
The process is:
1. Mount the ROM as EXT4
2. Add/Change files
3. Change the permissions
4. Unmount and flash...​The question is:
How to label and chcon the newly added files with Android's default context in a mounted EXT4 image?​
PS: Not sure is the right forum. Please suggest a solution.
Thanks!
dFrem said:
Hello everyone!
since some time ago I was customizing the ROM of Android 5.0. Everything was in order while I didn't try to change the system files. Obviously after flashing device refuse the normal boot and stacked on boot screen.. The reason was selinux context which I've never applied.
The process is:
1. Mount the ROM as EXT4
2. Add/Change files
3. Change the permissions
4. Unmount and flash...
The question is:
How to label and chcon the newly added files with Android's default context in a mounted EXT4 image?
PS: Not sure is the right forum. Please suggest a solution.
Thanks!
Click to expand...
Click to collapse
What do u mean u mounted the ROM ext4? The file system should have been defined upon install. If u changed the file system of your system partition I would assume you wiped you accidently wiped the installed os . Selinux status could affect boot but only if you did something that requires permissive status (a custom kernel is a good ready example of the type of flAsh that would need selinux on permissive). Ok so let's assume u didn't mean ROM . You meAnt system partition and you naturraly mounted that (system) as R/W . What permissions did you set on file . 644 is the correct answer if you were trying to install as system file. Wht was it you flashed? It's probably an easy fix bud . Just need more info
mojoswagger1980 said:
What do u mean u mounted the ROM ext4? The file system should have been defined upon install. If u changed the file system of your system partition I would assume you wiped you accidently wiped the installed os . Selinux status could affect boot but only if you did something that requires permissive status (a custom kernel is a good ready example of the type of flAsh that would need selinux on permissive). Ok so let's assume u didn't mean ROM . You meAnt system partition and you naturraly mounted that (system) as R/W . What permissions did you set on file . 644 is the correct answer if you were trying to install as system file. Wht was it you flashed? It's probably an easy fix bud . Just need more info
Click to expand...
Click to collapse
@mojoswagger1980 Thanks for answering. My bad, of course meaning is to mount "system.img" and not the ROM. Will explain.
The image is mounted, adding busybox into system/xbin, chmod 644, (automatically set owner root:root). As expected ls -Z is showing "?" for system/xbin/busybox...
Not changing anything more, flashing this image. File is not accessible or doesn't exists.
No doubts that if I am doing "chcon ubject_r:system_file:s0 system/xbin/busybox" it says first relabel the file... Relabel says there is no such type, user, etc...
What can I do in this case?
PS: Setting permissive 1 with inject-sepolicy doesn't help. May be I am doing something wrong here. Please suggestions.

Emui 9.1. The system partition does not go in rw

Hello. I installed emui 9.1 on my mate20pro with the dload method. I unlocked the bootloader again and rooted the system with patched recovery. The phone is rooted, but the system partition remains in ro. I have tried various apps to mount the system in rw, but without success. I have also tried some commands found on the net both through adb and emulator, but nothing to do. I have also tried using rootexplorer which has been granted root permissions, but fails to modify anything, nor to insert or delete files within the system folders. What can be done?
ernia66 said:
Hello. I installed emui 9.1 on my mate20pro with the dload method. I unlocked the bootloader again and rooted the system with patched recovery. The phone is rooted, but the system partition remains in ro. I have tried various apps to mount the system in rw, but without success. I have also tried some commands found on the net both through adb and emulator, but nothing to do. I have also tried using rootexplorer which has been granted root permissions, but fails to modify anything, nor to insert or delete files within the system folders. What can be done?
Click to expand...
Click to collapse
it's the new filesystem called erofs (Extendable Read-Only File System)
So there's nothing to do?
Sorry OP if this is off topic , but its about magisk and root in 9.1
I have the "system partition remains in ro" issue too , its annoying yes , but I have a bigger problem
When "rooted" , the phone app ( dialer ), and the contacts app both get broken and crash .. So I have to fastbootflash twrp and lose root to make those apps to work normally again
Anyone with the same problem ?
I need root so I can change and use the font ( I like ) with a magisk module
ernia66 said:
So there's nothing to do?
Click to expand...
Click to collapse
Magisk can already 'replace on the fly' file from /system systemless-y.
It dies already support erofs.
Check Magisk documentations.
There is also a way to mount custom erofs partition....
which is?
ernia66 said:
which is?
Click to expand...
Click to collapse
Build your own erofs partitions (cf. erofs.mkfs)
Unmount stock ones and mount yours.
I just did some test 48h ago on erofs /cust and it seems to work...
-Mounting other file system type on same folder could even work !
oslo83 said:
Build your own erofs partitions (cf. erofs.mkfs)
Unmount stock ones and mount yours.
I just did some test 48h ago on erofs /cust and it seems to work...
-Mounting other file system type on same folder could even work !
Click to expand...
Click to collapse
Unfortunately I am not able to do it
:crying:
pvillasuso said:
Sorry OP if this is off topic , but its about magisk and root in 9.1
I have the "system partition remains in ro" issue too , its annoying yes , but I have a bigger problem
When "rooted" , the phone app ( dialer ), and the contacts app both get broken and crash .. So I have to fastbootflash twrp and lose root to make those apps to work normally again
Anyone with the same problem ?
I need root so I can change and use the font ( I like ) with a magisk module
Click to expand...
Click to collapse
use search button pls, you will find the solution already posted
ilos said:
use search button pls, you will find the solution already posted
Click to expand...
Click to collapse
Shhh
Here Rootexplorer paying app does not help writing on erofs partitions...
- Or did you meant something else ?
Magisk Doc. :
https://topjohnwu.github.io/Magisk/
So far, out-of-the-box, Magisk is already ready to replace systemless-ly files and paths on /system easily when used with modules.
-Module just need a a small tweak to add Magisk systemless-ly compatibility to other erofs partitions like /cust
Another way would be to bind or mount...
ilos said:
use search button pls, you will find the solution already posted
Click to expand...
Click to collapse
Wow , what , where ???
I did search but maybe I didnt use the right keywords for such an specific issue
Any extra help , would be very appreciated !
oslo83 said:
Build your own erofs partitions (cf. erofs.mkfs)
Unmount stock ones and mount yours.
I just did some test 48h ago on erofs /cust and it seems to work...
-Mounting other file system type on same folder could even work !
Click to expand...
Click to collapse
I'd like to create my own partition but I don't know how to do it. Is there any online guide for beginners that I can try?
oslo83 said:
Shhh
Here Rootexplorer paying app does not help writing on erofs partitions...
- Or did you meant something else ?
Click to expand...
Click to collapse
my reply was not for you but for the off topic before my reply: contact, ph app and message force close after root.
as I said, there is already a solution about force close.
Anyway I can only write in /system/etc and some over folders
oslo83 said:
Build your own erofs partitions (cf. erofs.mkfs)
Unmount stock ones and mount yours.
I just did some test 48h ago on erofs /cust and it seems to work...
-Mounting other file system type on same folder could even work !
Click to expand...
Click to collapse
Hi, I saw that you managed to get a custom erofs partition mounted using magisk. I was wondering if the same could be done for the/product folder because that would allow me to fix the DPI scaling issues found on EMUI 9.0-9.1. Would it be possible to see the code for your magisk module?
Ok, So.
After having a look at what I did with this WorkInProgress...
So far there is 2 main way I thought about and played with:
Method A
A1/
Using the mkfs.erofs tool to make your custom erofs partition and mount it over the original one. (mayne umount it before)
Thanks @ph03n!x for his work on mkfs.erofs.
Thanks @ante0 for his android arm build.
A2/
I did not yet tryed to flash via fastboot or adb these modded erofs images.
Method B
What I'm actually doing is just mounting systemless-y with a magisk module whole folders over erofs one ;
In post-fs-data.sh, I'm doing:
mount -o bind $MODDIR/cust /cust
mount -o bind $MODDIR/version /version
With a ~150MB custom /cust it is working ; It should be tryed/perfected for bigger folders.
Another way, to not replace/spoof the whole folders could be to mount the whole list of custom files at their respective path (-to be tested)
PS: I'm not sure if update-binary module's file should be modded with some:
mount /cust 2>/dev/null
@ line 42
Sources:
https://forum.xda-developers.com/huawei-p30-pro/how-to/erofs-mounting-accessing-img-t3944193
oslo83 said:
Ok, So.
After having a look at what I did with this WorkInProgress...
So far there is 2 main way I thought about and played with:
Method A
A1/
Using the mkfs.erofs tool to make your custom erofs partition and mount it over the original one. (mayne umount it before)
Thanks @ph03n!x for his work on mkfs.erofs.
Thanks @ante0 for his android arm build.
A2/
I did not yet tryed to flash via fastboot or adb these modded erofs images.
Method B
What I'm actually doing is just mounting systemless-y with a magisk module whole folders over erofs one ;
In post-fs-data.sh, I'm doing:
mount -o bind $MODDIR/cust /cust
mount -o bind $MODDIR/version /version
With a ~150MB custom /cust it is working ; It should be tryed/perfected for bigger folders.
Another way, to not replace/spoof the whole folders could be to mount the whole list of custom files at their respective path (-to be tested)
PS: I'm not sure if update-binary module's file should be modded with some:
mount /cust 2>/dev/null
@ line 42
Sources:
https://forum.xda-developers.com/huawei-p30-pro/how-to/erofs-mounting-accessing-img-t3944193
Click to expand...
Click to collapse
I'm rather new to this trying to do something similar on my EMUI9.1 using Magisk, I'm having a problem that i can replace anything in most other folders without much problem like /etc/ for example, but when i try to substitute /vendor/, whatever i put it the folder does not only fail to get substituted, it even disappears from the $MODDIR/system/vendor folder upon restart!
I.e. let's say I create a new file in $MODDIR/system/etc. Upon restart i'm successfully seeing that same file appear /etc.
However when I create a new file under $MODDIR/system/vendor, Upon restart i'm not seeing that under /vendor. ALSO the file is gone from $MODDIR/system/vendor like it was never there.
Any idea what is happening? I've also tried manually mounting in the post-fs-data.sh, where i put the following:
mount -o bind $MODDIR/system/vendor /vendor
That actually caused my system to freeze on the loading screen. I had to reset magisk to non-modded settings in order to get it to run again.
Any help's appreciated.
pvillasuso said:
Sorry OP if this is off topic , but its about magisk and root in 9.1
I have the "system partition remains in ro" issue too , its annoying yes , but I have a bigger problem
When "rooted" , the phone app ( dialer ), and the contacts app both get broken and crash .. So I have to fastbootflash twrp and lose root to make those apps to work normally again
Anyone with the same problem ?
I need root so I can change and use the font ( I like ) with a magisk module
Click to expand...
Click to collapse
i got the solution of above problem from this https://forum.xda-developers.com/huawei-p30-pro/how-to/guide-magisk-root-p30-pro-bl-code-t3938285
Hi I have almost the same issue after updating to EMUI 9.1 the phone hardbricked. It only shows as fastboot on my PC I tried flashing but not sending the img files please help

Can't mount /system R/W in either TWRP or OFox

I wanted to delete some files from the system like some useless system apps/themes etc. I was trying to root my phone with magisk. The magisk would install but I couldn't make any kind of changes because I found it was read-only! Now if I want it to mount read-write, it just won't. Any solutions, anyone?
Resmi Note 9S Curtana, OFox R11 installed with xiaomi.eu 12.0.1.0, android 11
Try this script from this thread.
You can't mount system because of dynamic partitions (super partition). The script linked above doesn't mount system rw, it just makes a new super partition.
The real way to make edits to dynamic partitions is with adb remount which replaces the old 'mount -o rw, remount /system' method.
The practical way to make edits is systemlessly with a magisk module.
Adb remount info
Dynamic partitions info
jwchips said:
You can't mount system because of dynamic partitions (super partition). The script linked above doesn't mount system rw, it just makes a new super partition.
The real way to make edits to dynamic partitions is with adb remount which replaces the old 'mount -o rw, remount /system' method.
The practical way to make edits is systemlessly with a magisk module.
Adb remount info
Dynamic partitions info
Click to expand...
Click to collapse
I feel superdumb but @jwchips , where am I supposed to put those commands- in custom recovery terminals, in Windows command prompt or in a terminal emulator app?
Plz someone teach me step by step. I can't rw system by root explorer in miui rom, but I can do it in aosp rom. I don't know what causing this result. Since android 2 to android 11. Every upgrade time I struggle a lot. Now I spend 2 mouth to search internet but for code noob like me, get nothing. I'm still study it hope a newvice tutorial post.
same problem here, ive tried different zips and also doing it manually, no success
Azamsm said:
I wanted to delete some files from the system like some useless system apps/themes etc. I was trying to root my phone with magisk. The magisk would install but I couldn't make any kind of changes because I found it was read-only! Now if I want it to mount read-write, it just won't. Any solutions, anyone?
Resmi Note 9S Curtana, OFox R11 installed with xiaomi.eu 12.0.1.0, android 11
Click to expand...
Click to collapse
Why not try debloater magisk?
GitHub - sunilpaulmathew/De-Bloater: An application using the power of Magisk to debloat unwanted system apps!
An application using the power of Magisk to debloat unwanted system apps! - GitHub - sunilpaulmathew/De-Bloater: An application using the power of Magisk to debloat unwanted system apps!
github.com

Categories

Resources