Cant modify file? - OnePlus 8 Pro Questions & Answers

I'm trying to replace one of the files in /system/usr/keylayout but i'm getting an error telling me the system is read only.
So i've gone back to the /system folder in Root Explorer and tried to remount it as rw but nothing happens.
So i've gone in and tried to use ADB. I turned on USB Debugging and connected with ADB, used "adb shell" to get in, then every variation of deleting the file and remounting the file system i can. Every method to delete the file tells me its read only, and every method to remount it tells me that the folder isnt in /proc/mounts. If i dont specify a folder and just use /, then it runs and shows a ton of folders, but i still cant delete the file. My goal is to replace it with another.
Any ideas why? I'm rooted with magisk, newest version of platform tools on the laptop, im running OOS 11.0.4.4 IN11AA, stock rom and kernel.

Related

[Q] RESTORING Stock Apps

So I deleted a few apps and am curious as to how I go about restoring them to the phone if I say, deleted them by accident. I made a backup of all of the apps on my pc in the SDK Tools subdirectory so they are all there. Also, will installing an .odex file be the same as an .apk file? Do I need to restore the .odex files or will they automatically be rebuilt?
How did you perform this backup? With adb? Then it will be easy to put the apps back. You should just be able to use adb with the install command. Just type in adb at the command prompt and read the help instructons for install. Not sure if the install command takes care of the .odex files. You could try it and then copy them over manually if they dont get copied. I am sure once you boot the phone the default .odex will be built, just a quess on that though.
anika200 said:
How did you perform this backup? With adb? Then it will be easy to put the apps back. You should just be able to use adb with the install command. Just type in adb at the command prompt and read the help instructons for install. Not sure if the install command takes care of the .odex files. You could try it and then copy them over manually if they dont get copied. I am sure once you boot the phone the default .odex will be built, just a quess on that though.
Click to expand...
Click to collapse
I would think that pushing the files back to the original location from recovery would be the safest bet. ADB install will install it to /data and I would think that the apps being system apps originally then they don't have the signatures anyway to allow an ADB install.
I think you're right
I believe I originally used ADB to put them in Android SDK Tools/Desktop/~ folder. When I tried installing them back I don't believe it worked. I specifically remember receiving an error when trying to install the .odex file about a database issue. Assuming it's a system file I'm trying to restore, does someone have the syntax for the push command or how I go about doing that?
If you have the .apk and .odex files on your computer, or really backed up anywhere, you can install them a few ways:
ADB Method
#Prerequisites:
Make sure you have the APK files in AndroidSDK/tools.
1. Connect the phone to your computer
2. Launch a command prompt and enter the following commands:
cd C:\AndroidSDK\tools
Replace "C:\AndroidSDK\tools" with the path to the tools folder in your SDK installation.
adb install filename.apk
Replace "filename.apk" with the name of the file you're trying to install.
Actually, **** it, the ADB method works anyway, why list a bunch lol
No wait, these are original files so you should probably put them back in their original location.
Just use "adb push filename.apk /system/app", replacing filename.apk with your filename, of course..
Push it
Okay, thanks for the tips. So I guess when you have files in the system/app directory on the phone it knows automatically to look there for program installs. This is good to know.

[Q] i want swype back please!!!!

Just did everything to my g2 at once today, and lost one of my fav features; swype...i have cyanogenmod-6.1.0-RC3-vision... i went and downloaded the stock rom and pulled the apk file from it and when i installed it, it kept force closing. i even tried pushing it via abd but kept getting errors.. can someone please help
You need to grab libSwypeCore.so from /system/lib and push it to same directory on new ROM.
Sent from my T-Mobile G2 using XDA App
Just download the apk provided by oldsk00lz to recover swype from your clockwork backup. It worked for me.
http://forum.xda-developers.com/showthread.php?t=841603
what are the commands? i have a stock rom downloaded and have the swpe file s sitting on my desktop ready to go..i have the swype.apk and libswypecore.so...i tried transferring them to the app file on the root of my phone and system/lib via astro manager but it wont let me
what page is it on?
Tman0604 said:
what are the commands? i have a stock rom downloaded and have the swpe file s sitting on my desktop ready to go..i have the swype.apk and libswypecore.so...i tried transferring them to the app file on the root of my phone and system/lib via astro manager but it wont let me
Click to expand...
Click to collapse
the first line of code changes your system to READ/WRITE I use root explorer to change it back to READ-ONLY or just reboot.
Code:
adb shell mount -o remount,rw /dev/block/mmcblk0p25 /system
adb push libSwypeCore.so /system/lib
adb install Swype.apk
for the code I wrote to work for you the files need to be in the same folder that the adb.exe runs out of. this is usually located in the tools folder in the android SDK otherwise you have to type the full path ie
this is on windows 7 on my computer so file path will be different for you
Code:
adb push C:\users\etnie\downloads\G2\libSwypeCore.so /system/lib
hope that helps

Re-write damaged build.prop?

I've managed to make a typo somewhere when updating the build.prop and it hasn't written it, now my tab has a /System/build.prop.old file, but no /System/build.prop file. I've got a backup of the file, has anyone either got a valid UPDATE.ZIP file for a JK5 EU firmware version of the build.prop that I can write (will it work from the "external" SD card?) - or some other way of gaining root access via the recovery ADB shell so that i can rewrite this file, or am I going to need to reflash via Odin? I've tried creating my own update.zip file but it tells me that it can't find it, so I'm guessing it has to be on the internal SD card, which is not a lot of use as I can't mount it.
Not a big deal if I have to, I'd just rather know an alternative in case I stuff it up again
EDIT: Nevermind, I worked out how to gain root access whilst in recovery, pretty simple really - the same as the regular manual-root process but just using a different work folder. The /tmp folder is writeable in recovery mode so I just copied the rageagainstthecage binary into there via "adb push", set it to executable, ran it, killed the adb server and restarted it, reconnected and I had root access, moved the build.prop back and all is well again.
Based on this, it'd be a piece of cake to write an UPDATE.ZIP that did a full permanent shell-root and also installed busybox and superuser.apk. Any point or are people happy enough with the existing methods?

ADB vs. Root Explorer vs. Terminal on device

With certain files, SteelH describes using Root Explorer as "like trying to swap the engine of a car while it's running"
I experienced this as I tried to copy back a modified services.jar file with Root Explorer. I ended up using ADB and it worked fine.
Question 1: I did this while the phone was running/OS loaded, but ADB copy method worked while Root Explorer didn't. Why? Does ADB have higher authority in some way?
Question 2: How about using a terminal window on the phone to copy/replace files (if a computer is not handy)? Does it yield the same function/result as Root Explorer or ADB?
Question 3: If I simply want to back up the file, say services.jar or framework.apk, to be copied to SD, can I use Root Explorer for that?
Thanks.
snovvman said:
With certain files, SteelH describes using Root Explorer as "like trying to swap the engine of a car while it's running"
I experienced this as I tried to copy back a modified services.jar file with Root Explorer. I ended up using ADB and it worked fine.
Question 1: I did this while the phone was running/OS loaded, but ADB copy method worked while Root Explorer didn't. Why? Does ADB have higher authority in some way?
Question 2: How about using a terminal window on the phone to copy/replace files (if a computer is not handy)? Does it yield the same function/result as Root Explorer or ADB?
Question 3: If I simply want to back up the file, say services.jar or framework.apk, to be copied to SD, can I use Root Explorer for that?
Thanks.
Click to expand...
Click to collapse
i can't answer all of these authoritatively, but i will say
-i find adb to be the easiest way to do ANY modifications, as long as you know just a handful of commands and remember to remount. also remember to pull anything you are getting ready to mess with, just in case you bork it up. takes a lot less time to push an unmodified file than it does to do a complete restore. especially if you forgot to backup, lol
-if you have a terminal app mounted with rw privileges, you can move whatever you want wherever you want. however, referring back to my last point, adb is easier. i find that trying to type type type things out on a dinky little keyboard is a bigger pain in my butt than using my full size one, especially when i can use cut/paste from the intertubes.
-i think rooted explorere shouldn't have a problem copying a file from /system/ or /data/ to some folder on your sdcard
Thank you for the information. I just copied a file with terminal (on phone) and Root Explorer. Interesting thing: using the CP command, the file that was copied onto the SD showed the current date. The file that was copied using RE has the original date.

Unable to replace system files

I am trying to flash a touchwiz launcher and it succeeds in flashing in recovery but the files are not getting put into priv-app folder.
also, trying a copy paste using root explorer but it fails.
some files get copied but for some reason touchwiz launcher does not, any idea why?
Does Root Explorer have any option to remount /system with write permission? Nearly all File Managers with root access do it that way.
It looks like your /system is still mounted read-only. What exactly is being copied over?
Also, you can "adb shell" to the phone while on recovery, that way you have full access on the phone.

Categories

Resources