[Q] Tampering with System files - Atrix 4G Q&A, Help & Troubleshooting

Once root (administrative privileges) have been gained, are there certain files or folder that modifying them will brink the phone?
Or I could be asking the wrong question. When does the system check the signature of the file system? When it is flashed or every time it boots?

When its flashed as far as I know.

Related

[Q] Root (technically) explained

This is not a question about how to root the Atrix. I've already done that.
My question is about what actually is changed in the phone by following the root procedure. (I searched the forum but didn't find elsewhere the answers I look for).
Why do I ask?
1) Because I'd like to have a better understanding of the android OS.
2) Because I'd like to understand and know what do I need to do in case I want to unroot and return to plain stock.
My case:
(I've just rooted my Atrix. I didn't unlock it)
I've followed the "manual" procedure proposed by BriefMobile.
I can essentially understand (more or less) the commands listed (mount, remount, cp, install, chmod 6755, flash...)
What I'd like to understand better is what changes does the command
Code:
fastboot flash preinstall root.img
Does it just copy new files? Or does it copy (and replace) files on the phone?
(In the second case I'm afraid I made a mistake in not backing them up before running that command...)
Thanks in advance for your help.
Putting it in Windows terms (because Android is Linux), root is like having administrator privileges on your computer. It allows you to modify any system files that would normally be kept locked down. It also allows you to run applications, such as SetCPU, which can directly control hardware (in this case CPU frequency/speed and voltage) and low-level system files. Root in Android is comprised of two main files: the "su" binary (which is the command that applications use to invoke a request to do something with root privileges) and the SuperUser.apk (SuperUser app that's in the app drawer). The SuperUser app exists to prompt you whenever an application asks for root permission. So if you go into the terminal and type a low-level command, you'll see something like, "You do not have permission to do this". But if you type "su" before the command, it will run if you hit "Allow" on the SuperUser request.
Get it?
Product F(RED) said:
....
Get it?
Click to expand...
Click to collapse
Thanks Product F(RED) .
Yes I got it.
I already knew what rooting means in general terms.
What I really asked (sorry if I wasn't clear enough) is what does the root "physically" change on the phone.
According to your answer I assume it just adds the "su" binary and the "SuperUser" app (apart from changing some permission on some system folders) and that it doesn't replace any "stock" system file.
I also assume that these new files are extracted from the "root.img" (or "preinstall.img") files flashed by the fastboot command.
Is it so?
I was a little confused because I saw in some other forum a reference to some "stock" files wiped out in the /preinstall/app/ folder by the root process, mining the reversibility of the procedure (in case of no previous full system backup).
sphere314 said:
Thanks Product F(RED) .
Yes I got it.
I already knew what rooting means in general terms.
What I really asked (sorry if I wasn't clear enough) is what does the root "physically" change on the phone.
According to your answer I assume it just adds the "su" binary and the "SuperUser" app (apart from changing some permission on some system folders) and that it doesn't replace any "stock" system file.
I also assume that these new files are extracted from the "root.img" (or "preinstall.img") files flashed by the fastboot command.
Is it so?
I was a little confused because I saw in some other forum a reference to some "stock" files wiped out in the /preinstall/app/ folder by the root process.
Click to expand...
Click to collapse
Pretty much, yes, you're adding those two files (as well as another called BusyBox that allows other files to run, but this you can install after you root). The scenario I'm describing is that you're on a stock ROM and you just rooted your phone for the first time.
Though fastboot is present on every phone, using it to flash those two files seems to be unique to your phone because rooting methods vary from phone to phone. But basically the two most common methods are:
1. You flash a custom recovery from your computer if your phone's bootloader is not locked, and then you can flash the root files (su/SuperUser.apk) to the ROM from there or just flash a custom ROM that includes them.
or
2. You use fastboot/adb/some third-party method to root the stock ROM on your phone from your computer, then you install a custom recovery, and then you can flash custom ROMs/kernels/etc.
That /preinstall/app folder seems to be unique to your phone, but if I had to guess, it has something to do with deleting preloaded bloatware that comes with the phone. Because out of the box you can't, but once you have root permissions, you can go to that folder with a file manager to delete the APKs or use something like Titanium Backup to do it.
Product F(RED) said:
Pretty much, yes, you're adding those two files (as well as another called BusyBox that allows other files to run, but this you can install after you root). The scenario I'm describing is that you're on a stock ROM and you just rooted your phone for the first time.
Though fastboot is present on every phone, using it to flash those two files seems to be unique to your phone because rooting methods vary from phone to phone. But basically the two most common methods are:
1. You flash a custom recovery from your computer if your phone's bootloader is not locked, and then you can flash the root files (su/SuperUser.apk) to the ROM from there or just flash a custom ROM that includes them.
or
2. You use fastboot/adb/some third-party method to root the stock ROM on your phone from your computer, then you install a custom recovery, and then you can flash custom ROMs/kernels/etc.
That /preinstall/app folder seems to be unique to your phone, but if I had to guess, it has something to do with deleting preloaded bloatware that comes with the phone. Because out of the box you can't, but once you have root permissions, you can go to that folder with a file manager to delete the APKs or use something like Titanium Backup to do it.
Click to expand...
Click to collapse
Thanks again Product F(RED).
Things are clearer now.
I wasn't aware of the installation of "BusyBox" (I found it in my phone in the folder /osh/bin/)
I think the root method I used (BriefMobile) is the type 2. I didn't install a custom recovery as I'm not interested yet in flashing custom ROMs/kernels/etc.
So, to summarize...
The basic root methods (no unlock) consists in
1) install the "su" binary
2) install the "busybox" binary
3) install the "superuser.apk" app
4) change some r-w permissions
In my case (probably) the root method also wiped out some preloaded bloatware file in the /preinstall/app folder but that's not essential (unless Moto makes a check for the presence of those files before an OTA update).
They usually do check (and will fail) because OTA's are like patches; not really replacements for the whole /system/ partition. Never take an OTA when you're rooted, especially because they can do things like update and lock your bootloader, among other things. It's safer to wait until rooted versions pop up in the development section for your phone.

Disabling secure boot

firstly i request all moderators of xda in grand 2 forum,
as i am unable to post on developement section,
i am posting the thread here..
plz move it to developement section.
ok now back to topic,
try at your own risk!
i will not be responsible if anything happens to your phone
To all the users who have succesfully rooted grand 2,
there can be a way to install (flash) recovery on your phone!
i was exploring the system and i found a file in "/system" folder
called "recovery-from-boot.p"
i THINK this is the file that causes problem!
you may delete it or rename it...(renaming is safer)
once you delete it, you may flash custom recovery via ODIN
and even if the recovery gets currupted or if you cant boot into recovery, you can simply boot normally and restore the renamed or deleted file!!!
and then once again you may try to flash custom recovery from ODIN (as stock gets deleted as soon as you modify recovery-from-boot.p file)
press thanks if this post helped!
dindt find any file like u wrote.... plss provide specific path.. so we can try
Rakesh251 said:
dindt find any file like u wrote.... plss provide specific path.. so we can try
Click to expand...
Click to collapse
Its located here:
bro no such file is available.. this wont help to solve .and still custom recovery not available for grand2
how would u know that it won't help..
i only post threads as i know what i am doing.
the file which i uploaded up there is taken from MY PHONE ITSELF i.e galaxy GRAND 2..
and That FILE (recovery-from-boot.p) IS present on my phone and i m using Stock rom and not any other rom..
Same with me... none of them named exactly like you mention above.
Sent from my SM-G7102 using XDA Premium 4 mobile app
it only appears on a Stock UN-ROOTED firmware..
In order to inject custom CWM there isnt a necessity to root device.
so firstly we need to remove file that I mentioned in my previous post and inject recovery.
and via that recovery,
we can flash a custom kernel that automatically roots device!
vrushabh sutar said:
it only appears on a Stock UN-ROOTED firmware..
In order to inject custom CWM there isnt a necessity to root device.
so firstly we need to remove file that I mentioned in my previous post and inject recovery.
and via that recovery,
we can flash a custom kernel that automatically roots device!
Click to expand...
Click to collapse
Dude, if the FILE just appears in STOCK UNROOTED FIRMWARE , so how can we delete that.
Coz, to delete a /system file, we need ROOT access.
NOT POSSIBLE.
And in rooted version, the FILE is not available :victory:
00hacktheworld00 said:
Dude, if the FILE just appears in STOCK UNROOTED FIRMWARE , so how can we delete that.
Coz, to delete a /system file, we need ROOT access.
NOT POSSIBLE.
And in rooted version, the FILE is not available :victory:
Click to expand...
Click to collapse
Thank you for replying.
I know that it can't be deleted,
but one may understand the importance of that ".p" file and understand its working, as it plays a vital role in booting up recovery...
the only thing I wanna let users understand is that,
stock recovery includes that file and
it got deleted when rooted because the rooting package (eg. CF root) didnt contain the .p file
when I studied that strange file,
it consisted of mapping and accurate memory address as well as accurate size of stock recovery image in bytes,
so that whn new recovery gets flashed, it verifies with the .p file!
and talking abt modifying the .p file,
we must create a custom linux binary with zerglings and packed into .tar file which gets flashed to phone via Odin!
for build creation you can use this tool..
http://www.xda-developers.com/android/comprehensive-guide-to-the-android-build-process/?__utma=60652090.747738090.1398670920.1400078979.1400132113.21&__utmb=60652090.0.10.1400132113&__utmc=60652090&__utmx=-&__utmz=60652090.1400132113.21.12.utmcsr=google|utmccn=%28organic%29|utmcmd=organic|utmctr=%28not%20provided%29&__utmv=-&__utmk=163283131
So I found the reason behind this
It is a file used by Software Update Application to flash updates.
If you want proof go-to the data folder of the SOFTWARE UPDATER and there will be a 3mb file. Copy it to pc and open using winrar. You can see many files including boot.img.
So the author of this thread was about to update his/her phone when he found the file :thumbdown:
SO MYSTERY SOLVED
SCOOBY DOOBY DOOO
Sent from my SM-G7102
i didnt't get what you are on to...
i noticed that the Update Package (i.e the OTA) easily jumps over all the restrictions imposed by Bootloader(locked one) and gets easily flashed to the phone...
therefore the whole matter is now pointing out to the 'ro.build.fingerprint' as well as Verification of MD5 hashes linked directly to Flashing InstructionSet

[Q] How to close the update.zip file the right way

Hi everyone,
I want to eventually create an edited ROM for an Android tablet. (Very simple stuff, really. Removing apks, adding build.prop mods)
I have a working update.zip file, which re-installs the image on the tablet, through stock recovery and the install from sdcard option.
But once I unzip it,
and then zip and even re-sign it (with the tool I found by searching the forum),
the recovery says 'installation aborted', when it is verifying the package.
1. How can I avoid this from happening? I get it that closing the update.zip is done wrong. How can I pass the verification section?
2. It IS possible to push such a .zip through stock recovery, right? I want to avoid CWM and TWRP and make it as simple as possible.
Thanks.
Have you tried making the changes without the unzip-rezip step? Editing the zip contents directly inside the zip (just drag n drop, delete, etc).
dxppxd said:
Have you tried making the changes without the unzip-rezip step? Editing the zip contents directly inside the zip (just drag n drop, delete, etc).
Click to expand...
Click to collapse
I tried this, too.
I only deleted one apk from system/app and later I tried again by deleting the apk and its odex file, too.
In both cases, instead of rejecting the update instanlty, it starts the process and then stops after a few seconds.
IS it possible that there is a filesize checker text inside the image?
(or maybe a propery inside the build.prop or updater-script ?)
Any ideas, anyone?
Still no progress.
I am trying to avoid custom recovery,
(I guess that would involve re-compiling it - which I do not know how to do - or ... just asking so from someone?)
is it possible to push the update.zip through stock recovery?
iraklisvel said:
Still no progress.
I am trying to avoid custom recovery,
(I guess that would involve re-compiling it - which I do not know how to do - or ... just asking so from someone?)
is it possible to push the update.zip through stock recovery?
Click to expand...
Click to collapse
No
Stock recovery doesn't flash custom roms
Get cwm from builder.recovery.com
Press thanks :good: I'd helped :highfive:

[Q] Cube U27GT - Help with Rooting a Stock Rom and can we get a forum?

Dear Admins,
Could we get a forum setup for the Cube U27GT WiFi version? I dug around on the site a bit beforehand but didn't see one, I apologize if I missed it and please direct me there if I did.
I have this tablet and I am doing some initial basic firmware development for it and want a proper place to start putting threads.
Dear Dev Community,
I can't root this bloody thing... At least, not the rom itself. Let me explain...
I can flash the stock rom from Cube and that can be rooted using Kango Root. --Fine...
However, I can't figure out how to replicate this when I make my own rom.
Thus far, here is what I have attempted...
1. Setup dsixda's excellent kitchen on my Ubuntu workstation.
2. Unpack the rom, clean things up, manually put the boot image into the dsixda unpacked working rom folder, run dsixda's root functionality (which add SU binary to xbin and SuperSu apk file to app folder as well as do some things with the boot image file).
3. Rather than using repack with Dsixda (which makes an update.zip image which I can't use because the stock recovery environment on this device can't flash zip update files and I can't for the life of me figure out how to get and or make a working CWM or TWRP recovery image for this unit)...
4. What I do is I run commands in linux to unpack the stock rom to another directory and mount that directory, then clear out a bunch of folders and then manually copy in my files from dsixda's working folder, then repackage up my unpacked stock rom into a new system.img file.
5. Then copy my now modified boot image, system image, and also userdata image (I modify that as well as that is where most all of the chinese bloatware is loaded from) to my SP_Flash_Tool, generate new checksum.ini file and flash normally...
What I get as a result...
1. As long as I am really careful with how I copy files into my new image, the new system flashes okay (if I am not careful, after flash USB storage for some reason has a format error and the system will boot but can't mount USB storage and other odd issues ensue as a result).
2. Assuming everything flashes okay, and no issue with USB storage partition, I have SuperSU installed and when I go to use an app (ES File Explorer or Root Checker) that require's root, I do get the prompt. However none of the root functions actually work and Root Checker tells me I am not rooted.
That is as far as I have got. So as a result, I have a really nice, westernized, cleaned up rom but with no root.
Anyone have any ideas?
This is my first adventure into mod'ing MTK roms so I am sure I am doing all kinds of things wrong . I had a good bit of experience on Rockchip SoC's before this though.
Kind regards and thanks in advance!
Roman
Figured it out!
So I finally did the following rather hackish work-around...
1. Flash stock firmware...
2. Root with Kingo Root
3. Enabled ADB
4. Attach to PC and fire up MTK Droid Tools
5. Take a full backup
6. Modify the system image from the backup and make changes
7. Put that in new firmware flash package
8. Flash new firmware
YAY - Cleaned up rom, modified, with root!
Once I get it all packaged up and uploaded to mtkfirmware.com I will post a link for anyone that wants a cleaned up rom with root!
The only downfall of the above method is that it absolutely requires that the developer have a device on hand because you can't just root the stock image file (at least, I couldn't figure out how... - bleh...
Kind Regards,
Roman
Dear roman,
Thanks for your hard work.
I have a simple question (I think) and if you have the time to reply or -any other android guru- I would be thankful.
My later issue was with a U27GT cube tablet, but I have others, one for each kid, and this is more of general question.
I am reading this and other forums about how to flash tablets from PC. My question is:
Can the flashing process be done from a SD card?
Thanks a lot and regards,
Fernando
SKorea

Is it possible to modify system files after flashing a firmware?

Hi, I have a rooted Lenovo B device (Mediatek M6735M) with TWRP recovery. I tried to change some build.prop values using an editor app but the result was I bricked my phone (and had to flash stock firmware again). Now, I wonder if and how I can apply some changes to the system files after flashing the firmware.
I want to ask you: is it possible to modify sys/system files after the firmware has been flashed (even the read-only ones), or is pre-flash manipulation the only solution? For example: is it safe to pull a system file with adb, modify it, then push it to the phone with adb?
Black Heretic said:
Hi, I have a rooted Lenovo B device (Mediatek M6735M) with TWRP recovery. I tried to change some build.prop values using an editor app but the result was I bricked my phone (and had to flash stock firmware again). Now, I wonder if and how I can apply some changes to the system files after flashing the firmware.
I want to ask you: is it possible to modify sys/system files after the firmware has been flashed (even the read-only ones), or is pre-flash manipulation the only solution? For example: is it safe to pull a system file with adb, modify it, then push it to the phone with adb?
Click to expand...
Click to collapse
No. You want to root your android again to do these.
Ashwinrg said:
No. You want to root your android again to do these.
Click to expand...
Click to collapse
I forgot to say that I rooted the phone again. I'd like to know if it is possible to edit system files after flashing a firmware (and rooting the phone) or if I'm forced to apply all system changes before flashing. Also, I'd like to know what kind of changes are allowed and/or forbidden (in order to avoid another brick).
For example, I found a read-only "serialno" file in "sys" folder and this file contains the serial number of the device. Could I pull this file with adb, change the content of this file (with another serial number) then push it into the phone?
Black Heretic said:
I forgot to say that I rooted the phone again. I'd like to know if it is possible to edit system files after flashing a firmware (and rooting the phone) or if I'm forced to apply all system changes before flashing. Also, I'd like to know what kind of changes are allowed and/or forbidden (in order to avoid another brick).
For example, I found a read-only "serialno" file in "sys" folder and this file contains the serial number of the device. Could I pull this file with adb, change this file (with another serial number) then push it into the phone?
Click to expand...
Click to collapse
You can change anything after rooting your phone. Make sure you are doing it correctly. Keep nandroid backup to recover from bad scenarios.
Ashwinrg said:
You can change anything after rooting your phone. Make sure you are doing it correctly. Keep nandroid backup to recover from bad scenarios.
Click to expand...
Click to collapse
Ok, but I'd like to have some general tips or advices before doing that. For example, I read (somewhere, here on xda) that file permissions have to be the same as the original file, so if I edit a read-only file I have to restore its read-only status or I could brick the phone. Is this true?
Black Heretic said:
Ok, but I'd like to have some general tips or advices before doing that. For example, I read (somewhere, here on xda) that file permissions have to be the same as the original file, so if I edit a read-only file I have to restore its read-only status or I could brick the phone. Is this true?
Click to expand...
Click to collapse
Yes. If you change permission to read-write then after modification you want change permission to read-only.
Grab ithat build.prop file and transfer to memory card using TWRP. Edit at PC and restore it

Categories

Resources