Related
Hey there,
this is my first thread ever created by me in a development forum.
I wanted to share my sollution for a adfree Android system, without unlocking the boatloader to get R/W access to /system.
I did try it on my device, everything went fine, but i will not take any kind of reponsibility for your devices. Also your warranty may be void!
What you need:
- rooted XTZ (i tried it on the 16GB Wifi only version)
- busybox installed
- Android SDK or adb.exe
- patched hosts file, I took mine from my HTC ONE with adaway installed (unzip first)
Click to expand...
Click to collapse
How to do it:
- get a patched hosts file from another device, or use mine (attached)
- put the file on the root of your sd card (so it will be /sdcard/hosts)
- connect your tablet to your PC, make sure usb debuggig is turned on
- launch cmd window, where your adb.exe is located
- entering following commands:
Code:
0. adb shell
1. su
2. stop ric
3. busybox pkill -f /sbin/ric
4. mount -ro remount,rw /system
5. busybox cp -af /sdcard/hosts /system/etc/hosts
- if everything went ok, you should now be able to see all the entries in your /system/etc/hosts file
- sadly you have to update the file if there some new adhosts, but it will remove a lot of annoying ads from all apps and the browser
- the changes are permanent, even at a reboot
Click to expand...
Click to collapse
Just let me know, if you have some kind of questions!
thanks @juanyunis for the [TEMPORAL-FIX] Remount RW /system reboot thread, from which i got some ideas.
Greetings from Germany
I have been using the AdAway app continuously since Google decided to eliminate all ad blocking apps from its Play Store and from my experience, AdAway does not require an unlocked boot loader to work, it only requires root access, and AdAway has no problem installing a hosts file in the /system/etc directory, so I am curious about why you have to go through all that.
The problem is, that if you using vroot like i did, and you doing nothing else, you don't have read write access to /system. So adaway, adfree and whatever can't edit the hosts file. Therefore is my little mod to get it done manually
Havoc2k said:
The problem is, that if you using vroot like i did, and you doing nothing else, you don't have read write access to /system. So adaway, adfree and whatever can't edit the hosts file. Therefore is my little mod to get it done manually
Click to expand...
Click to collapse
after vroot, install SuperSU and then all app ad-blocking apps are working good.
nope sorry, i did it, installed vroot, switched to normal superSU and installed busybox. But there is no RW access, so the ad blocking apps will work, but only to the next systemreboot / userswitch
tried all of them, and tried to manually edit the host file, but without access it will not happen
greetings
Havoc2k said:
But there is no RW access
Click to expand...
Click to collapse
strange thing that with root there is no RW access.
Havoc2k said:
nope sorry, i did it, installed vroot, switched to normal superSU and installed busybox. But there is no RW access, so the ad blocking apps will work, but only to the next systemreboot / userswitch
tried all of them, and tried to manually edit the host file, but without access it will not happen
greetings
Click to expand...
Click to collapse
I have tested and have for several months ran AdAway on my XTZ, on which Vroot was used to gain root access and SuperSU is installed, and AdAway has no problem writing a hosts file to the /system/etc directory even though the permissions for the /system and /system/etc directories are set to read-only. So, because I have no problem with AdAway and you apparently have a problem with AdAway, I believe it is likely there is a flaw in your root access setup. But hey, I could be wrong.
Just upgrade to android 6.0.1 and redoing the root,busybox stuff
While rooting, I learn that /system is quite packed. After a few research time, many suggest that to place something in /system, delete some system app(particularly those available at Play Store, e.g. Sheets, Slides, Google Music, etc). So I delete some of them and thought I can flash busybox easily.
I was wrong.
Even I go to TWRP and mount /system rewritable, no matter I use "adb push" or "cp (in adb shell)" to place busybox into /system/xbin, they tell me there is no space.
But if a use "df" in adb shell, non su mode, it tells me there are 14.7MB, while my busybox binaries only 1.05MB.
Do anyone got idea to solve this and so kind to help me? Thank you.
xerubium said:
Just upgrade to android 6.0.1 and redoing the root,busybox stuff
While rooting, I learn that /system is quite packed. After a few research time, many suggest that to place something in /system, delete some system app(particularly those available at Play Store, e.g. Sheets, Slides, Google Music, etc). So I delete some of them and thought I can flash busybox easily.
I was wrong.
Even I go to TWRP and mount /system rewritable, no matter I use "adb push" or "cp (in adb shell)" to place busybox into /system/xbin, they tell me there is no space.
But if a use "df" in adb shell, non su mode, it tells me there are 14.7MB, while my busybox binaries only 1.05MB.
Do anyone got idea to solve this and so kind to help me? Thank you.
Click to expand...
Click to collapse
yes, google did it on purpose. its not full, but it is. use a root file explorer, delete some apps, reboot. then youll be fine after
An alternative solution is to backtrack your modifications to /system and install SuperSU in systemless mode. Installing Busybox afterward will send the files to the /su/xbin directory. As a bonus, Android Pay should function normally.
Use a root explorer or in TWRP mount system and delete /system/app/(any foreign keyboards you don't need, such as GoogleHindiIME, GoogleJapaneseIME, GooglePinyinIME, KoreanIME)
I used systemless root. Then I could install busybox at /su/xbin instead?
And just for report, it seems uninstall won't help without manual deletion of /system/app, all system apps I uninstalled through Titanium Backup automatically revived after reboot.
Sent from my Nexus 6 using XDA Free mobile app
I don't know about the other busybox installers, but Stericson's busybox installer does have /su/xbin as an available install location if systemless root is detected.
I have a Samsung Galaxy J1, runnning Android 4.4.4 and TWRP 2.7.1. My phone has only 2.1GB of usable storage space.
As I installed using a zip file, SuperSU was a system app and cannot be moved to my SD card. This app was taking up 300ish MB on my system, and it came to the point where I couldn't even send a voice note on WhatsApp any more because of the little free space I had. When I saw that SuperSU was taking this much space, I tapped the [Uninstall Updates] button, finished uninstalling and my phone froze. It stayed frozen for about 3 minutes, when it started getting really hot. Then I removed the battery.
Upon restarting, the phone was very slow and unresponsive. I figured it could be a memory leak caused by some app, so I ignored it. However, my phone started locking up completely. I restarted again, opened SuperSU and disabled root since I thought that could be the cause of the slowness. It became more responsive, however apps like FolderMount and Kernel Aduitor stopped working. So I tried to fix it.
I went and flashed the latest SuperSU zip, but that did not fix the problem. I updated the binary from within the app, but that didn't work either. I selected [Cleanup for permanent unroot] inside the app, restarted, reflashed the zip and tried again. Nada. Finally, I went and dirty flashed my phone's stock firmware through Odin, reflashed TWRP, then SuperSU and that still didn't work.
I then hit up adb shell on my computer and entered the terminal, doing some /system exploration. I went to /system/xbin and noticed the lack of a su file. I then grabbed the file from my properly rooted Galaxy Tab 3 running CM 13 and SuperSU, then I pushed the file to /system/xbin using my recovery and set the persmissions to 777. I then enabled Superuser from within SuperSU, ran the su command in adb shell and got a "not executable: magic 7F45" error. I tried disabling and reenabling root in SuperSU, and then the system just hanged at the su command.
So can someone guide me into fixing my root? Lots of functions such as a custom LMK curve (for browsing Reddit using Sync and listening to music using Poweramp at the same time [having low RAM is a struggle]) and using FolderMount (to mount my massive WhatsApp folder onto my memory card to save on storage space) depend on it.
TWRP 3.0.2 and systemless supersu 2.79
You must unlock bootloader first
From bootloader menu
*- To permanently install
fastboot flash recovery (TWRP files name)
*- Running TWRP without installing
Fastboot boot (twrp files name)
download
TWRP 3.0.2 android M
TWRP 3.0.2 Android N (Android wear 2.0)
systemless Wear SU 2.79 from
https://forum.xda-developers.com/apps/supersu/android-wear-6-0-1-root-squashfs-t3319097
To CHANGE (ADDING or EDITING) APN
edit or add apn on two files (APN-Name and value MUST MATCH between these two files)
The watch select and display APN selection based on MCC and MNC value that stored under the SIM card
(you can see the sim card value under telephony.db under siminfo data)
*- apns-conf.xml
/system/etc/apns-conf.xml
*- telephony.db
/data/data/com.android.providers.telephony/databases/telephony.db
You can push and pull these files from recovery menu main screen
1- Boot into TWRP
2- Mount System as RW (from mount menu)
3- connect the watch into computer and install ADB drivers.
4- Than run adb pull to get the files
Edit the files (by adding APN or edit existing carriers APN)
apns-conf.xml with any text or xml editor
telephony.db (under data and carriers) with Db browser for sqllite or any sql editor
APN name and data value on both files MUST BE THE SAME/MATCH otherwise the watch wont load the selection
5- ADB push to push the files back to the watch
6. Run shell command to change permission, ownership and group
apns-conf.xml - chmod 644 (rw r r), chown and chgrp root
telephony.db - chmod 660, chown and chgrp radio
Wanting to try this, but it isn't letting me mount /system. TWRP log says "Failed to mount '/system' (No such device)". The "Mount system RO" checkbox checks, but doesn't actually mount RO either.
I also looked for the telephony.db and it didn't exist at /data/data/com.android.providers.telephony/databases/telephony.db. The "databases" folder doesn't exist. Couldn't check for the one in /system
Running wear 2.0, so I DL'd the correct TWRP. I did boot-only, not flash.
Any ideas?
Concur.
Rayfen Windspear said:
Wanting to try this, but it isn't letting me mount /system. TWRP log says "Failed to mount '/system' (No such device)". The "Mount system RO" checkbox checks, but doesn't actually mount RO either.
I also looked for the telephony.db and it didn't exist at /data/data/com.android.providers.telephony/databases/telephony.db. The "databases" folder doesn't exist. Couldn't check for the one in /system
Running wear 2.0, so I DL'd the correct TWRP. I did boot-only, not flash.
Any ideas?
Click to expand...
Click to collapse
I have the same problem with TWRP and System RO. I did it in the same manner for booting from bootloader, because the flashing of recovery does not work correctly. I flash the TWRP using fastboot flash recovery, but every time I attempt to boot into recovery I get the same android icon with a red triangle over the top and an exclamation inside. I did not check the apn, because if I cannot go into recovery or flash SU I know that would be useless to even try. Same here device name nemo from bootloader screen using wear 2.0 (Android 7.1.1). Unlocked using fastboot oem unlock.
My Nexus 5 is rooted with custom Nougat ROM and it does NOT have the .db in the data directory. Given that they use a lot of the same AOSP code, it's probably safe to say that Wear 2.0 (nougat 7.1.1) doesn't need this here either. My conclusion then, is that they have consolidated these settings to the XML in the /system directory, which we cannot mount.
In the thread linked for the systemless su, it mentions that system is read only as it is squashfs. I can only assume that this applies to /system/etc/apns-conf.xml, so I'm not sure how OP was able to push the modified file back to /system in the first place without taking this into account.
Got it working with my FreedomPop SIM. Should work to add any APN. So I combined this with another guy's guide. There are two main differences.
First off, use twrp-3.1.1.0.img from this guy's thread. https://forum.xda-developers.com/lg-urbane-2/how-to/root-twrp-squashfs-3-1-1-lg-urbane-2nd-t3661569
Then it works to mount /system as READ ONLY, which allows you to use the systemless-su from this thread. WARNING: This may not modify the system, but it does modify and reflash another partition (I didn't catch which). I do not know if this will prevent your device from receiving OTAs afterward (It updates, see edit below). ALSO, because there isn't a SuperSU app, there is no management of what can use su privileges. Any app could discover root and do whatever without your knowledge. I plan to remove su from my watch when I get around to it now that my APN has been added. I will post how when I do.
EDIT: I just received an update through the Play Store that updated my AW version, build number, the works. Security patch August 1st. The APN I added persists after the update, though it showed the "no sim" icon until I went and manually enabled cell and selected the APN again.
After getting that done, follow these instructions for adding the APN starting from the header "Add the APN via the ADB shell". https://michaeltroger.github.io/blog/2017/08/12/add-apn-in-android-wear-2
Adding FreedomPop's data APN went as follows:
adb shell
su
content insert --uri content://telephony/carriers --bind name:s:"FreedomPop" --bind numeric:s:"310170" --bind type:s:"default,supl" --bind mcc:i:310 --bind mnc:i:170 --bind apn:s:"fp.com.attz"
If you happen to mess up, or have to add it with trial and error as I did, you can use the following two commands to fix things.
content query
content delete
Using the where clause as exampled in the above link.
NOTE: I just found out that as these changes are systemless, they DO NOT survive an unpair/reset.
Use this TWRP instead for Android wear 2
I modified from Android wear 2 stock recovery
TWRP 3.1.1
https://drive.google.com/open?id=0B4W0KuzRjVvGNkF1UnFkQkFBcU0
Systemless root
https://drive.google.com/open?id=0B4W0KuzRjVvGMzJka1dGRFM2dGc
Dont flash TWRP instead run fastboot boot (TWRP image name)
You wont be able to flash any OTA update with TWRP.
Your watch will keep rebooting to TWRP if you try to download and install any OTA.
Rayfen Windspear said:
Got it working with my FreedomPop SIM. Should work to add any APN. So I combined this with another guy's guide. There are two main differences.
First off, use twrp-3.1.1.0.img from this guy's thread. https://forum.xda-developers.com/lg-urbane-2/how-to/root-twrp-squashfs-3-1-1-lg-urbane-2nd-t3661569
Then it works to mount /system as READ ONLY, which allows you to use the systemless-su from this thread. WARNING: This may not modify the system, but it does modify and reflash another partition (I didn't catch which). I do not know if this will prevent your device from receiving OTAs afterward (It updates, see edit below). ALSO, because there isn't a SuperSU app, there is no management of what can use su privileges. Any app could discover root and do whatever without your knowledge. I plan to remove su from my watch when I get around to it now that my APN has been added. I will post how when I do.
EDIT: I just received an update through the Play Store that updated my AW version, build number, the works. Security patch August 1st. The APN I added persists after the update, though it showed the "no sim" icon until I went and manually enabled cell and selected the APN again.
After getting that done, follow these instructions for adding the APN starting from the header "Add the APN via the ADB shell". https://michaeltroger.github.io/blog/2017/08/12/add-apn-in-android-wear-2
Adding FreedomPop's data APN went as follows:
adb shell
su
content insert --uri content://telephony/carriers --bind name:s:"FreedomPop" --bind numeric:s:"310170" --bind type:s:"default,supl" --bind mcc:i:310 --bind mnc:i:170 --bind apn:s:"fp.com.attz"
If you happen to mess up, or have to add it with trial and error as I did, you can use the following two commands to fix things.
content query
content delete
Using the where clause as exampled in the above link.
NOTE: I just found out that as these changes are systemless, they DO NOT survive an unpair/reset.
Click to expand...
Click to collapse
Is Safetynet working after removing root? I presume you can still sideload updates or that there is a method to return to stock if SafetyNet is tripped?
sjavvaji said:
Is Safetynet working after removing root?
Click to expand...
Click to collapse
I never got around to forcefully disabling/removing it. Nor have I gotten around to redoing it after unpaid/reset wiped it all. How would I test that? I'll get it back on and working then remove root this time sometime this week and give it a go. I don't use Android pay, so I'm not sure how I would test it. Perhaps I could adb push one of the checker apps for phone and hope it works?
Rayfen Windspear said:
I never got around to forcefully disabling/removing it. Nor have I gotten around to redoing it after unpaid/reset wiped it all. How would I test that? I'll get it back on and working then remove root this time sometime this week and give it a go. I don't use Android pay, so I'm not sure how I would test it. Perhaps I could adb push one of the checker apps for phone and hope it works?
Click to expand...
Click to collapse
That would be one way to do it. I have my watch coming in tomorrow and a Freedompop sim on the way. I would prefer Android Pay working over data but having both working is optimal.
sjavvaji said:
That would be one way to do it. I have my watch coming in tomorrow and a Freedompop sim on the way. I would prefer Android Pay working over data but having both working is optimal.
Click to expand...
Click to collapse
Just getting around to tinkering today. Did a bit of research and found that installing the systemless SU modifies the kernel. I'm going to dig a little deeper and hopefully come up with a zip to flash that will completely undo everything that is done by the SU zip (if there isn't one already) to make sure that safetynet not only passes, but that the kernel is stock and secure too. The recent update they pushed for Aug security patch possibly updated the kernel too, yet the APN survived, so once set, APNs definitely live in the userdata and should be fine.
Rayfen Windspear said:
Just getting around to tinkering today. Did a bit of research and found that installing the systemless SU modifies the kernel. I'm going to dig a little deeper and hopefully come up with a zip to flash that will completely undo everything that is done by the SU zip (if there isn't one already) to make sure that safetynet not only passes, but that the kernel is stock and secure too. The recent update they pushed for Aug security patch possibly updated the kernel too, yet the APN survived, so once set, APNs definitely live in the userdata and should be fine.
Click to expand...
Click to collapse
Let me know how it goes! I would honestly just like to get the APN working and return to stock. So assuming it works, the process would go, unlock bootloader, run TWRP w/o install, install systemless SU, edit APN, run TWRP w/o install, uninstall systemless SU, and bootloader relock. Am I missing anything?
sjavvaji said:
Let me know how it goes! I would honestly just like to get the APN working and return to stock. So assuming it works, the process would go, unlock bootloader, run TWRP w/o install, install systemless SU, edit APN, run TWRP w/o install, uninstall systemless SU, and bootloader relock. Am I missing anything?
Click to expand...
Click to collapse
Ooooh... does SafetyNet check for an unlocked bootloader? Does relocking it force a data wipe? I can't remember, because once I unlock, I've never gone back
Rayfen Windspear said:
Ooooh... does SafetyNet check for an unlocked bootloader? Does relocking it force a data wipe? I can't remember, because once I unlock, I've never gone back
Click to expand...
Click to collapse
Yeah. I forgot it required a data wipe. That might be an issue lol.
So is there a way to install Magisk? Or any way to bypass the SafetyNet check and a way to reverse the systemless SU check?
Edit:
I did some more research and it seems like we might be able to install Magisk in place if the systemless root uses SuperSU. Other LG watches in the past and android wear devices in general have been rooted using Magisk in place of SuperSU and it seems to pass safetynet.
hoodred said:
TWRP 3.0.2 and systemless supersu 2.79
You must unlock bootloader first
From bootloader menu
*- To permanently install
fastboot flash recovery (TWRP files name)
*- Running TWRP without installing
Fastboot boot (twrp files name)
download
TWRP 3.0.2 android M
TWRP 3.0.2 Android N (Android wear 2.0)
systemless Wear SU 2.79 from
https://forum.xda-developers.com/apps/supersu/android-wear-6-0-1-root-squashfs-t3319097
To CHANGE (ADDING or EDITING) APN
edit or add apn on two files (APN-Name and value MUST MATCH between these two files)
The watch select and display APN selection based on MCC and MNC value that stored under the SIM card
(you can see the sim card value under telephony.db under siminfo data)
*- apns-conf.xml
/system/etc/apns-conf.xml
*- telephony.db
/data/data/com.android.providers.telephony/databases/telephony.db
You can push and pull these files from recovery menu main screen
1- Boot into TWRP
2- Mount System as RW (from mount menu)
3- connect the watch into computer and install ADB drivers.
4- Than run adb pull to get the files
Edit the files (by adding APN or edit existing carriers APN)
apns-conf.xml with any text or xml editor
telephony.db (under data and carriers) with Db browser for sqllite or any sql editor
APN name and data value on both files MUST BE THE SAME/MATCH otherwise the watch wont load the selection
5- ADB push to push the files back to the watch
6. Run shell command to change permission, ownership and group
apns-conf.xml - chmod 644 (rw r r), chown and chgrp root
telephony.db - chmod 660, chown and chgrp radio
Click to expand...
Click to collapse
Is there a way to flash back to stock AW 1.5?
Sent from my SM-G965U using Tapatalk
I just installed magisk succesfully(?) on my xperia 5 ii following this guide:
https://forum.xda-developers.com/sony-xperia-5-ii/how-to/guide-magisk-twrp-recovery-t4177209/page7
Using the beta channel (stable simply doesn't even boot), magisk manager shows v21 installed. However none of the root apps I tried so far (busybox, adaway, system app remover) works. All of them give some kind of error. The root privileges are being granted (I get the promt to grant/deny and the popup that root was granted). This is very weird and the first time it happens to me on any device. The root browser file managers shows the "root directory" with 0 free space incorrectly (1.6GB used - 1.72 total) I tried copying a file inside the /system directory and it just didn't do anything. I tried reinstalling magisk from the manager, but its still the same. Any help will be appreciated, I really have no idea what to try at this point.
Hard to say... What's "some kind of error"? Maybe the Magisk logs show something (although you'd likely have to switch to the Canary channel to get any useful logs).
I think it's best to wait for a reply to your query in the thread you linked. That's likely to be the best place to get help, since that's where you find other users of the same device...