[Q] How to edit build prop file using adb ? - General Questions and Answers

I tried to pull build.prop file using adb then edit it , but when I try to push file it say that file can not be accessed remotely
I tried to use build prop editor but it doesn't run on device, if anyone have idea about alternatives?
Note that I am rooted and using adb insecure

Android's partition /system must get mounted as RW, to save a modified build.prop file ( what must be UNIX-style formatted ).

If its a modern/recent device, chances you cannot make the system partition R/W and therefore caznnhot write a new build.prop file. To make changes to system files you will have to use magisk. Or build a complete ROM from source...

I remounted system as rw and it worked

.

need to be on
unlocked bootloader
dmverity disabled (make sure to disable on the ACTIVE partition remember some have multiple partitions such as A/B )
also using a "VNDKLITE" system image helps with newer releases,
and of course system needs to be rooted
and then finally from within the android OS mount the partition with read/write permissions

I tried running adb as root then I remounted system as rw and it worked

Related

[Q] Keep changes in / (root) partition (Eclair)

Hello
I rooted my new Galaxy 5 running Eclair, but the file /default.prop still contains
Code:
ro.secure=1
instead of
Code:
ro.secure=0
I was able to change these settings by remounting the file system in read-write mode, but the changes didn't not survive a reboot.
By searching about this, I understood the changes should happen into the recovery partition, from which the system will boot next time (is this correct?).
My question is: which partition do I have to mount for modifying the contents of the root partition after next reboot, if this is possible?
I am using Ubuntu and I don't have odin neither fastboot working. I would prefer to do everything from the adb shell.
Thanks.

How do I modify a file under /vendor/etc? (Mount System RW)

I am trying to modify /vendor/etc/audio_policy_configuration.xml for some personal tests. I am rooted with Magisk v14.4 and have Snoke R11 kernel.
I have tried:
FX App (with root module) and mounting various folders RW
Root Browser app
"mount -o rw,remount /system" in ADB then modifying the file with an app on the phone
ADB push the file in TWRP with system mounted (adb pull the file after shows my modifications)
But, every time I reboot to the OS, the file has reverted and my changes are not present. I can successfully modify the build.prop however...and if I reboot to the bootloader after pushing the new file with TWRP, then boot into TWRP and pull the file, I can still see the changes. But the changes get wiped on boot of the OS.
I have a similar problem (I want to update the hosts file that is located in the /vendor/etc partition).
I don't know why you mount the /system partition in RW while you need to access the /vendor partition...
The whole point of Magisk is that you can do these things without modifying your /system/ or /vendor/ partitions, just create a Magisk Module with your modifications.
https://forum.xda-developers.com/showpost.php?p=74843454&postcount=850

[Q] How to edit camera features file

I want to edit camera_features.xml file but it needs root access, I don't want to root device but I think there is a way through ADB or using some third party apps that uses super user permission to edit root files
Please I'm sure there is way to edit it without rooting device by using special third party apps but I need someone who know how to
Temporarily root Android by putting a suitable su binary into Android's filesystem - preferably /data/loca/temp - and making it executable.
https://forum.xda-developers.com/attachments/su-binaries-zip.5566949/
I don't find the directory data/local
And does it require root to put the su file there
Noticed that I made a spelling mistake:
The directory recommended to copy su binary into is
/data/local/tmp
what exists on all Android versions since beginning and by default is mounted as RW
How can I reach the folder, which app can reach and copy files to root data/local/tmp without rooting device
You use ADB - of course requires USB DEbugging got enabled on device in question.
To clarify things: the su binary is the root functionality you want to add to Android.
I tried to use adb push su data/local/tmp but it doesn't work
xXx yYy said:
You use ADB - of course requires USB DEbugging got enabled on device in question.
To clarify things: the su binary is the root functionality you want to add to Android.
Click to expand...
Click to collapse
I know but I think there is another way using apps that uses system apps permissions
Such as editing root file of the device as official device updater

[HELP] Internal Storage not accessible a.k.a How to clear com.android.providers.media.MediaApplication data

Hi,
Since a few days I'm unable to see any data in my phone via gallery or file manager or any application, and I'm unable to save any data to internal storage. (example: I'm able to use whatsapp for texting, but I can't receive/send any audio/picture and I can't access the old ones).
And I keep getting this error message:"com.android.providers.media.MediaApplication keeps stopping."
I don't know if that's what causing it or if that's just a consequence of not being able to access internal storage.
I can still see all the used storage from settings though.
Phone has unlocked bootloader, but no root/custom rom/recovery.
I saw other Oneplus users started getting the same error these days... (I have a Oneplus 6, but others have different models like Oneplus Nord).
Someone resolved by wiping system and they were able to retrieve storage content and functionality, but they lost apps data, I'm trying to find another way since I have an unlocked bootloader.
An user on stackoverflow suggested I should clean the com.android.providers.media.MediaApplication app data to regenerate the database, but I couldn't figure out how to do it
I tried cleaning media and media.module packages (not media.MediaApplication) from adb but no luck even if successful.
I tried removing "com.android.providers.media" (not media.MediaApplication, I couldn't find that one) folder from data/data with twrp file manager but no luck...
Is there a way to specifically clean "com.android.providers.media.MediaApplication"?
If anyone has any other suggestion on things to try, post it here please.
Thank you in advance
you wrote you already did successfully - obviously that is not the cause. my suspect is broken encryption (you will figure out from recovery.log)
encrypted files look like this +NiZZaTrs3RFzYegpkEk if encryption is not the reason, it could be symlinks messed up. in android enable usb-debugging and check from adb shell.
(repeat this for each result)
Code:
readlink /sdcard
readlink ...
in TWRP recovery check for files like /data/system/uiderrors.txt
/data/log
(don't know exact names) you can adb pull files to PC and inspect with wordpad or Notepad++
last but no least you can capture logcat during boot for further analysis
Code:
adb logcat > logcat.txt
if you're going to factory reset device, install Magisk from TWRP and backup apps to usb flash drive with Migrate-NG beforehand. copy all your pictures + backups to PC
Code:
adb pull -a /sdcard
if you can't install Migrate or can't get usb-otg to work, get a backup to PC at least, I can tell you how to restore single apps from it later (ignore the confirmation request "WARNING adb backup is deprecated... Now Unlock your device and confirm...")
Code:
adb backup --twrp --compress data
alecxs said:
encrypted files look like this +NiZZaTrs3RFzYegpkEk if encryption is not the reason, it could be symlinks messed up. in android enable usb-debugging and check from adb shell.
(repeat this for each result)
Code:
readlink /sdcard
readlink ...
in TWRP recovery check for files like /data/system/uiderrors.txt
/data/log
(don't know exact names) you can adb pull files to PC and inspect with wordpad or Notepad++
last but no least you can capture logcat during boot for further analysis
Code:
adb logcat > logcat.txt
if you're going to factory reset device, install Magisk from TWRP and backup apps to usb flash drive with Migrate-NG beforehand. copy all your pictures + backups to PC
Code:
adb pull -a /sdcard
if you can't install Migrate or can't get usb-otg to work, get a backup to PC at least, I can tell you how to restore single apps from it later (ignore the confirmation request "WARNING adb backup is deprecated... Now Unlock your device and confirm...")
Code:
adb backup --twrp --compress data
Click to expand...
Click to collapse
Hi @alecxs , I really hope you are still active on this forum...
Probably you won't remember this discussion from back in the days (This was the previous part of our exchange if you would like to refresh your memory).
In the end I ended up using my phone in that state for more than one year with the plan of changing phone soon and not have to deal with the wipe and restoration on the same device (if that's not procrastination.... ).
Well, last week I dropped the phone and the screen died. I bought a pixel 7 as a replacement but now I would like to try to save the data of just a few apps. Most important one being Whatsapp, I don't really care about the rest...
So basically:
-the screen is dead but touch is still working and I was able to get scrcpy to work so I can still use it as a "normal' phone from my computer, so that shouldn't be an impediment.
-as previously stated the phone is not able to access internal storage, but I'm able to access it in recovery mode through adb so pulling files should not be an issue.
-I'm able to install and update apks through adb install.
-whatsapp was not able to execute backups during this year since it could not access internal storage, so I have only old ones.
-bootloader is unlocked, I have twrp but no root.
I still need to try your suggestion above, but wanted to ask this before cause maybe you have a different suggestion to extract a single app. Also, I don't really know how migrate works but if it saves the backup on the internal storage I think that's not gonna work cause every app that needs to save something (that isn't data) doesn't work.
Isn't there a way to just copy the data folder of the app on the new phone to transfer data (like what happens for mac apps)?
Thank you in advance
0xCuter said:
-as previously stated the phone is not able to access internal storage, but I'm able to access it in recovery mode through adb so pulling files should not be an issue.
Click to expand...
Click to collapse
yes, if that is true all fine, you can run the Migrate_EMERGENCY_FLASHABLE.zip from recovery and restore app data on other device with Migrate
alecxs said:
yes, if that is true all fine, you can run the Migrate_EMERGENCY_FLASHABLE.zip from recovery and restore app data on other device with Migrate
Click to expand...
Click to collapse
Hey, it's me again... So, I rooted my new phone and I found the emergency_flashable.zip in the migrate thread, now I just need to flash it, but I cannot use scrcpy in recovery mode to see the screen. I guess there is a way to flash the zip from adb without the need to use the screen, but better to ask since I don't want to do stupid stuff...
yes, you can do it from adb. best is MicroSD Card as target directory. copy the zip into the target directory, mount data system vendor product, then install zip. on the first trial it will fail because packages.list needed. but it will create one you can edit. delete unwanted packages before second trial. you can repeat as often you want, existing backups won't created twice.
Code:
adb push Migrate_EMERGENCY_FLASHABLE.zip /sdcard
adb shell
# mount /system_root
# mount /system
# mount /vendor
# mount /product
# mount /external_sd
# mkdir /external_sd/Migrate
# cd /external_sd/Migrate
# mv /sdcard/Migrate_EMERGENCY_FLASHABLE.zip .
# twrp install ./Migrate_EMERGENCY_FLASHABLE.zip
# exit
adb pull /external_sd/Migrate/packages.list
edit the file with editor and push it back
https://twrp.me/faq/openrecoveryscript.html
alecxs said:
yes, you can do it from adb. best is MicroSD Card as target directory. copy the zip into the target directory, mount data system vendor product, then install zip. on the first trial it will fail because packages.list needed. but it will create one you can edit. delete unwanted packages before second trial. you can repeat as often you want, existing backups won't created twice.
Code:
adb push Migrate_EMERGENCY_FLASHABLE.zip /sdcard
adb shell
# mount /system_root
# mount /system
# mount /vendor
# mount /product
# mount /external_sd
# mkdir /external_sd/Migrate
# cd /external_sd/Migrate
# mv /sdcard/Migrate_EMERGENCY_FLASHABLE.zip .
# twrp install ./Migrate_EMERGENCY_FLASHABLE.zip
# exit
adb pull /external_sd/Migrate/packages.list
edit the file with editor and push it back
https://twrp.me/faq/openrecoveryscript.html
Click to expand...
Click to collapse
One thing I forgot to ask: do I need to root my old phone as well or is twrp sufficient?
And to root I would just need to flash Magisk the same way I would flash the emergency flashable.zip right? Or can I just "twrp install [magisk_package]" without going into the shell?
No need to root old phone, TWRP already provides root access for backup purposes. the new phone should be rooted by flashing magisk patched boot.img because the TWRP install method is deprecated. I know I gave only short hints, so don't hesitate to ask for more detailed instructions in case you don't know what to do for some specific step...
alecxs said:
No need to root old phone, TWRP already provides root access for backup purposes. the new phone should be rooted by flashing magisk patched boot.img because the TWRP install method is deprecated. I know I gave only short hints, so don't hesitate to ask for more detailed instructions in case you don't know what to do for some specific step...
Click to expand...
Click to collapse
Thank You... Yes, the new phone is rooted.
One thing that's not needed for the process but I wanted to understand is: Is there a specific reason why we "twrp install" from shell or could in theory be possible to flash the zip file directly from pc storage?
0xCuter said:
or could in theory be possible to flash the zip file directly from pc storage?
Click to expand...
Click to collapse
the reason is, the backup is created locally in the same directory where the zip file is. never tried sideload but I guess it would try to store in /tmp which is RAM.
alecxs said:
yes, you can do it from adb. best is MicroSD Card as target directory. copy the zip into the target directory, mount data system vendor product, then install zip. on the first trial it will fail because packages.list needed. but it will create one you can edit. delete unwanted packages before second trial. you can repeat as often you want, existing backups won't created twice.
Code:
adb push Migrate_EMERGENCY_FLASHABLE.zip /sdcard
adb shell
# mount /system_root
# mount /system
# mount /vendor
# mount /product
# mount /external_sd
# mkdir /external_sd/Migrate
# cd /external_sd/Migrate
# mv /sdcard/Migrate_EMERGENCY_FLASHABLE.zip .
# twrp install ./Migrate_EMERGENCY_FLASHABLE.zip
# exit
adb pull /external_sd/Migrate/packages.list
edit the file with editor and push it back
https://twrp.me/faq/openrecoveryscript.html
Click to expand...
Click to collapse
I'm trying and when I do "mount /system" from the shell I get this:
mount: '/system' not in fstab
Click to expand...
Click to collapse
Is it normal?
it's either /system_root or /system so one of it will fail. I just listed both.
alecxs said:
it's either /system_root or /system so one of it will fail. I just listed both.
Click to expand...
Click to collapse
I suspected that... is it the same for product and external_sd?
Only system_root and vendor went through
/external_sd is the mount point for MicroSD Card, it may have a different name like /sdcard1 or something. if you have enough disk space on /data, no need for external SD.
/product is maybe not needed, just running with /system_root + /vendor is fine.
alecxs said:
/external_sd is the mount point for MicroSD Card, it may have a different name like /sdcard1 or something. if you have enough disk space on /data, no need for external SD.
/product is maybe not needed, just running with /system_root + /vendor is fine.
Click to expand...
Click to collapse
There is no external MicroSD on Oneplus 6... can I put the migrate folder in /sdcard?
Also, I think I should delete some stuff from storage to make space, since I already pulled it on the pc
/sdcard = /data/media can be used. you can split the packages.list file into few parts so it fits in remaining disk space.
alecxs said:
/sdcard = /data/media can be used. you can split the packages.list file into few parts so it fits in remaining disk space.
Click to expand...
Click to collapse
I tried the install and I get this, even though the zip file is in the same folder I'm in (it even autocompletes from terminal)
OnePlus6:/sdcard/Migrate # ls
Migrate_EMERGENCY_FLASHABLE.zip
OnePlus6:/sdcard/Migrate # twrp install Migrate_EMERGENCY_FLASHABLE.zip
Unable to locate zip file 'Migrate_EMERGENCY_FLASHABLE.zip'.
Installing zip file 'Migrate_EMERGENCY_FLASHABLE.zip'
Error installing zip file 'Migrate_EMERGENCY_FLASHABLE.zip'
Done processing script file
Click to expand...
Click to collapse
make sure you give a path to zip file on install, like ./ or full path. it will fail on first execution. check if packages.list was created successfully.
alecxs said:
on the first trial it will fail because packages.list needed. but it will create one you can edit.
Click to expand...
Click to collapse
you can always pull recovery.log afterwards to see what's going on.
Code:
adb pull /tmp/recovery.log
alecxs said:
make sure you give a path to zip file on install, like ./ or full path. it will fail on first execution. check if packages.list was created successfully.
you can always pull recovery.log afterwards to see what's going on.
Code:
adb pull /tmp/recovery.log
[/cod
[/QUOTE]
Click to expand...
Click to collapse
It launched with the full path. I didn't edit the package.list file and I launched it again.
I got a lot of "migrate.sh: failed:..." and just a few "migrate.sh: finish:..." mostly for system apps, but honestly I really only need to backup whatsapp...
...
Click to expand...
Click to collapse
migrate.sh: failed: com.intsig.lic.camscanner
migrate.sh: failed: com.android.theme.icon_pack.ci
migrate.sh: failed: com.google.android.apps.restor
migrate.sh: 397x packages failed / 0x already exist
# MIGRATE_STATUS: backup finished (27/424)
# DONE.
#
# exiting script
#
# # # # # # # # # # # # # # # # # # # # # # # # # #
Updater process ended with ERROR: 1
I:Install took 69 second(s).
Error installing zip file 'sdcard/Migrate/Migrate_EMERGENCY_FLASHABLE.zip'
Done processing script file
Click to expand...
Click to collapse
These are the things that have been backed up:
OnePlus6:/sdcard/Migrate # ls
Backup_android Backup_com.google.android.networkstack
Backup_com.android.bluetooth Backup_com.google.android.packageinstaller
Backup_com.android.cellbroadcastreceiver Backup_com.oneplus.screenshot
Backup_com.android.emergency Backup_com.qualcomm.qti.cne
Backup_com.android.inputdevices Backup_com.qualcomm.qti.poweroffalarm
Backup_com.android.location.fused Backup_com.qualcomm.qti.smq
Backup_com.android.phone Backup_com.qualcomm.qti.uceShimService
Backup_com.android.providers.blockednumber Backup_org.ifaa.aidl.manager
Backup_com.android.providers.settings Backup_se.dirac.acs
Backup_com.android.providers.telephony Backup_vendor.qti.hardware.cacert.server
Backup_com.android.proxyhandler Migrate_EMERGENCY_FLASHABLE.zip
Backup_com.android.server.telecom backup_app_and_data.sh
Backup_com.android.settings busybox
Backup_com.android.shell migrate.log
Backup_com.android.stk migrate.sh
Backup_com.android.systemui packages.list
Backup_com.google.android.ext.shared readme.txt
Click to expand...
Click to collapse

Question cant mount System RW | on rooted Xiaomi.eu Rom / Magisk

in TRWP also i cant mount Data so i cant flash any SystemRW script.
i tried a script to flash and after that could change only permissions of folders or files, but dont open them (says is read only)
i used several explorers. Also any root apps trying changing build prop come up with a failure.
But i have root access.
i used the script from here Link but it came up with try manuallayy flash via TWRP...but TRWP cant mount Data...
AiTakako said:
in TRWP also i cant mount Data so i cant flash any SystemRW script.
i tried a script to flash and after that could change only permissions of folders or files, but dont open them (says is read only)
i used several explorers. Also any root apps trying changing build prop come up with a failure.
But i have root access.
i used the script from here Link but it came up with try manuallayy flash via TWRP...but TRWP cant mount Data...
Click to expand...
Click to collapse
Flash the script via adb command under TWRP or use microSD card or USBOTG.
pl1992aw said:
Flash the script via adb command under TWRP or use microSD card or USBOthx
Click to expand...
Click to collapse
thx i tried but apsways say cant mount data
AiTakako said:
in TRWP also i cant mount Data so i cant flash any SystemRW script.
i tried a script to flash and after that could change only permissions of folders or files, but dont open them (says is read only)
i used several explorers. Also any root apps trying changing build prop come up with a failure.
But i have root access.
i used the script from here Link but it came up with try manuallayy flash via TWRP...but TRWP cant mount Data...
Click to expand...
Click to collapse
you need to modify the flashable zip to be compatibe to android 12 and you may use a beta version of orangefox for data partition to be mounted and decrypted

Categories

Resources