Question edit a file in /system to allow phone to boot when plugged into power source - OnePlus Nord N200 5G

Hi all,
I am trying to edit a file on /system (/system/etc/init/hw/init.rc), to allow my powered off phone to be turned on when plugged into a power source.
I have successfully gained root, however, /system is unable to be mounted as read/write. I have attempted this many ways such as re-mounting /system via FX File Explorer and root explorer or trying to remount via terminal, but I receive the error that /system can not be mounted as Read/Write.
I attempted to edit the file via TWRP file editor, and was able to successfully save, but the file reverts itself when the phone is booted. Strangely , the "HW" directory when booted into android has several *.rc files, however when viewing the directory in TWRP the only file seen is the init.rc, which differs in content than the booted version. This makes me think boot.img is writing these files each time the phone boots.
I have edited this file successfully on the 6T, which allows you to mount /system in R/W mode.
Any advice on how to edit the file, or another workaround to allow the phone to bootup when plugged into a power source?
Thanks!

Turn off secureboot

kwell24 said:
Turn off secureboot
Click to expand...
Click to collapse
Great suggestion, according to Fastboot screen Secure Boot is enabled. I googled around how to disable but the only oneplus specific suggestion was in the security settings, and this option is not listed in the Nord 200. Other suggestions also did not seem to work. Do you know how to turn off Secure Boot?

[TOOL][WIN,LIN,AND,DARW] Super image tools | extract or make partitions RW in super partition
Disclaimer: Super image tools was made for testing and educational purposes, ME is not responsible for what you do on/with your device using our tools, you must agree that you using our tools on your own risk, I am not responsible for anything...
forum.xda-developers.com
Or manually, either way I don't recommend messing with the system. Better trying to achieve it with Magisk systemless-ly

I finally figured out how to edit init.rc to allow automatic powering on when connected to a charger.
Converted T-Mobile phone to stock rom via https://forum.xda-developers.com/t/...thout-msm-tool-credit-to-summersofar.4339037/
Unpack the sys.img from the stock rom using CRB tool https://forum.xda-developers.com/t/tool-windows-kitchen-crb-v3-0-0-beta8b.3947779/
Edit init.rc according to https://forums.oneplus.com/threads/how-to-boot-oneplus-one-when-charger-connected.1170454/
Repack system.img using CRB tool
flash system.img back onto phone
Now my powered off phone will boot up when plugged into a power source! Steps 1 and 2 can probably be reversed so you just flash the edited system.img to the phone.

Related

Writing Files to System?

I am trying to install a custom boot animation.
It says to put default.xml in system/customize/CID
I tried to do this with a root explorer but it said copy failed and I cant delete the default xml that is already there. Is it because it is being used? How would I do it with the phone off?
I dont understand how.
You could just flash one. Use bootscoot2, there's a thread in development.
jedinegotiator said:
I am trying to install a custom boot animation.
It says to put default.xml in system/customize/CID
I tried to do this with a root explorer but it said copy failed and I cant delete the default xml that is already there. Is it because it is being used? How would I do it with the phone off?
I dont understand how.
Click to expand...
Click to collapse
generally, the system is normally mounted in read only at boot. before making any changes to the system partition you'll need to mount the system in read/write mode. there is an app in the market by a senior xda moderator which helps with mounting the system as read/write called remount.
if, for some reason, you aren't able to modify the file because it is in use, then putting the phone in recovery mode, will be the next best way to access the /system partition with read/write access and not have any of the /system files be in use.
loading update.zip files where people have packaged up modifications in recovery mode, generally work well because recovery mode runs as root and there is the guarantee the recovery mode does not rely on and does not use any /system files.
hope that helps!

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

Boot.img or system.img unpack / repack, different size, odin fails, no boot

Well, as the title sugests, I've tried to root my phone (Samsung Galaxy J1 SM-J100MU) and failed. Since no twrp or any other custom recovery is made for my specific model, I tried the method that involves mounting the android systems and modifying the famous build.prop, or putting su binaries inside the /system folder.
I ran an unpack script from ubuntu to decompress the boot file, and simg2img to be able to mount /system following some guides I've found, and made use of mkbootimg to repack it and flash it.
The thing is that the phone won't boot because the modified boot image size differs from the original. The system also differs but Odin won't even flash it and I'll have to reflash the stock rom.
Any ideas about what it can happen? I get no apparently errors during the process of unpacking/repacking the images so I don't know. The only thing I can think of is that the unpack script says something like "There's an extra file in ramdisk; though this file can exist, the script is not made for this type of ramdisk", so I edited the script in order to skip this warning, and everything else went well. The bootimg got unpacked and then the ramdisk and then I modified default.prop.
Well, that's it, I hope you can understand and give me some help in order to proceed.
Thank you in advance.

Can't seem to write to /system/vendor/etc

I guess I'm a moron and can't figure this out :v
Using stock rooted Oreo, Magisk, edXposed, everything that goes with them. TWRP 3.2.3-7.
Lately, I've been using my headphones while driving to work. I need a touch more volume over stock to deal with wind noise.
The problem is, I absolutely can't get /system/vendor/etc into a writable state.
Attempts to modify mixer_paths_tavil.xml whilst booted up fail, either resulting in an unreadable file (Total Commander) or just not working (Root Explorer).
Trying to flash a modified zip (just grabbed a dual-speaker mod and replaced the xml) in TWRP results in no file being created; it doesn't seem to throw an error, just silently fails.
Manually copying the xml to /system/vendor/etc using TWRP's file manager ~appears~ to work, but attempts to set permissions results in error code 1. The file doesn't exist upon reboot.
Remounting manually as RW in TWRP's terminal doesn't seem to help. And yes, "mount System as read-only" is unchecked.
I can make build.prop changes, so I know /system is writable. The only way I can get anything written to /system/vendor/etc is restoring a full system backup.
I've modified this file before; I manually tweaked the call volume higher and enabled "fake" high-impedance mode.
So I'm sure I'm doing something really stupid here. Help.
Septfox said:
I guess I'm a moron and can't figure this out :v
Using stock rooted Oreo, Magisk, edXposed, everything that goes with them. TWRP 3.2.3-7.
Lately, I've been using my headphones while driving to work. I need a touch more volume over stock to deal with wind noise.
The problem is, I absolutely can't get /system/vendor/etc into a writable state.
Attempts to modify mixer_paths_tavil.xml whilst booted up fail, either resulting in an unreadable file (Total Commander) or just not working (Root Explorer).
Trying to flash a modified zip (just grabbed a dual-speaker mod and replaced the xml) in TWRP results in no file being created; it doesn't seem to throw an error, just silently fails.
Manually copying the xml to /system/vendor/etc using TWRP's file manager ~appears~ to work, but attempts to set permissions results in error code 1. The file doesn't exist upon reboot.
Remounting manually as RW in TWRP's terminal doesn't seem to help. And yes, "mount System as read-only" is unchecked.
I can make build.prop changes, so I know /system is writable. The only way I can get anything written to /system/vendor/etc is restoring a full system backup.
I've modified this file before; I manually tweaked the call volume higher and enabled "fake" high-impedance mode.
So I'm sure I'm doing something really stupid here. Help.
Click to expand...
Click to collapse
Don't know, but tonight or tomorrow I'll shoot you a file to test.
ChazzMatt said:
Don't know, but tonight or tomorrow I'll shoot you a file to test.
Click to expand...
Click to collapse
Appreciated, but I think something's going pear-shaped and I just need to reflash the ROM; setting up for the drive home last night, it seems I've lost the ability to use direct output in Poweramp. I don't know how, since the system+system image backup I restored is known-good and audio is otherwise working.
Good ol' bitrot, I suppose.
Septfox said:
Appreciated, but I think something's going pear-shaped and I just need to reflash the ROM; setting up for the drive home last night, it seems I've lost the ability to use direct output in Poweramp. I don't know how, since the system+system image backup I restored is known-good and audio is otherwise working.
Good ol' bitrot, I suppose.
Click to expand...
Click to collapse
See my PM.

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

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

Categories

Resources