Can't replace hosts file - Xiaomi Redmi Note 5 Pro Questions & Answers

Redmi Note 5 global version (model M1803E7SH).
Running MIUI Global 9.5 Stable (9.5.6.0).
Unlocked bootloader.
NOT rooted.
I booted TWRP via Fastboot (without flashing it to recovery) and attempted to overwrite /system/etc/hosts with my own file, which was successful.
Result of running ls -l /system/etc/hosts on TWRP terminal:
Code:
-rw-r----- 1 root root 1587161 2018-06-03 20:55 /system/etc/hosts
However after booting back into system, the previous command now shows me the following:
Code:
-rw-r----- 1 root root 56 2008-12-31 11:00 /system/etc/hosts
If I were to boot into TWRP again, I can clearly see that the file I copied is still there at /system/etc/hosts, so it's like MIUI is grabbing the hosts file from somewhere else instead.
Any ideas that do not involve rooting permanently? I do not wish to root my phone, just block ads via /etc/hosts is all.

You are right, the hosts file in /system/etc is written new on every reboot by MIUI. I´m using AdFree on my Android phones for ages that uses the hosts file to block ads, so I wanted to use this on my Note 5 too. But it didn´t work because of the problem you encountered.
I had to click the option "create and use /data/hosts symlink" in AdFree to get Ad blocking back, this seems to create a shortcut to the hosts file now stored on /data to avoice being overwritten.

Kusie said:
I had to click the option "create and use /data/hosts symlink" in AdFree to get Ad blocking back
Click to expand...
Click to collapse
I don't think I can depend on this solution if I'm not rooted. I'm looking for a rootless solution. For now I'm using DNS66 however that is not a complete solution for me because some of my work is done via VPN.

sagematt said:
Redmi Note 5 global version (model M1803E7SH).
Running MIUI Global 9.5 Stable (9.5.6.0).
Unlocked bootloader.
NOT rooted.
I booted TWRP via Fastboot (without flashing it to recovery) and attempted to overwrite /system/etc/hosts with my own file, which was successful.
Result of running ls -l /system/etc/hosts on TWRP terminal:
Code:
-rw-r----- 1 root root 1587161 2018-06-03 20:55 /system/etc/hosts
However after booting back into system, the previous command now shows me the following:
Code:
-rw-r----- 1 root root 56 2008-12-31 11:00 /system/etc/hosts
If I were to boot into TWRP again, I can clearly see that the file I copied is still there at /system/etc/hosts, so it's like MIUI is grabbing the hosts file from somewhere else instead.
Any ideas that do not involve rooting permanently? I do not wish to root my phone, just block ads via /etc/hosts is all.
Click to expand...
Click to collapse
Just wondering, have you ever solved this?

ne0t said:
Just wondering, have you ever solved this?
Click to expand...
Click to collapse
It cannot be solved, you need root to replace the hosts file and then you can later unroot if you wish and the hosts file will remain modified.

Related

[Request]$ -- Modify zergRush to Not Need Build.prop File

I have a request with a small donation as a reward. I'm not rich, but I can reward with some beer money.
I have managed to somehow delete my build.prop file while rooted and then managed to un-root my device. Naturally, I rebooted.
My request is for anyone with a bit of extra time to modify zergRush so that it does not look to a build.prop file to verify the android version.
If there are any other ideas on how to root a bricked Fire without a build.prop file, be my guest.
My hope is that once I am able to re-root my device, I will be able to mount /system/ as writeable and then be able to push in a build.prop file. However, obviously, until that happens I cannot put in a build.prop file.
If you have any questions I pretty much let it all out on the "How to unblock your kindle" thread.
If no one is able to do this I would understand. This is obviously beyond my technical expertise but I do appreciate any efforts or even suggestions. Even if there's no attempts made here, it is still shocking how much help is given on this forum.
EDIT: I was able to get my hands on a valid system.img and then flashed the system.img to my system partition. Doing so corrected my build.prop and my device became bootable. Thanks for all the help.
Did it update to 6.2 while in the midst of your needing around?
what does your device do?
Does it show under adb devices?
ajq said:
Did it update to 6.2 while in the midst of your needing around?
Click to expand...
Click to collapse
I updated to 6.2 on Tuesday. I have followed the directions on the "UNBRICK your kindle" thread. I have done that successfully. However, because my build.prop is missing, I can no longer re-root using zergRush. I believe that fastboot as directed in that thread restores the kindle to factory settings. I'm not quite sure if factory settings is 6.2 or if it goes all the way back to 6.0.
death2all110 said:
what does your device do?
Does it show under adb devices?
Click to expand...
Click to collapse
This is the post I created in the "How to unbrick your kindle" thread. It should answer most questions. I can use adb shell on the device but I cannot mount anything and SU responds "permission denied".
----from the other thread----
I am in a similar situation and am trying to work through it. I thought I rooted my device but when I restarted it, it didn't fully load. I've successfully done all of the steps listed in the OP but am still suck in a black screen (it's lit...but it's black) loop.
I believe I have deleted my build.pop file but have a backup listend as build.prop.bak. However, the device is trying to load and is failing. I need to rename my build.prop.bak as the primary build.prop. I have tried to access SU through ADB but am getting "permission denied" almost as if my device wasn't rooted.
I have tried to mount system as RW but I am also getting permission denied.
Any advice. Here is my /system/
:
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\Admin>cd \KindleFireRoot\files
C:\KindleFireRoot\files>adb shell
adb server is out of date. killing...
* daemon started successfully *
$ cd /system/
cd /system/
$ ls -l
ls -l
drwxr-xr-x root root 1970-01-01 00:00 lost+found
drwxr-xr-x root root 2011-12-01 19:03 app
drwxr-xr-x root shell 2011-12-01 19:03 bin
drwxr-xr-x root root 2011-11-30 01:16 etc
drwxr-xr-x root root 2011-11-30 01:16 fonts
drwxr-xr-x root root 2011-11-30 01:16 framework
drwxr-xr-x root root 2011-11-30 01:16 lib
drwxr-xr-x root root 2011-11-30 01:16 media
drwxr-xr-x root root 2011-11-30 01:16 tts
drwxr-xr-x root root 2011-11-30 01:16 usr
drwxr-xr-x root shell 2011-11-30 01:16 vendor
drwxr-xr-x root shell 2011-12-01 19:03 xbin
-rw-r--r-- root root 2143 2008-08-01 12:00 build.prop.bak
$
EDIT: I have tried to re-root through the method provided as well as superoneclick root, but both have failed because no android system is being recognized. This may have to do with the lack of a proper build.prop on my device.
EDIT2: I figure the above might not be enough information so I will now post what I have done so far to get it bricked, and what I have already tried.
1. I tried the rooting method on rootkindlefire.com and it seemed successful. I then was able to set /system/ as RW via root explorer. I copied a modified build.prop file that is available in the android development forums. However, unfortunately, I believe I may have edited the name of this file or done something wrong in handling it accidentally. Regardless, I pasted this file in the /system/ folder and renamed my original build.prop file to build.prop.bak. I then restarted my kindle fire. Now, it shows the kindle fire screen for a second and then goes black entirely. It is still on (the screen is lit), but the screen is black. It then remains like this until I do a hard reset and then it repeats this process.
2. I have tried to access SU but have been unable to do so. I have been unable to mount system as RW using the instruction a page back. In both situations I get the "permission denied" response from the command line.
3. Everytime I try to root using the method provided in the OP, I get a message saying that it can't find android 2.2 or 2.3
4. I am unable to root again using super click for the same reason.
5. I have otherwise been able to follow all of the steps in the OP successfully, but to no avail. My screen goes black after it shows the kindle fire screen for a couple seconds.
6. Any suggestions would be very very helpful. From my amateur amount of knowledge, it seems to me that I don't have a build.prop in my /system/ but am unable to rename or access my build.prop.bak so that I can set it as the regular bootable build.prop. This is because, even though I thought I had it rooted, I am unable to set the /system/ directory as writable.
7. ANY SUGGESTIONS OR HELP WOULD BE GREAT!
Just as a disclaimer: I acknowledge I'm a moron for not verifying everything when I pushed in a build.prop file into my /system/ folder and restarted. No need to call me names
For those who know a bit more than me...
Would pushing the 6.2 update (or any of the downloadable firmware) to the kindleupdates folder in the sdcard and then rebooting fix my problem? I remember reading that the updates re-writes the build.prop which would fix my situation.
Of course, do you need root permissions to be able to write to the sdcard? I only ask this because I can not get the sdcard to actually show up on my desktop. I would need to push it via terminal or adb shell.
Anyone know if this would work?
I am beginning to realize that I may actually still have root, but since I can't boot up the phone, I can't fill out the superuser access dialog that usually comes up when a program tries to access superuser. I had root before I caused the build.prop problems, but figured that I had somehow lost it when I tried to access SU from ADB. Anyone know of a way to bypass this access dialog?
I checked the root status with OneClickRoot after OTA reported my KF was still rooted (just to be sure) and then re-installed Superuser and pushed the necessary Android APKs back to /system/app and it was working again.
damianarnold said:
I checked the root status with OneClickRoot after OTA reported my KF was still rooted (just to be sure) and then re-installed Superuser and pushed the necessary Android APKs back to /system/app and it was working again.
Click to expand...
Click to collapse
How did you re-install Superuser if you're not able to fully boot up the KF? To be clear, when I try to root with superoneclick it says i'm rooted (and if i try and continue it fails...) but whenever I type in adb shell and then su I get "permission denied."
ejrubin said:
How did you re-install Superuser if you're not able to fully boot up the KF? To be clear, when I try to root with superoneclick it says i'm rooted (and if i try and continue it fails...) but whenever I type in adb shell and then su I get "permission denied."
Click to expand...
Click to collapse
My Fire was fully booted up. Did you remove and reinstall Superuser?
damianarnold said:
My Fire was fully booted up. Did you remove and reinstall Superuser?
Click to expand...
Click to collapse
Don't think our KF were in the same state. I don't have a build.prop to boot my KF into so I can't manage superuser at all (I do, however, have a totally useless build.prop.bak that is sitting there in the directory. ) I have the superuser.apk in there so it seems as though I'm rooted but I still can't get into SU via adb.
Can't get Write access to /System or /SDCard
ejrubin said:
Don't think our KF were in the same state. I don't have a build.prop to boot my KF into so I can't manage superuser at all (I do, however, have a totally useless build.prop.bak that is sitting there in the directory. ) I have the superuser.apk in there so it seems as though I'm rooted but I still can't get into SU via adb.
Click to expand...
Click to collapse
Still having the exact same problem! Was able to get the build.prob.bak pulled from /system but can't rename it and push it back to hopefully get this working again.
I am starting to think I may have to send this KF back soon if I don't get it working again.
Any help anyone can provide would be great.
I'm thinking since we are able to get into fastboot, do any developers know if it is possible to push in a new system.img via fastboot? This would solve our build.prop problems no? Any developers know if this is possible?
I would like to compile zergRush myself, but I don't know how to compile Android binary.
It seems require linux to do so.
Can you adb push to the sdcard?
Sent from my DROID Pro using XDA App
JackpotClavin said:
Can you adb push to the sdcard?
Sent from my DROID Pro using XDA App
Click to expand...
Click to collapse
No , I think the sdcard is not yet mount. Tried cd sdcard and it's not possible.
Is it possible to mount it without root? Cause when we try to mount system folder it's permission denied.
And I'm afraid the system won't run the official update even the patch is inside the sdcard folder.
I think ejrubin's idea on how to fix our bricked kindle fire is completely right , we just need either one of the following :
1. A zergRush binary won't check the build.prop to let us run root and mount the system folder
2. Since we can get into fastboot, I think we need a correct update.zip or system.img to fix it. Any idea to build it from kindle's official update?
Well try "mount sdcard" in the shell. If you can push the update, you can idme bootmode into 0x5001 and it'll take the update in recovery mode
If that doesn't work I'll give a custom zerg a shot
Edit: I got it. If you wanna flash my clockwork build in fastboot and set the fastboot to boot into recovery, you can access your /system through recovery, I do it all the time
It'll be a fastboot flash recovery <the name of the recovery.img I'll post later when I get home>
From there you will have to:
Adb shell
Mount system
Mv /system/build.bak /system/build.prop
Sent from my DROID Pro using XDA App
JackpotClavin said:
Well try "mount sdcard" in the shell. If you can push the update, you can idme bootmode into 0x5001 and it'll take the update in recovery mode
If that doesn't work I'll give a custom zerg a shot
Edit: I got it. If you wanna flash my clockwork build in fastboot and set the fastboot to boot into recovery, you can access your /system through recovery, I do it all the time
It'll be a fastboot flash recovery <the name of the recovery.img I'll post later when I get home>
From there you will have to:
Adb shell
Mount system
Mv /system/build.bak /system/build.prop
Sent from my DROID Pro using XDA App
Click to expand...
Click to collapse
If i just type "mount sdcard" it cannot recognize the command.
if try to mount it with -t and mount it to other folder, it just say permission denied.
Of course I wanna flash your clockwork build!!
Would you mind to guide us with all the step when you're ready? Because I'm quite new to root android machine.
Really thanks for your help!!!!!!!!!!!!!!!!
Yeah **** sorry guys can this wait till tomorrow? Sorry I said tonight, I got side tracked tonight
Sent from my DROID Pro using XDA App

Proper root or not

When i first bought the t989, i rooted the phone manually by flashing cwm and the su.zip file. Everything seem to have worked then. A month or so back I updated the phone to ICS through the Kies Air application. I tried browsing through my root files and found myself unable to do so. I decided to check my superuser application and noticed another su apk. It wasnt the android face but a superman android icon (sua). I updated the binary on the sua and my phone started resetting on its own. I have flashed stock roms of ics and the problem consisted. Eventually fed up of the 4.0.4 version i flashed back to GB which seems better in phone performance.
Back into stock/unrooted T989, i flashed root again. However i used root checker pro and it verifies root access however I find myself unable to browse root files. Is there another possible way to check through? maybe via terminal emulator?
/--edit 10:28 AM----\
So i did some more searching and found the su command in terminal emulator and the "$" symbol changed to "#"
Im guessing I have root but browsing in the rooted files seems disabled in some apps
brion1020 said:
When i first bought the t989, i rooted the phone manually by flashing cwm and the su.zip file. Everything seem to have worked then. A month or so back I updated the phone to ICS through the Kies Air application. I tried browsing through my root files and found myself unable to do so. I decided to check my superuser application and noticed another su apk. It wasnt the android face but a superman android icon (sua). I updated the binary on the sua and my phone started resetting on its own. I have flashed stock roms of ics and the problem consisted. Eventually fed up of the 4.0.4 version i flashed back to GB which seems better in phone performance.
Back into stock/unrooted T989, i flashed root again. However i used root checker pro and it verifies root access however I find myself unable to browse root files. Is there another possible way to check through? maybe via terminal emulator?
/--edit 10:28 AM----\
So i did some more searching and found the su command in terminal emulator and the "$" symbol changed to "#"
Im guessing I have root but browsing in the rooted files seems disabled in some apps
Click to expand...
Click to collapse
I'm having the same issues with 4.0.4. It's getting me pissed and contemplating doing 4.0.3 where I had access to system files via root explorer. I've been going through different ROMs on 4.0.4 to see if that would alleviate the problem. So far, still issues saying something to the affect that I don't have superuser access even though I can run any rooted application.
Here is the results of using root checker pro
Code:
Congratulations! You have root access!
Super User Applications Status: Superuser application - version 3.0.5 - is installed! SuperSU application - is NOT installed.
System File Properties for Root Access: Standard Location Check Command: ls -l /system/xbin/su: Result: lrwxrwxrwx root root 2012-09-29 00:35 su -> /system/bin/su Analysis: File: su is a symbolic link pointing to another file: /system/bin/su
Standard Location Check Command: ls -l /system/bin/su: Result: -rwsr-sr-x root root 22228 2008-08-01 08:00 su Analysis: Setuid attribute present and root user ownership present. Root access is correctly configured for this file! Executing this file can grant root access!
Alternative Location Check Command: ls -l /sbin/su: Result: /sbin/su: Permission denied Analysis: File system permissions restricted and denied access.
Alternative Location Check Command: ls -l /system/xbin/sudo: Result: /system/xbin/sudo: No such file or directory Analysis: File /system/xbin/sudo does not exist.
Root User ID and Group ID Status: Root user id: uid=0(root)
Root group id: gid=0(root)
System Environment PATH: /sbin /vendor/bin /system/sbin /system/bin /system/xbin
ADB Shell Default User: ADB shell setting for standard access, stored in default.prop, is configured as: shell (non root) user - ro.secure=1
Results provided on your SGH-T989 device by
Su or superuser
Are you using Superuser or SuperSu try reinstalling the APP from the market.
if not already a system app use titanium backup to convert to system app.
[email protected] said:
Are you using Superuser or SuperSu try reinstalling the APP from the market.
if not already a system app use titanium backup to convert to system app.
Click to expand...
Click to collapse
I've tried updating superuser from the market, even bought the elite version. Tried SuperSu and thus far, no luck. Tried using titanium just now and it didn't work on superuser.
---------- Post added at 12:14 PM ---------- Previous post was at 12:11 PM ----------
I've even reflashed the su signed efghi 3.0.7 apk.
[email protected] said:
Are you using Superuser or SuperSu try reinstalling the APP from the market.
if not already a system app use titanium backup to convert to system app.
Click to expand...
Click to collapse
Ive tried updating su before and the binary which seem to have no changes. As for making su a system app, when i flashed unroot to root, su appeared without me installing. Also, su doesnt seem to appear in titanium backup
/----Edit----\
I'm returning my phone today to fix the broken power button, the stiffness of the D30 case may have caused this.
Is it possible to direct me to a fully working 100% root?
brion1020 said:
Ive tried updating su before and the binary which seem to have no changes. As for making su a system app, when i flashed unroot to root, su appeared without me installing. Also, su doesnt seem to appear in titanium backup
/----Edit----\
I'm returning my phone today to fix the broken power button, the stiffness of the D30 case may have caused this.
Is it possible to direct me to a fully working 100% root?
Click to expand...
Click to collapse
I'm kind of wondering if flashing back to completely stock via Odin, then trying all over again will do it? I know as soon as I did the Kies update from 4.0.3 to 4.0.4 caused this issue on stock rooted.
Hype As Fruck said:
I'm kind of wondering if flashing back to completely stock via Odin, then trying all over again will do it? I know as soon as I did the Kies update from 4.0.3 to 4.0.4 caused this issue on stock rooted.
Click to expand...
Click to collapse
Just Odin back to stock and then reroot. Its super simple. Maybe if you can get back to you recovery somehow you can just flash another rom and install it where you can have your supersu access back.
Sent from my SGH-T989 using xda app-developers app

Just Rooted My S3 But SU Is Missing A Binary

I just rooted my ATT S3 4.3. I did everything the tutorial said to do except when it got the part wherr odin reboots ur phone, i had to reboot it myself yo makr it go in cwm recovery. So once I was done rooting my phone and turned it on for the 1st time I instantly was greeted with superuser has stopped and security violations. So I tried random fixes from google and it keepa teling me there is no binary code. I can't figure out how to fix this, can anyone help me?
Which tutorial did you follow?
audit13 said:
Which tutorial did you follow?
Click to expand...
Click to collapse
I can't find it anymore. It was on this forum and it said it was for att S3 phones. Is there an area where all the ways to root are?
This is what root checker pro gave me as the results.
Super User Application Status:
SuperSU application - version 1.93 - is installed!
System File Properties for Root Access:
Standard Location
Check Command: ls -l /system/bin/su:
Result: /system/bin/su: No such file or directory
Analysis: File /system/bin/su does not exist.
Standard Location
Check Command: ls -l /system/xbin/su:
Result: -rwxr-xr-x root root 113036 1970-08-25 22:58 su
Analysis: Setuid attribute is NOT present BUT root user ownership is present. Root access is NOT correctly configured for this file!
Alternative Location
Check Command: ls -l /sbin/su:
Result: /sbin/su: Permission denied
Analysis: File system permissions restricted and denied access.
Alternative Location
Check Command: ls -l /system/xbin/sudo:
Result: /system/xbin/sudo: No such file or directory
Analysis: File /system/xbin/sudo does not exist.
Root User ID and Group ID Status:
System Environment PATH: /sbin /vendor/bin /system/sbin /system/bin /system/xbin
ADB Shell Default User:
ADB shell setting for standard access, stored in default.prop, is configured as: shell (non root) user - ro.secure=1
Try Chainfire's CF autoroot with SuperSU, including google play SSU update to App? It sounds like you failed to reboot into recovery first before doing a normal boot. After flashing via odin, the root is temporary and will be wiped during a normal boot, unless you first reboot into recovery. So, you have to uncheck the reboot after flash option in odin. After successful flash, pull usb cable and boot into recovery using three button method.
Did you use CF autoroot? Try it again.
http://forum.xda-developers.com/showthread.php?t=1963790
Sent from my SAMSUNG-SGH-I747 using xda app-developers app
laughingT said:
Try Chainfire's CF autoroot with SuperSU, including google play SSU update to App? It sounds like you failed to reboot into recovery first before doing a normal boot. After flashing via odin, the root is temporary and will be wiped during a normal boot, unless you first reboot into recovery. So, you have to uncheck the reboot after flash option in odin. After successful flash, pull usb cable and boot into recovery using three button method.
Did you use CF autoroot? Try it again.
http://forum.xda-developers.com/showthread.php?t=1963790
Sent from my SAMSUNG-SGH-I747 using xda app-developers app
Click to expand...
Click to collapse
I did reboot into recovery. I remeber the files I downloaded were named clockword mod and another was called superboot with cwm. Don't k ow if that helps.
I'm having a big issue though, I had tried fixing it by flashing dif ways, now whe I try tk flash it. When it loads up in download mode, my phone turns off or of ot doesn't do that, after I flash my phone and it reboots, it shows a red screen.
EDIT:
I just tried that root method you suggested and I still have the same issues. I don't know what to do!
EDIT 2:
I fixed it by using this site http://www.w0lfdroid.com/2013/12/Fix-Root-Problem-on-Android-4.3-for-Galaxy-S3-S4-Note2-Note3.html. Specifically, these instructions:
Download and install the latest APK for SuperSU like MrW0lf suggested.
I was having the same exact problem (unfortunately, SuperSU has stopped), so I downloaded the latest UPDATE-SuperSU file and extract it to have supersu APK, put it on my SD card in my phone and installed it from there.
It was strange because the version that was already on my phone was the same 1.89 version that I downloaded, but regardless, when I clicked on the APK, it saw it as an update, it asked to disabled knox, and worked like a charm.
- See more at: http://www.w0lfdroid.com/2013/12/Fi...y-S3-S4-Note2-Note3.html#sthash.0nlj3XHO.dpuf
PS: this is the root method I had 1st followed, http://forum.xda-developers.com/showthread.php?t=1726960

[Guide] AdAway for systemless hosts file

About the only reason I root my phone is to install AdAway. I'd prefer to not modify the system partition to help make OTA's easier to get and to allow Android Pay to work. AdAway has a flashable .zip file that preps the hosts file to use the systemless root structure that comes along with SuperSU. Unfortunately, that script depends on being able to access the /data partition inside of TWRP which isn't going to happen any time soon on the HTC 10. Fortunately, it is easy for us to manually replicate what the flashable .zip is trying to do.
This isn't a detailed how-to, but more of a set of guidelines. Don't blame me if your phone explodes.
Root the phone with the latest SuperSU.
Download the AdAway_systemless_hosts_v2.zip file from the Unofficial AdAway thread.
Extract the files from inside the zip. We are only interested in two files in the support folder.
Connect the phone to your PC and turn on file transfer mode.
Copy "hosts" and "0000adaway.script" that you just extracted to the internal storage of your phone.
Use a program file Root Explorer to move "hosts" into /su/etc and move "0000adaway.script" into /su/su.d (this probably could have been done with ADB push, but I got permission errors when I tried it that way and I'm impatient and lazy).
Chmod 0755 /su/su.d/0000adaway.script (I used a root shell on the phone via ADB)
Install AdAway (I used the link in the Unofficial AdAway thread.)
Reboot the phone.
Run AdAway like normal. By default it should use /system/etc/hosts which is what you want.
If something doesn't work, figure out why and fix it. I'm happy to answer questions to the best of my ability.
AdAway works without problems here, with simple press activate button.
starbase64 said:
AdAway works without problems here, with simple press activate button.
Click to expand...
Click to collapse
Yup
Sent from my HTC 10 using Tapatalk
starbase64 said:
AdAway works without problems here, with simple press activate button.
Click to expand...
Click to collapse
Yes, but it modifies the /system partition unless you do the trick in OP. If I'm correct, you will have problems with OTA updates and Google Pay if you let AdAway directly modify the hosts file on /system.
Now that TWRP can access /data, can we just flash the zip?
goodtimes50 said:
Now that TWRP can access /data, can we just flash the zip?
Click to expand...
Click to collapse
Yes, you can. I downloaded that zip and apk from the Unofficial AdAway thread linked above. Booted into TWRP, flashed the newest betaSuperSU2.74-2-forceencrypt (not related to this, just so I'd be on the latest version), then the AdAway_systemless_hosts_v2.zip, rebooted and installed the apk and let it run. Rebooted. Showing hosts location as /system32/etc/hosts as the OP says is a good thing, and both files mentioned are in their correct places per Root Browser. [emoji106]
Sent from my HTC 10 using XDA-Developers mobile app
Sorry that it doesn't completely match the thread here but I think my question could fit in here anyway.
Do I suggest correctly that with systemless root, systemless AdAway and the stock recovery OTAs should be fully usable? Since there's no other modification to /system then.
bmwbasti said:
Sorry that it doesn't completely match the thread here but I think my question could fit in here anyway.
Do I suggest correctly that with systemless root, systemless AdAway and the stock recovery OTAs should be fully usable? Since there's no other modification to /system then.
Click to expand...
Click to collapse
I believe that is correct. There hasn't been a new OTA for my phone yet so I can't verify. However, when I do the check for new software it tells me no new updates (as opposed to the message about the files system being corrupt). I believe Android Pay should also work. I have it installed and added a new card, but I haven't tested making a purchase yet.
Thanks for the guide.
My device is rooted, but I didn't found su folder in anywhere when I use Root Explorer with root access, does anyone tell me how to get su folder and make AdAway work?
Fix for AdAway.
matif525 said:
Thanks for the guide.
My device is rooted, but I didn't found su folder in anywhere when I use Root Explorer with root access, does anyone tell me how to get su folder and make AdAway work?
Click to expand...
Click to collapse
Your device may use su, & still not have an su folder (at all) that is used for hosts file (ie systemless root). Just do this..
Download... Terminal emulator.
https://play.google.com/store/apps/details?id=jackpal.androidterm
Open terminal
Then enter these commands.. "Quote"
su
mount -orw,remount /system
rm /system/etc/hosts
ln -s /data/data/hosts /system/etc/hosts
mount -orw,remount /system
Now open AdAway go to preferences and select option to " Target hosts file"
Select /data/data/hosts
Enjoy..
If you still have ads in apps do this!!!
githyanki said:
Open the 3 dot menu in adaway, chose log DNS request. Enable TCP dump.
Open the app with ads, when ad loads, go back to adaway, and open log.
Long press any entries and chose black list.
Profit
Click to expand...
Click to collapse
All credit where credit is due. I just shared what I read else where.
Read here for more details..
https://github.com/AdAway/AdAway/issues/770
&
http://forum.xda-developers.com/showthread.php?t=2190753&page=143#post68988079
There is a known issue in HTC devices involves S-off. If the above doesn't solve this for you message here I'll follow. Or pm me. I work wierd hours be patient.
Rom Maximus 3.0.0 ( Android 7 ).Any instruction don't works,adaway no blocked ads.
regarding su folder to move files to
FreydNot said:
About the only reason I root my phone is to install AdAway. I'd prefer to not modify the system partition to help make OTA's easier to get and to allow Android Pay to work. AdAway has a flashable .zip file that preps the hosts file to use the systemless root structure that comes along with SuperSU. Unfortunately, that script depends on being able to access the /data partition inside of TWRP which isn't going to happen any time soon on the HTC 10. Fortunately, it is easy for us to manually replicate what the flashable .zip is trying to do.
This isn't a detailed how-to, but more of a set of guidelines. Don't blame me if your phone explodes.
Root the phone with the latest SuperSU.
Download the AdAway_systemless_hosts_v2.zip file from the Unofficial AdAway thread.
Extract the files from inside the zip. We are only interested in two files in the support folder.
Connect the phone to your PC and turn on file transfer mode.
Copy "hosts" and "0000adaway.script" that you just extracted to the internal storage of your phone.
Use a program file Root Explorer to move "hosts" into /su/etc and move "0000adaway.script" into /su/su.d (this probably could have been done with ADB push, but I got permission errors when I tried it that way and I'm impatient and lazy).
Chmod 0755 /su/su.d/0000adaway.script (I used a root shell on the phone via ADB)
Install AdAway (I used the link in the Unofficial AdAway thread.)
Reboot the phone.
Run AdAway like normal. By default it should use /system/etc/hosts which is what you want.
If something doesn't work, figure out why and fix it. I'm happy to answer questions to the best of my ability.
Click to expand...
Click to collapse
Hi there, ive got a mate 8, not sure if this adblocker will work on it but i want to try it out anyway. Ive unzipped the file but which folder in su do i move the files to? screenshot of the folders i have in su

[Mod][Systemless Root][Pixel/Pixel XL] TetherMod - Bypass provisioning checks.

This guide presupposes that you have Supersu installed as systemless, and that you have access to adb.
This will bypass provisioning checks for builtin tether app. The modded apk should work with future updates without touching /system at all.
Installation
Method 1 - Manual install
Download the attached CarrierEntitlement apk.
If you have su.img su:
Code:
adb push CarrierEntitlement.apk /sdcard/CarrierEntitlement.apk
adb shell
su
mkdir /su/CarrierEntitlement
cp /sdcard/CarrierEntitlement.apk /su/CarrierEntitlement/CarrierEntitlement.apk
chmod 644 /su/CarrierEntitlement/CarrierEntitlement.apk
echo "mount -o bind /su/CarrierEntitlement/CarrierEntitlement.apk /system/priv-app/CarrierEntitlement/CarrierEntitlement.apk" > /su/su.d/05TetherMod
chmod +x /su/su.d/05TetherMod
reboot
If you have sbin su (Android 8.0+)
Code:
adb push CarrierEntitlement.apk /sdcard/CarrierEntitlement.apk
adb shell
su
mkdir /sbin/supersu/CarrierEntitlement
cp /sdcard/CarrierEntitlement.apk /sbin/supersu/CarrierEntitlement/CarrierEntitlement.apk
chmod 644 /sbin/supersu/CarrierEntitlement/CarrierEntitlement.apk
echo "mount -o bind /sbin/supersu/CarrierEntitlement/CarrierEntitlement.apk /system/priv-app/CarrierEntitlement/CarrierEntitlement.apk" > /sbin/supersu/su.d/05TetherMod
chmod +x /sbin/supersu/su.d/05TetherMod
reboot
Method 2 - Flashable Zip (su.img only)
Code:
1. Download attached zip.
2. Flash in TWRP (Last tested in alpha 2)
Information
This mod is accomplished by replacing the following function:
Code:
.method public static getCarrierEntitlement(Landroid/content/Context;)Lcom/google/android/carrierentitlement/CarrierEntitlement;
.registers 2
.param p0, "context" # Landroid/content/Context;
.prologue
.line 56
const/4 v0, 0x0
return-object v0
.end method
NOTE: Post install
You may need to edit your APNs to get tethering working for your carrier.
On sprint, where editing APNs is disabled, the fix is here: Sprint Fix
Be sure to thank @Builtfordtough1 for all his help in diagnosing the issue at this post: The Solution!
Be sure to thank sb1893 for sbin su instructions.
Worked Perfectly
This worked perfectly. Fantastic job!
So I am on stock with unlocked bootloader, twrp installed, and rooted with SuperSU. Because this is an apk file, do i just download onto the phone and install as I would with any other .apk file?
coolhandz said:
So I am on stock with unlocked bootloader, twrp installed, and rooted with SuperSU. Because this is an apk file, do i just download onto the phone and install as I would with any other .apk file?
Click to expand...
Click to collapse
The directions clearly state in adb speak that you need to create a directory for the file. Move to said directory, change permissions, etc etc. Nothing about installing via the apk.
pcriz said:
The directions clearly state in adb speak that you need to create a directory for the file. Move to said directory, change permissions, etc etc. Nothing about installing via the apk.
Click to expand...
Click to collapse
well, i can follow basic commands in minimal adb & fastboot. I think this may be above me unless there is an idiots' guide.
coolhandz said:
well, i can follow basic commands in minimal adb & fastboot. I think this may be above me unless there is an idiots' guide.
Click to expand...
Click to collapse
Do you have access to adb? They are pretty straight forward. May need to view them on the website but if you are using an app it may throw the word wrap off and make the commands seem confusing. The directions are pretty word for word.
pcriz said:
Do you have access to adb? They are pretty straight forward. May need to view them actually on the website but if you are using an app it may throw the word wrap off and make the commands seem confusing. The directs are pretty word for word.
Click to expand...
Click to collapse
If by adb you mean minimal adb & fastboot, then yes I have access and I could probably brave it.
coolhandz said:
If by adb you mean minimal adb & fastboot, then yes I have access and I could probably brave it.
Click to expand...
Click to collapse
I wouldn't suggest doing it how I did it but I downloaded the file to my phone. I created the directory using a root enabled file browser (see mkdir command {make directory}). I even used the file properties option in solid explorer to change the permissions (see chmod 644). Every other command I did on the phone from a terminal emulator. Just had to ignore the adb shell command because I am actually doing them on the device and not through a shell on my computer.
pcriz said:
I wouldn't suggest doing it how I did it but I downloaded the file to my phone. I created the directory using a root enabled file browser (see mkdir command {make directory}). I even used the file properties option in solid explorer to change the permissions (see chmod 644). Every other command I did on the phone from a terminal emulator. Just had to ignore the adb shell command because I am actually doing them on the device and not through a shell on my computer.
Click to expand...
Click to collapse
yeah, all that is definitely outside of my comfort zone, but thank you for the info.
Can you normally update your device with OTA-updates like a un-rooted device, without flashfire or connect to your computer?
Is there an advantage to doing this over adding "net.tethering.noprovisioning=true" to the build.prop file?
airmaxx23 said:
Is there an advantage to doing this over adding "net.tethering.noprovisioning=true" to the build.prop file?
Click to expand...
Click to collapse
This mod is systemless, and should survive OTAs. That mod changes the build.prop on the system partition, which could prevent taking OTAs.
njeri123 said:
Can you normally update your device with OTA-updates like a un-rooted device, without flashfire or connect to your computer?
Click to expand...
Click to collapse
Any modification to the boot image *should* prevent OTAs from working at all. However, you can flash back to stock boot images, and take OTAs as long as you have not modified /system, which this mod does not do.
Furthermore, as long as you don't wipe /data/ this mod will live in su.img and survive when you flash newer system software.
Fenny said:
This mod is systemless, and should survive OTAs. That mod changes the build.prop on the system partition, which could prevent taking OTAs.
Any modification to the boot image *should* prevent OTAs from working at all. However, you can flash back to stock boot images, and take OTAs as long as you have not modified /system, which this mod does not do.
Furthermore, as long as you don't wipe /data/ this mod will live in su.img and survive when you flash newer system software.
Click to expand...
Click to collapse
Thanks for the explanation, I removed the build.prop line and used this method and it's working fine. Thank you.
@Fenny
Thank you so much for putting this into a .zip file. It is greatly appreciated!
is there a non root method to bypass the checks? i dont plan on unlocking or rooting since i use android pay...
ddarvish said:
is there a non root method to bypass the checks? i dont plan on unlocking or rooting since i use android pay...
Click to expand...
Click to collapse
I also use Android pay, so I have two boot images ready to fastboot or flash. I have a boot image with root, and a boot image without root running a kernel that hides the bootloader unlocked flag.
So, the way I handle this, I flash the unrooted (bootloader flag hidden) image as my daily driver kernel, this passes safetynet, and allows me to use Android pay.
I make a backup of that boot image. Then, I install TWRP, my custom kernel, and SuperSU. I make a backup of that image as well.
So I have two backed up boot images:
rooted.img
HideBLUnlock.img
I flash HideBLUnlock.img to boot a, and boot b, safetynet passes.
Whenever I need to tether I have my computer with me, so I "fastboot boot rooted.img" which leaves me rooted until my next reboot.
Depending on your usage you might want to reverse that.
All my mods get stored in su.img, so switching out the boot images is all I need to have the best of both worlds.
Is it possible to fastboot boot twrp and flash the zip without being rooted or having twrp actually installed? O unlocked my bootloader but that's been it
Ocelot13 said:
Is it possible to fastboot boot twrp and flash the zip without being rooted or having twrp actually installed? O unlocked my bootloader but that's been it
Click to expand...
Click to collapse
You can use the fastboot twrp image to install this mod but you MUST have SuperSu. I have basic validation to check that in my update.zip. If you don't have a su.img in /cache or /data, this mod cannot be installed.
Flashed via TWRP and now i finally have a fully functioning hotspot!!
Fenny said:
I also use Android pay, so I have two boot images ready to fastboot or flash. I have a boot image with root, and a boot image without root running a kernel that hides the bootloader unlocked flag.
So, the way I handle this, I flash the unrooted (bootloader flag hidden) image as my daily driver kernel, this passes safetynet, and allows me to use Android pay.
I make a backup of that boot image. Then, I install TWRP, my custom kernel, and SuperSU. I make a backup of that image as well.
So I have two backed up boot images:
rooted.img
HideBLUnlock.img
I flash HideBLUnlock.img to boot a, and boot b, safetynet passes.
Whenever I need to tether I have my computer with me, so I "fastboot boot rooted.img" which leaves me rooted until my next reboot.
Depending on your usage you might want to reverse that.
All my mods get stored in su.img, so switching out the boot images is all I need to have the best of both worlds.
Click to expand...
Click to collapse
This is facinating, do you ever think where we can use boot a and boot b in a multiboot like fashion so that when you turn on the device you can choose what to boot?

Categories

Resources