Hello.
I connect to phone using adb shell. Is there anyway to edit hosts file?
I would like manually add some line (from adaway source).
The bootloader is locked, phone is not rooted and I don't want to root it.
So is there anyway to mount /system as rw and edit the hosts file?
Thanks in advance !
No, the host file is system integrated and not writable as normal user, even with adb.
You need to be rooted or use an AdBlock App from PlayStore.
Ok, thanks.
pp
There were some forum thread, were was explain how to remove system apps via abd, without rooting the device. Can you help me find it?
I think you mean this: https://www.xda-developers.com/uninstall-carrier-oem-bloatware-without-root-access/
It was somewhere in huawei forum.
I can't remember P or Mate series.
I think that could work.
btw
Can uninstalled apps be restored?
Yes it was also in the Huawei form, but it used the same approach. I believe the 'removed' apps can be restored by a factory reset.
Related
EDIT: Fixed! Procedure I used was to download Danifunker's system dump, move it to /sdcard/ via adb push, then run the following:
Code:
adb shell
su dd if=/sdcard/mmcblk1p21.img of=/dev/block/mmcblk1p21
This completely refreshed my /system folder. Original post below:
--------------------------------------------------------------
Hello XDA forumgoers, longtime reader first time poster here. I'm currently posting because I made a few mistakes. Several mistakes, actually.
1. In my quest to de-bloat my XT860, I accidentally removed one file too many, which caused my phone to mysteriously not have a cell signal. (com.motorola.service.main kept crashing.) So I hit the forum and grabbed a system dump from this thread (thanks Willis111):
http://forum.xda-developers.com/showthread.php?p=17501981
I had bought the phone with some version of Cyanogenmod Recovery installed by the previous owner, so I was able to use that and ADB to stick the .apks and .odex files in the /system/app folder, chmod 644 them, and even factory reset for good measure.
2. As I soon found out, I had somehow made things worse. The phone, when boot into, shows the "press android to begin" page, but com.motorola.service.main and some other apps keep FCing on me, and I can't progress past that screen. In my haste, I didn't backup any of my system folders at all, though, I still backed up my apps with Titanium.
Tl;dr:
presumably none of the /system/app apks boot, most notably com.motorola.service.main. How do I fix this? Can I?
Try to flash
http://forum.xda-developers.com/showthread.php?t=1288823
You also need to chown 0:0 both the apk and the odex
Have you tried using my original system dump? It was taken with dd, so things like symlinks and the other sort should be functional. The only caveat is that a number of apps were frozen at the time, so you may need to unfreeze them with titaniumbackup.
http://www.multiupload.com/SORQERFAYT
DoubleYouPee: Is this that chinese rom I've heard of? I heard that if I flash this, I can't root my phone. So I think I'll save this one as a last resort.
eww245: chown'd, no result.
daniflunker: how do I open this?
jonsicoli said:
DoubleYouPee: Is this that chinese rom I've heard of? I heard that if I flash this, I can't root my phone. So I think I'll save this one as a last resort.
eww245: chown'd, no result.
daniflunker: how do I open this?
Click to expand...
Click to collapse
What about rootkeeper?
DoubleYouPee said:
What about rootkeeper?
Click to expand...
Click to collapse
I can't get past the "click android" screen, so I probably can't install or run it. Any way to do it via adb or Cyanogenmod Recovery?
I really appreciate the help.
jonsicoli, if you want to restore your *entire* /system folder (not just apps) you would run a similar command-set as this.
1. Copy the file to the internal memory
adb push c:\path.to.folder\mmcblk1p21.img /sdcard
the file will be located in the root of the sdcard (or you could drag and drop the file in USB storage mode)
2. Do a full restore on system memory *I have not checked to ensure this is working... but a command similar to this should work
adb shell
su dd if=/sdcard/mmcblk1p21.img of=/dev/block/mmcblk1p21
- wait -
(it would have to write about 500mb and replace all of the contents of /system )
reboot
_______________________________________________________
Okay, if you just want to look at the files, you could use a linux machine to mount the filesystem (it is a standard ext3 FS) or you could do what I have done on my windows system:
Install EXT2FsD from http://sourceforge.net/projects/ext2fsd/files/latest/download?source=files
Then install OSFMount from http://www.osforensics.com/tools.html
Point the OSFMount program to the img file that you downloaded and assign it a drive then voilla!
I am pretty sure this is a bit of overkill, but this should completely restore your system close to factory (minus the APKs that were upgraded/disabled, plus the fact root was done)
Thanks Danifunker! I reset my entire /system folder, and restoring my user app backup. I'm just relieved to have my phone back. Now to mark this thread as solved.
Awesome!!!!!! Glad to hear my system dump works! Thanks for testing
My command lines were written correctly also I guess?
Sent from my XT860 using XDA App
searched for like 8 hours until i found this thread. Just what i needed, i had system image for 2.3.6 from your other post but no command.
Hi
I bought my P7 a couple of weeks ago and updated it to B609 (4.4.2 EMUI 3.0). I have tried to install AdAway and AdFree multiple times but they don't manage to change the hosts file or block any ads. I've tried changing the permissions using Root Explorer but it has been unsuccessful. I rooted using RootGenius and I have SuperSU (for some reason it has failed to update the binary today, haven't figured it out yet). I haven't installed CWM or any customs ROMs yet.
I'm not sure what the problem is since AdFree worked perfectly from the start on my last phone with 4.0.4.
Please help me.
Thanks!
karliyo said:
Hi
I bought my P7 a couple of weeks ago and updated it to B609 (4.4.2 EMUI 3.0). I have tried to install AdAway and AdFree multiple times but they don't manage to change the hosts file or block any ads. I've tried changing the permissions using Root Explorer but it has been unsuccessful. I rooted using RootGenius and I have SuperSU (for some reason it has failed to update the binary today, haven't figured it out yet). I haven't installed CWM or any customs ROMs yet.
I'm not sure what the problem is since AdFree worked perfectly from the start on my last phone with 4.0.4.
Please help me.
Thanks!
Click to expand...
Click to collapse
read the thread of how to root ascend p7 http://forum.xda-developers.com/ascend-p7/general/rooted-p7-l10-609-t3003605 ...you have to remove a file (set_immutable.list) in order to have a 100% root...if you don't remove this file you can't edit /system partition (and of course change host file)
usb2 said:
read the thread of how to root ascend p7 http://forum.xda-developers.com/ascend-p7/general/rooted-p7-l10-609-t3003605 ...you have to remove a file (set_immutable.list) in order to have a 100% root...if you don't remove this file you can't edit /system partition (and of course change host file)
Click to expand...
Click to collapse
Instead of deleting set_immutable.list, you can edit it and comment (with #) /system/etc line.
Before editing, you will have to use "chattr -i set_immutable.list" to remove immutable flag.
After editing you can put the flag back "chattr +i set_immutable.list".
Maybe you will have to remove immutable flag from the /system/etc/hosts file as well.
Hosts file should have immutable flag turned off.
First operation is of course rooting the phone.
Thanks guys.
I managed to fix it by flashing the device again, removing the .list file and installing Busybox.
Hi everyone
I'm trying to get the infamous GPS Location Spoofer installed as a system app on my rooted HTC phone, but so far no luck, so I figured I would try to ask for help here, in case anyone went through a similar situation, or knows what I've been doing wrong. This is what I tried so far:
Installed the app from Google App store, and using File Explorer with root , tried to move the app folder to /system/app or /system/priv-app, , but pasting the folder there would result in an instant reboot and the app would not be there.
So I installed lucky patcher , and using apk downloader, downloaded the apk file from the App Store, copied it over to the phone, and used the "Rebuild and Install" option, choosing the option to install it as a system app , and it would process it and say that the installation was sucessfull, needs to reboot to complete, but after the reboot the app would not be there (not only not showing on the apps list, but navigating to the /system folder with File Explorer and checking app and priv-app I could verify that it was not installed).
SO I tried to use adb shell to do the work , and this is what I did:
mount -o remount /dev/block/mmcblk0p35 /system
to mount the /system filesystem as read write , and it did
cp /sdcard/Download/com.incorporateapps.fakegps.fre-55.apk /system/app
to copy the file under /system/app
chmod 644 com.incorporateapps.fakegps.fre-55.apk
to set the permissions as required
and reboot the phone, but after the reboot, the file would not be there. I tried also to create a folder under /system/app named com.incorporateapps.fakegps.fre-55, move the apk inside; installing normally , changing the mount point to read-write and moving it from /data/app to /system/app or /system/priv-app using the shell and chaning ownership / permissions , but the app will not stick , either rebooting or just re-mounting the filesystem as read-only again will cause everything that was done to be lost; and after trying any of the above one time, doing it for a second time would cause the phone to reboot.
I figure that there must be an image of the /system mount point somewhere , which gets installed every time there is a remount to read-only or reboot , or something of that nature, that will cause any changes made under /system to be lost. Maybe I'm wrong but it seems to be related to HTC phones, since there's load of people doing it on other models without issues, or maybe I'm doing something wrong, since I'm no android expert
Does anyone knows what could be the issue, or what can I do ? I searched the net quite a bit for a solution to no avail (here as well), any help is appreciated
Thanks
sasteck said:
Hi everyone
I'm trying to get the infamous GPS Location Spoofer installed as a system app on my rooted HTC phone, but so far no luck, so I figured I would try to ask for help here, in case anyone went through a similar situation, or knows what I've been doing wrong. This is what I tried so far:
Installed the app from Google App store, and using File Explorer with root , tried to move the app folder to /system/app or /system/priv-app, , but pasting the folder there would result in an instant reboot and the app would not be there.
So I installed lucky patcher , and using apk downloader, downloaded the apk file from the App Store, copied it over to the phone, and used the "Rebuild and Install" option, choosing the option to install it as a system app , and it would process it and say that the installation was sucessfull, needs to reboot to complete, but after the reboot the app would not be there (not only not showing on the apps list, but navigating to the /system folder with File Explorer and checking app and priv-app I could verify that it was not installed).
SO I tried to use adb shell to do the work , and this is what I did:
mount -o remount /dev/block/mmcblk0p35 /system
to mount the /system filesystem as read write , and it did
cp /sdcard/Download/com.incorporateapps.fakegps.fre-55.apk /system/app
to copy the file under /system/app
chmod 644 com.incorporateapps.fakegps.fre-55.apk
to set the permissions as required
and reboot the phone, but after the reboot, the file would not be there. I tried also to create a folder under /system/app named com.incorporateapps.fakegps.fre-55, move the apk inside; installing normally , changing the mount point to read-write and moving it from /data/app to /system/app or /system/priv-app using the shell and chaning ownership / permissions , but the app will not stick , either rebooting or just re-mounting the filesystem as read-only again will cause everything that was done to be lost; and after trying any of the above one time, doing it for a second time would cause the phone to reboot.
I figure that there must be an image of the /system mount point somewhere , which gets installed every time there is a remount to read-only or reboot , or something of that nature, that will cause any changes made under /system to be lost. Maybe I'm wrong but it seems to be related to HTC phones, since there's load of people doing it on other models without issues, or maybe I'm doing something wrong, since I'm no android expert
Does anyone knows what could be the issue, or what can I do ? I searched the net quite a bit for a solution to no avail (here as well), any help is appreciated
Thanks
Click to expand...
Click to collapse
Are you using stock kernel?
donkeykong1 said:
Are you using stock kernel?
Click to expand...
Click to collapse
Yes, kernel is the default that comes with the phone (3.4.10.g96cae32 , android 5.0.2)
sasteck said:
Yes, kernel is the default that comes with the phone (3.4.10.g96cae32 , android 5.0.2)
Click to expand...
Click to collapse
And there's your problem. Stock kernel has system write protection, so you can't mount system as writeable. You can, but after reboot, it comes back to read only, and nothing will stick into system partition. You have 2 choices now - disable system write protection on stock kernel, or flash a custom kernel
donkeykong1 said:
And there's your problem. Stock kernel has system write protection, so you can't mount system as writeable. You can, but after reboot, it comes back to read only, and nothing will stick into system partition. You have 2 choices now - disable system write protection on stock kernel, or flash a custom kernel
Click to expand...
Click to collapse
oh I see.. didn't know about that , thanks! I'll check about disabling system write protection , otherwise look for a custom kernel, never did it before but will give it a try
donkeykong1 said:
And there's your problem. Stock kernel has system write protection, so you can't mount system as writeable. You can, but after reboot, it comes back to read only, and nothing will stick into system partition. You have 2 choices now - disable system write protection on stock kernel, or flash a custom kernel
Click to expand...
Click to collapse
Shhhhhh, don't help him, he's going to steal everyone's pokemons
Sent from my HTC One using XDA Labs
alray said:
Shhhhhh, don't help him, he's going to steal everyone's pokemons
Sent from my HTC One using XDA Labs
Click to expand...
Click to collapse
Ooooohhh... That's why he's trying the spoofer.... If I knew, I wouldn't help at all [emoji6]
donkeykong1 said:
Ooooohhh... That's why he's trying the spoofer.... If I knew, I wouldn't help at all [emoji6]
Click to expand...
Click to collapse
Sorry you feel that way, but I appreciate the help anyway. This is something that I never tampered with before, so I still had some doubts about the process, but I am liking the whole thing and will install a custom rom on my own phone, been reading about the Ressurection rom and it looks very nice, will try it as soon as I'm better informed
sasteck said:
Sorry you feel that way, but I appreciate the help anyway. This is something that I never tampered with before, so I still had some doubts about the process, but I am liking the whole thing and will install a custom rom on my own phone, been reading about the Ressurection rom and it looks very nice, will try it as soon as I'm better informed
Click to expand...
Click to collapse
That was a joke mate. I don't care what you do with your phone, but I'm here to help if I can [emoji6]
First of all, I found this guide under the S7 Edge section on XDA. I tried it and it worked on my rooted A70, so I wanted to share it here.
There are two methods. One of them needs root access, and the other doesn't. I didn't try the one which doesnt need root access.
METHOD 1 (NEEDS ROOT)
1- Install a file explorer which can access and edit system folders.
2-Find build.prop and copy it.
3-Paste it to your main storage.
4-Open it with a text editor and go to the end of the lines.
5-You will see a line which says "ro.config.tima=1". Turn it into "ro.config.tima=0".
6-Save and copy new edited build.prop.
7-Paste it to it's original place and overwrite it.
8-Reboot your phone and check Samsung Health.
Rootless method is not working but if you want to test it, test it:
METHOD 2 (DOESN'T NEED ROOT)
I DIDN'T TRY THIS AND I AM NOT SURE IF IT WORKS
1-Uninstall the Samsung Health App.
2-Install Samsung Health version 4 https://www.apkmirror.com/apk/samsung-electronics-co-ltd/s-health/s-health-4-5-1-0011-release/s-health-4-5-1-0011-android-apk-download/
3-Launch the app and follow the steps to complete setup.
4-Update it via Google Play.
Thanks to @CuBz90
The non root method doesn't seem to work. App not installing.
sreedevtali said:
The non root method doesn't seem to work. App not installing.
Click to expand...
Click to collapse
Thanks for testing, I wasn't already giving it chance. I will note that it is not working.
How did you edit the /system? I am having trouble mounting it with read write privileges. My phone is rooted. Unable to "adb root" or mount system r/w. My multiple file explorer apps have had root access granted by magisk but I am still not able to replace it. I tried deleting it to see if I would be able to. I was able to but unable to paste the updated build.prop back into system. Had to reflash ??
cealaska said:
How did you edit the /system? I am having trouble mounting it with read write privileges. My phone is rooted. Unable to "adb root" or mount system r/w. My multiple file explorer apps have had root access granted by magisk but I am still not able to replace it. I tried deleting it to see if I would be able to. I was able to but unable to paste the updated build.prop back into system. Had to reflash
Click to expand...
Click to collapse
I think you're having trouble with pasting (overwriting) the edited build.prop.
I am using FX File Manager with root addon. You can try it. And, do NOT forget to give read/write acces to fx. To do so, when you open /system section you will see a lock icon on somewhere (top right) as I remember. Click it and give permission. Then paste the edited build.prop onto the original one.
Write here if you have any other problem.
Samsung Health
It’s very strange - my old Lenovo tablet, A3300 a firmware ResurectionRemix, Android 7, calmly sees and sets Samsung health from the playmarket. WADW? (What am I doing wrong?):смех:
So I have been rooting phones for years. I have taken a stab at rooting the S8 tab. I used many Root Explorers. I cannot delete system files or modify them. I paid for Root Explorer since im familiar with that app. Still no luck. Any idea what I can do? Thanks for your help in advance.
GhostVengeance said:
So I have been rooting phones for years. I have taken a stab at rooting the S8 tab. I used many Root Explorers. I cannot delete system files or modify them. I paid for Root Explorer since im familiar with that app. Still no luck. Any idea what I can do? Thanks for your help in advance.
Click to expand...
Click to collapse
Have you tried using Magisk?? Or using Traditional Root? And for what reason do you want to Delete System files, If you do by mistake delete some Critical System files, device can be in fatal situation to restore again..
Ashutosh1358 said:
Have you tried using Magisk?? Or using Traditional Root? And for what reason do you want to Delete System files, If you do by mistake delete some Critical System files, device can be in fatal situation to restore again..
Yes, im currently rooted. I tried replacing the splash screen in System/media I have tried about 5 different root explorers and gave root permission to all of them. I am very limited with this root.
Click to expand...
Click to collapse
Deleted
Since Android 11+ Google has been enforcing RO partitions only. So, what that basically means is that your partitions are only RO = Read Only, which means even if you have ROOT access there is no way of deleting anything from those partitions.
In order to be able to delete files from Partitions like System/Vendor/Product, etc... You would need to modify them by flashing certain scripts that repack/modify all the partitions and make them RW instead of RO. RW = Read/Write permission, so that means you would be able to delete files from those partitions.
There are certain scripts/mods floating around XDA that you could try to flash and make partitions RW but it's not guaranteed it would work especially if you're on the A13 currently since you would require TWRP to flash those scripts/mods and access to internal storage (You would need to force disable encryption so you can always access the storage inside TWRP.
I run a Magisk-less root on one device. I use a custom recovery to mount system and vendor r/w.
One thing that I learned is that (at least on mine) they were using FEC which is error correction.
I'd write a file and the changes would not be visible! They would be "corrected".
If you are root, look at the last 4096 bytes of the system or vendor partition.
If you see FECFECFE than that's what you have.
I'm only running Android 10 and I don't have a super partition.
(Note that to brute force modify system or vendor you need to modify your dtb, your fstab, maybe vbmeta.)
Thank you everyone for the help. Im glad I have some clarification now.