Question Easiest way to just modify etc/hosts. - Google Pixel 5a

For digital wellbeing reasons* I'd like to lock myself out a handful of websites by redirecting them to local.
I've tried to follow the guideline using Magisk, only to nearly brick my phone (a friend had to flash the original image). What is the easiest way to simply modify the hosts file without changing too much?
lg lngo

I've been using this Magisk module for a long to block Ads. Just edit etc/hosts and install!

That means you recommend to simply follow this guideline and install Magisk including this plugin?

It may be that the websites you are concerned about are blocked in the hostlist that AdAway would install. If your phone is rooted, consider installing AdAway. I think it can only be installed using F-Droid.

@Rafiul Bari Chowdhury: I edited the hosts file in your zipped module, run it in Magisk: worked fine, after restart I saw the changes (shell cat /etc/hosts). However, after locking it again the device is bricked. I'm looking how to flash the factory image again.
Any ideas what went wrong? Is it not possible to edit root files and relock the phone again so it seems "normal"?
Edit: re-unlocked the phone and it works again. Reset OS (and hosts file), but works. When locked again: "Can't find valid operating system". Any ideas?

Fnokrer said:
@Rafiul Bari Chowdhury: I edited the hosts file in your zipped module, run it in Magisk: worked fine, after restart I saw the changes (shell cat /etc/hosts). However, after locking it again the device is bricked. I'm looking how to flash the factory image again.
Any ideas what went wrong? Is it not possible to edit root files and relock the phone again so it seems "normal"?
Edit: re-unlocked the phone and it works again. Reset OS, but works. When locked again: "Can't find valid operating system". Any ideas?
Click to expand...
Click to collapse
i doubt the phone is bricked. it is either locked up that you can force off by holding down power + vol up + vol down all 3 at the same time for 15 to 30 seconds to force off. you can get into boot loader by power + vol down. then flash the stock image from https://developers.google.com/android/images#barbet
make sure you have the google usb drivers and use chrome installed or nothing work when trying to flash back to stock.
it pretty hard to mess up the bootloader section of the phone. it can be done but you would have to flash a corrupt image to the boot partition.
i use to use adaway https://github.com/AdAway/AdAway/releases/tag/v5.12.0 if i remember right you can modify the host file using that apk

I did id all over again: Flashed latest firmware (barbet-sp2a.220305.012), installed Magisk acc. to Guideline here in the forum. Same result.
Phone wasn't bricked, Boot loader worked fine all the time, sorry for unprecise description. Editing the hosts file simply doesn't last (maybe I have to change the file on partition A and b??!) and 2nd, if locked again the phone won't find the OS.
Gives me two questions:
1.) how actually does the script from Rafiul Bari Chowdhury work, how can it replace the hosts file while I can't do it manually due to read-only partition.
2.) If I change both partitions, A and B, would the change last after I lock the phone again? Then how do I do it and how do I make sure the OS is found.
Is it even possible to change system files and go back into "locked" mode again without any other impacts?

Fnokrer said:
I did id all over again: Flashed latest firmware (barbet-sp2a.220305.012), installed Magisk acc. to Guideline here in the forum. Same result.
Phone wasn't bricked, Boot loader worked fine all the time, sorry for unprecise description. Editing the hosts file simply doesn't last (maybe I have to change the file on partition A and b??!) and 2nd, if locked again the phone won't find the OS.
Gives me two questions:
1.) how actually does the script from Rafiul Bari Chowdhury work, how can it replace the hosts file while I can't do it manually due to read-only partition.
2.) If I change both partitions, A and B, would the change last after I lock the phone again? Then how do I do it and how do I make sure the OS is found.
Is it even possible to change system files and go back into "locked" mode again without any other impacts?
Click to expand...
Click to collapse
did you try adb shell then su ? you can try chmod -R 775 or 777 a file to give full permisions. you probably could get away with just 660 for read and write without execute command. so chmod -R 660 (filename) should allow you to change the file permisions and allow you to write to the file.
as for relocking. i usually leave mine unlocked. i think if you relock it does a verification process of the rom. not sure on that one. maybe a developer can answer that question.

Hey I am trying to figure this out. did OP ever find an answer?
For me, I am on a pixel 5 with android 13, a phone I got from Backmarket. It is an "Unlocked" pixel 5. I thought this would make things easier. According to an article, pixel 5 is "one of the easiest phones to root"
:/
The phone is not A/B, only A
I pulled the magisk image using adb to the file with platform tools
I tried sideloading a hosts file through ADB but I got Error 21.
I have tried rooting the phone with Magisk boot.img but it fails because in Fastboot "Remote: failed to write to partition not found" and in FastbootD there is also an error.
SU is not found when I attempt to use the adb shell. It is Greyed out in the Magisk App
I have mounted the /system with Recovery but then I receive "Remote: no such file or directory"
I am using the most current Platform tools.
Any advice? Really I just want to edit the hosts file

Gnome_chomsky said:
Hey I am trying to figure this out. did OP ever find an answer?
For me, I am on a pixel 5 with android 13, a phone I got from Backmarket. It is an "Unlocked" pixel 5. I thought this would make things easier. According to an article, pixel 5 is "one of the easiest phones to root"
:/
The phone is not A/B, only A
I pulled the magisk image using adb to the file with platform tools
I tried sideloading a hosts file through ADB but I got Error 21.
I have tried rooting the phone with Magisk boot.img but it fails because in Fastboot "Remote: failed to write to partition not found" and in FastbootD there is also an error.
SU is not found when I attempt to use the adb shell. It is Greyed out in the Magisk App
I have mounted the /system with Recovery but then I receive "Remote: no such file or directory"
I am using the most current Platform tools.
Any advice? Really I just want to edit the hosts file
Click to expand...
Click to collapse
Don't do this method...
Once you're rooted with Magisk, open Magisk and go to settings and tap Systemless hosts. This installs the Systemless Hosts module. Then you can just use an app like AdAway (https://f-droid.org/en/packages/org.adaway/) and block the domains you want there.

Related

How to Install 4.2 images, keep root and all data

**Disclaimer** If you don't understand what follows, don't attempt this. I'm not responsible for you softbricking your device,
This is a quick guide for how to install the new android without losing anything. You'll need fastboot for this. Also, before doing this, be sure to download the supersu cwm update zip, and have it on your sdcard. Make sure you also already have a custom recovery installed (I did twrp, but i'm sure cwm will work just as well). I would also suggest having a backup done, through titanium backup and through recovery, just incase.
First, download the factory images for the n7 from google's website. Decompress them (if you're in windows, you'll need winrar or something similar.) After you decompress the archive, there'll be another one inside (image-nakasi-jop40c.zip), decompress this one as well. Under here, you'll see the .img files for all the partitions. For now, go up one directory. You'll also see here bootloader-grouper-4.13.img. Once you have all this, reboot into the bootloader.
Once you're in the bootloader, you can update the bootloader to the new version (this step isn't needed, but I did it anyways). Plug into your pc, and type fastboot devices. Make sure it's not blank. If it is, you have to update drivers. If you can see the device, open up a command prompt, and cd to the directory that has the bootloader-grouper file. Type the following:
fastboot flash bootloader-grouper-4.13.img
then, after it's done, type:
fastboot reboot-bootloader
Now, you'll be booted back into the bootloader, it'll say 4.13. On to the rom.
cd into the folder image-nakasi-jop40c (make sure you see the files system.img and boot.img before you continue. If you don't see them, the next steps will do nothing but erase your kernel and system parition.)
now, you see the image files. Type the following (still in the bootloader)
fastboot erase system
fastboot flash system system.img
wait until it completes, then type:
fastboot erase boot
fastboot flash boot boot.img
Once this is done, hit the volume up on the device until it shows recovery mode on the top. When it does, push the power key and you'll boot into your recovery (shouldn't be touched.) Inside here, flash the supersu cwm zip file, which'll flash the superuser binary, and supersu. Once this is done, do a factory reset (removing your data and cache.) Boot into the rom.
Once it's booted, you'll notice your internal sd card appears to be empty (mine did, I was worried at first.) For some odd reason, it moved the entire contents of my sdcard into a folder on it called 0. When you get back into android, simply move the folder all up one level so they're in the proper place. You now have the rom booted, rooted, with all your data. Now, you can do a titanium restore to get all your stuff back.
My first boot got stuck for some reason. if it happens to you, just hold the power button and hard reboot. (I did this on 2 devices, it only happened to one of them, so I figured I'd give you all warning.)
Links:
SuperSu binary: https://docs.google.com/open?id=0B7a8xHNJlpgTR0ZkR1pWZWR2VzA
Google Factory Images: https://developers.google.com/android/nexus/images
Thanks for this.
I flashed the 4.2 ota in the dev section and I lost root. Can I just flash the supersu binary in cwm to regain root?
Thanks for this.. Apparently you found out too a clean 4.2 isn't rootable via typical methods.
That SuperSU package did the trick. I have to remember to keep a SuperSU binary on hand for these kinds of situations that SuperUser fails..
jefferson9 said:
Thanks for this.
I flashed the 4.2 ota in the dev section and I lost root. Can I just flash the supersu binary in cwm to regain root?
Click to expand...
Click to collapse
Yes. If you do it though cwm, you're not using any exploits, you're just inserting the superuser binary and supersu.apk into the proper places on the rom. On any nexus device, any rom, this will root it.
mstrk242 said:
Once it's booted, you'll notice your internal sd card appears to be empty (mine did, I was worried at first.) For some odd reason, it moved the entire contents of my sdcard into a folder on it called 0. When you get back into android, simply move the folder all up one level so they're in the proper place.
Click to expand...
Click to collapse
DANGER WILL ROBINSON!!
The "odd reason" is called "multiple users" - add a second user and they get a folder called 10.
tehSmoogs said:
DANGER WILL ROBINSON!!
The "odd reason" is called "multiple users" - add a second user and they get a folder called 10.
Click to expand...
Click to collapse
Exactly.
If everything goes right we should have an AOSP prerooted build in about *looks at watch* 20 minutes.... Unless there is a compile error or SU error. *laff*
Back to watching the scrolling terminal window
Just got this working on a mac...
did not update bootloader(couldnt get it to)
other than that, same commands except all fastboots are ./fastboot on a mac
the only other trick is i needed the fastboot and abd files in the jop40c folder...seems to have worked like a charm....im deff on 4.2 with su installed... and it looks like my data is still there...once google is done restoring i'll know just how sucessfull it is, but so far, seems to work!!!
kwhee07 said:
Just got this working on a mac...
did not update bootloader(couldnt get it to)
other than that, same commands except all fastboots are ./fastboot on a mac
the only other trick is i needed the fastboot and abd files in the jop40c folder...seems to have worked like a charm....im deff on 4.2 with su installed... and it looks like my data is still there...once google is done restoring i'll know just how sucessfull it is, but so far, seems to work!!!
Click to expand...
Click to collapse
I did this all on linux, just kind of adapted the guide for windows. I figured all the linux users would understand how to do it on their own. Glad to know it's the same for mac as well.
OK where did they put the developer options? Not in settings on my 32GB 4.2 device
Never mind. This: http://www.androidpolice.com/2012/1...hidden-in-android-4-2-heres-how-to-find-them/
rootbrain said:
OK where did they put the developer options? Not in settings on my 32GB 4.2 device
Never mind. This: http://www.androidpolice.com/2012/1...hidden-in-android-4-2-heres-how-to-find-them/
Click to expand...
Click to collapse
Settings - about tablet - build number
push it a few times and it will enable dev options
You have .bat file in the package.
Why so complicated?
I downloaded 4.2 from here:
http://android.clients.google.com/p...gned-nakasi-JOP40C-from-JZO54K.094f6629.zipia
I then just flashed it from recovery via CWM.
Done.
CWM asked me if I wanted to maintain root and of course I chose the correct answer on this, so now my N7 is running on a rooted 4.2.
Here is my method:
1. Download official 4.1.2 from http://forum.xda-developers.com/showthread.php?t=1929270 and 4.2 OTA image from http://forum.xda-developers.com/showthread.php?t=1989188
2. Boot into CWM (i have CWM touch installed)
3. Clear data and install 4.1.2, don't forget to turn on root in the installer
4. reboot check that root is fully working
5. reboot into recovery install 4.2
6. before reboot CWM will ask to disable recovery flash and protect root. Ansver yes to both questions
I'm confused, it says if you are already on a custom rom, just flash as usual.
What makes this different?
I was on stock ROM rooted with some system modifications, and this wwadd the only way I could get the update working...
Sent from my Nexus 7 using xda app-developers app
mstrk242 said:
For some odd reason, it moved the entire contents of my sdcard into a folder on it called 0. When you get back into android, simply move the folder all up one level so they're in the proper place. You now have the rom booted, rooted, with all your data. Now, you can do a titanium restore to get all your stuff back.
Click to expand...
Click to collapse
So I'm at the step listed above. I have 4.2 on my device but I can't seem to find this "0" folder. I'm browsing the /sdcard folder via adb shell. Am I looking at the wrong place? Do I have have the incorrect permissions? Or might it not be there?
Thanks.
Ill have to wait until a rooted rom is created, I have no comp.
Sent from my Nexus 7 using XDA Premium HD app
can I install image-nakasi-jop40c.zip directly without upgrading bootloader?
Zuk. said:
So I'm at the step listed above. I have 4.2 on my device but I can't seem to find this "0" folder. I'm browsing the /sdcard folder via adb shell. Am I looking at the wrong place? Do I have have the incorrect permissions? Or might it not be there?
Thanks.
Click to expand...
Click to collapse
Not advisable to move this folder - if it got moved to a new location by the o/s then there's probably a good reason why - maybe like 4.2 introducing multiple users
Each user appears to get their own "home" directory created in /mnt/shell/emulated/
Default user dir is "0"
Second user dir is "10"
Each contain the standard dir's from 4.1 and earlier.
Travelawyer said:
Why so complicated?
I downloaded 4.2 from here:
http://android.clients.google.com/p...signed-nakasi-JOP40C-from-JZO54K.094f6629.zip
I then just flashed it from recovery via CWM.
Done.
CWM asked me if I wanted to maintain root and of course I chose the correct answer on this, so now my N7 is running on a rooted 4.2.
Click to expand...
Click to collapse
You had two extra characters at the end of your link, but I fixed it above and it's good to go for others in the future. Just flashed it in TWRP, it didn't ask if I wanted to maintain root, hit reboot when it was complete and lost root, so it doesn't work for everyone - good news is that all my data remained intact without having to resort to advanced restoring my data from a backup....
When I tried the SuperSU binary root flash trick, I finally got root back. But don't think it's as easy to get to recovery! I had to obtain the TWRP Recovery one more time since it wiped it and put in place a recovery that did absolutely nothing but reboot the device after a few minutes, so you'll have to
Code:
fastboot flash recovery openrecovery-twrp-2.3.1.1-grouper.img
to get TWRP back.... Hope that helped everyone!

[Q] Cant get MB886 into custom recovery

I have been trying for hours to install a custom recovery in my AT&T Atrix HD (mb886) phone. Every time I go through the flashing process, no matter what recovery I try, and whether I use the stock SDK fastboot or one of alternatives, when I try to boot into recovery, I get an ominous error message about how my bootloader is unlocked, and Motorola and ATT will not honor the warranty, and so on. However - it then always boots into the normal startup. I did try holding down both volume buttons when I cycled the power button, and I briefly (about 5 seconds, maybe?) got what looked like a text-based recovery menu, but then the error message popped up again, and I'm back to ????? is going on.
Any help? I have read a number of article/forums online, but all assume that your recovery is working so you can install a custom ROM. I have done this on a couple of Android tablets in the past, so I know I'm not totally stupid, but I can't seem to get past the AT&T nanny.
How can I fix this?
Android 4.1.1
System 98.4.20.MB886.ATT.en.US
If I remember correctly, I had to rename install-recovery.sh (or something like that) by adding .bak to the end of the filename. Boot into fastboot, flash your recovery, and try to boot into recovery.
Nevadadave said:
I have been trying for hours to install a custom recovery in my AT&T Atrix HD (mb886) phone. Every time I go through the flashing process, no matter what recovery I try, and whether I use the stock SDK fastboot or one of alternatives, when I try to boot into recovery, I get an ominous error message about how my bootloader is unlocked, and Motorola and ATT will not honor the warranty, and so on. However - it then always boots into the normal startup. I did try holding down both volume buttons when I cycled the power button, and I briefly (about 5 seconds, maybe?) got what looked like a text-based recovery menu, but then the error message popped up again, and I'm back to ????? is going on.
Any help? I have read a number of article/forums online, but all assume that your recovery is working so you can install a custom ROM. I have done this on a couple of Android tablets in the past, so I know I'm not totally stupid, but I can't seem to get past the AT&T nanny.
How can I fix this?
Android 4.1.1
System 98.4.20.MB886.ATT.en.US
Click to expand...
Click to collapse
That warning you see is just the boot logo and can be gotten rid of by flashing a custom logo. Stock Moto boot logos on this platform have two images -- one for locked and another for unlocked bootloaders. It's a non issue and just confirms that the bootloader is unlocked.
You accessed that menu by powering up and holding both volumes and power. Volume down scrolls and volume up selects in there.
To install a custom recovery, boot into fastboot mode and flash it with fastboot. Mythtools, maybe BootMyHD, can do that for you if you don't have moto-fastboot binary or are unable to run "moto-fastboot flash recovery recovery.img" with your phone plugged into a rear usb port in fastboot mode with a terminal/command prompt open to the directory with the recovery image.
More questions
audit13, how do I access that file to change the name? I tried again this morning, and after doing the boot to recovery key sequence, I got a menu, and before it went away, I selected boot to recovery, but got the dead android icon. I tried several other options and it just did a normal boot. Still stumped.
skeevydude, I have tried installing a couple of custom recoveries, using fastboot, and when I do, I get a message saying all went well, but when I boot up, it either does the "failed Android" or just boots up normally. I'll try Mythtools and BootMyHD, but it seems that there is something else going on here.
Nevadadave said:
audit13, how do I access that file to change the name? I tried again this morning, and after doing the boot to recovery key sequence, I got a menu, and before it went away, I selected boot to recovery, but got the dead android icon. I tried several other options and it just did a normal boot. Still stumped.
skeevydude, I have tried installing a couple of custom recoveries, using fastboot, and when I do, I get a message saying all went well, but when I boot up, it either does the "failed Android" or just boots up normally. I'll try Mythtools and BootMyHD, but it seems that there is something else going on here.
Click to expand...
Click to collapse
Maybe something else going on. Are you flashing using the rear usb port of your PC? It really does matter.
To answer the first question about install-recovery, once you're rooted, use Root Explorer or something similar, mount /system as read/write, go to /system/etc, rename the file install-recovery.sh to install-recovery.sh.bak, and reboot.
If you have adb installed on your PC you can do
adb root
adb shell mount -o remount,rw /system
adb shell cp /system/etc/install-recovery.sh /system/etc/install-recovery.sh.bak
adb shell rm /system/etc/install-recovery.sh
adb reboot
I'll try it and see what happens
skeevydude said:
Maybe something else going on. Are you flashing using the rear usb port of your PC? It really does matter.
To answer the first question about install-recovery, once you're rooted, use Root Explorer or something similar, mount /system as read/write, go to /system/etc, rename the file install-recovery.sh to install-recovery.sh.bak, and reboot.
If you have adb installed on your PC you can do
adb root
adb shell mount -o remount,rw /system
adb shell cp /system/etc/install-recovery.sh /system/etc/install-recovery.sh.bak
adb shell rm /system/etc/install-recovery.sh
adb reboot
Click to expand...
Click to collapse
OK, I did not know about USB port preference. I'll try it and see what happens. Thanks!
No joy
Nevadadave said:
OK, I did not know about USB port preference. I'll try it and see what happens. Thanks!
Click to expand...
Click to collapse
Well, I tried front and back USB ports, in all cases, adb says "adb can't run as root in production builds". adb sees the phone, but about all I can do is start fastboot, but once there adb doesn't work until I reboot.
I tried running the remount command, but got a message, "Operation not permitted" I'm assuming because I could not root into the phone. Titanium backup shows that the phone is, indeed, rooted.
Stuck again...
Install Root Explorer, find the file, add .bak to the end, reboot to fastboot, install Philz, boot into recovery.
audit13 said:
Install Root Explorer, find the file, add .bak to the end, reboot to fastboot, install Philz, boot into recovery.
Click to expand...
Click to collapse
I tried that, got a "Rename failed". It appears that the file is set to read-only, and the Root Explorer doesn't seem to have a way to change that. I'm open to additional suggestions. I had thought that root access would allow me to do things like change file permissions, but I cannot do this with Root Explorer. Everything I try, I get a message that it can't be done, because the file system is read-only.
At the top of the file list, it says "mounted as r/o, but nothing shows to change that, although I see num,erous web posts that claim that there should be a "R/W" button somewhere.
Better luck
Nevadadave said:
Well, I tried front and back USB ports, in all cases, adb says "adb can't run as root in production builds". adb sees the phone, but about all I can do is start fastboot, but once there adb doesn't work until I reboot.
I tried running the remount command, but got a message, "Operation not permitted" I'm assuming because I could not root into the phone. Titanium backup shows that the phone is, indeed, rooted.
Stuck again...
Click to expand...
Click to collapse
OK, I dropped Root Explorer and loaded ES File Explorer. ES Explorer allowed me to change the file R/W permissions and rename the stock recovery file.
adb would still not allow me to get to root, so I loaded adbd insecure from the Play store, and that gave me root access. I flashed the CWR 6.0.4.4, and so far (fingers crossed) I was able to boot to CWM and I'm backing up my system now. Hopefully, the next update will be to say that I have a new ROM installed...
Nevadadave said:
OK, I dropped Root Explorer and loaded ES File Explorer. ES Explorer allowed me to change the file R/W permissions and rename the stock recovery file.
adb would still not allow me to get to root, so I loaded adbd insecure from the Play store, and that gave me root access. I flashed the CWR 6.0.4.4, and so far (fingers crossed) I was able to boot to CWM and I'm backing up my system now. Hopefully, the next update will be to say that I have a new ROM installed...
Click to expand...
Click to collapse
All you need to gain r/w access is to click on the ro button to change it to read/write.
audit13 said:
All you need to gain r/w access is to click on the ro button to change it to read/write.
Click to expand...
Click to collapse
Audit13 I'm not sure what you mean here. Root Explorer never indicated a "R/O" button or any other way to change permissions, it just kept saying that the file system was write-protected. ES File Explorer was very easily able to change this and allow me to remove the automatic recovery overwrite.
So, at this point, I have Cyanogen 10.2 running on my Atrix HD, and although I have found a few glitches, it is faster and it is now MINE!
Nevadadave said:
Audit13 I'm not sure what you mean here. Root Explorer never indicated a "R/O" button or any other way to change permissions, it just kept saying that the file system was write-protected. ES File Explorer was very easily able to change this and allow me to remove the automatic recovery overwrite.
So, at this point, I have Cyanogen 10.2 running on my Atrix HD, and although I have found a few glitches, it is faster and it is now MINE!
Click to expand...
Click to collapse
In Root Explorer, You'll see the words "Mounted as r/o". To the right will be a button that says "Mount R/W".
I went with Validus 5.1 over 10.2.

[Q] Atrix HD can't access recovery mode

I've been trying for sometime now to install a custom rom (CM11 or anything else for that matter) on my Atrix HD. I got as far a unlocking my boot loader so now every time I reboot, I get a scary warning message saying, my phone has been tampered with.
I've made several attempts to install CWM and even though it seems to install, if I try to boot my phone by holding the power and volume down buttons at the same time, it seems to do nothing, or it will just boot normally. I did try to hold down the power and volume up and volume down buttons and that leads to a menu. One of the options was recovery. I selected that, but then a display of android robot with a red triangle.
Can anyone give me some tips on what I'm doing wrong. I'm a programmer, but I have no experience with android, so you can stay technical but not too "android specific" technical.
Thanks,
Mark
Are you installing it via fastboot? Once you flash recovery, do not allow the phone the reboot. Try and boot into recovery.
If you still can boot into cwm, boot the phone, install Root Explorer, and rename recovery.sh to recovery.sh.bak, boot to fastboot, install cwm, and boot into cwm.
audit13 said:
Are you installing it via fastboot? Once you flash recovery, do not allow the phone the reboot. Try and boot into recovery.
If you still can boot into cwm, boot the phone, install Root Explorer, and rename recovery.sh to recovery.sh.bak, boot to fastboot, install cwm, and boot into cwm.
Click to expand...
Click to collapse
These are the commands I used.
adb devices
adb reboot bootloader
fastboot devices
fastboot flash recovery recovery.img
fastboot reboot
Where recovery.img was the CWM one.
Based on another thread, I attempted to rename ~/system/etc/install_recovery.sh, but even though I'm rooted, ES File Explorer not Root File Explore is able to rename that file.
Any help would be appreciated.
Thanks,
Mark
After renaming the file, stock recovery still comse up?
Sorry, there was a typo. I was NOT able to rename the file.
Use root explorer to do it. That's what I did.
audit13 said:
Use root explorer to do it. That's what I did.
Click to expand...
Click to collapse
I had tried that.
I had installed
ES File Explorer
Root File Explorer
Root File Manager Explorer
All seemed to either give an error or just not change the name. Is there a trick? I'm pretty sure my phone is rooted since I am prompted to ask permission to do these things. I think if I can get past this the renaming issue, I may actually be able to install a new rom. Can you help?
Thanks,
Mark
Did you change the permission in root explorer to r/w from r/o?
Can you be more specific about "root explorer" which app is it. I've used a couple of root file explorers and none of them can seem to rename /system/etc/install-recovery.sh.
I tried to use Root File Manager to change the permissions on that file to have write permissions. The problem is that it says it does, but then when I look again, it's unchecked.
I checked the /system/etc folder and it has write permissions for "owner". I tried to create a test folder in it. It said it was granted permission, but in the end, the test folder was not created.
Maybe my phone is not rooted properly?
I'm not sure at which point in the rooting process I got this, but I have an app named "#SuperSU". If I open it and check it's logs, I can now see an error message saying "SuperSU Pro is required for this feature". Did I screw up with rooting? Should I use something else. Any help to remedy this would be greatly appreciated.
Thanks,
Mark
markdemich said:
Can you be more specific about "root explorer" which app is it. I've used a couple of root file explorers and none of them can seem to rename /system/etc/install-recovery.sh.
I tried to use Root File Manager to change the permissions on that file to have write permissions. The problem is that it says it does, but then when I look again, it's unchecked.
I checked the /system/etc folder and it has write permissions for "owner". I tried to create a test folder in it. It said it was granted permission, but in the end, the test folder was not created.
Maybe my phone is not rooted properly?
I'm not sure at which point in the rooting process I got this, but I have an app named "#SuperSU". If I open it and check it's logs, I can now see an error message saying "SuperSU Pro is required for this feature". Did I screw up with rooting? Should I use something else. Any help to remedy this would be greatly appreciated.
Thanks,
Mark
Click to expand...
Click to collapse
I upgraded to SuperSU Pro. It was only $2.50. Now the log says, "Unable to chmod /system/etc/install-recovery.sh: Read-only file system"
This happened when trying to give write permissions to that file. Am I doing something wrong?
if your adb is setup and working try using this command in adb 'adb reboot recovery' and see if the phones boots to little android with its heart open given a excalmation mark there press all three buttons at the same time and recovery should open
mega_man said:
if your adb is setup and working try using this command in adb 'adb reboot recovery' and see if the phones boots to little android with its heart open given a excalmation mark there press all three buttons at the same time and recovery should open
Click to expand...
Click to collapse
I did that and when the screen you described displayed, pressed the power, and center of the volume up and down rocker switch so I can get but up and down. After a few seconds the screen went blank and I let go. The phone then just booted normally without going into recovery.
markdemich said:
I upgraded to SuperSU Pro. It was only $2.50. Now the log says, "Unable to chmod /system/etc/install-recovery.sh: Read-only file system"
This happened when trying to give write permissions to that file. Am I doing something wrong?
Click to expand...
Click to collapse
Root Explorer: https://play.google.com/store/apps/details?id=com.speedsoftware.rootexplorer&hl=en
audit13 said:
Root Explorer: https://play.google.com/store/apps/details?id=com.speedsoftware.rootexplorer&hl=en
Click to expand...
Click to collapse
Thanks. I purchased that app and when I tried to set the permissions of the file it prompted to mount the volume with write permissions. Once it did that, everything else worked.
Thanks again,
Mark

BLU R2 LTE??? unlock/rootable?

I picked up a BLU R2 LTE (16g/2GB version) for dirt, Build: BLU_R0170WW_V7.0.04.01. Is it even remotely possible to unlock and root this thing or am I stuck with a bone stock android?
DaGoo_Balls said:
I picked up a BLU R2 LTE (16g/2GB version) for dirt, Build: BLU_R0170WW_V7.0.04.01. Is it even remotely possible to unlock and root this thing or am I stuck with a bone stock android?
Click to expand...
Click to collapse
It apparently is.
https://forum.xda-developers.com/r1-hd/development/unofficial-lineageos-14-1-t3689435/post75020813
Thanks. Looks like I have plans for NYE
I managed to root the phone by unlocking the bootloader with fastboot, then using Magisk in conjunction with the boot image file dumped by ipdev in this post.
Unlock your bootloader by running
Code:
fastboot oem unlock
Copy the blur2-boot.img file available here to your phone.
Install Magisk Manager, then generate a patched version of the blur2-boot.img file using the app.
Copy the patched version back to your computer and flash it to the boot partition with
Code:
fastboot flash boot /path/to/patched_boot.img
After this you should have root via the Magisk Manager app.
somed4ze said:
I managed to root the phone by unlocking the bootloader with fastboot, then using Magisk in conjunction with the boot image file dumped by ipdev in this post.
Unlock your bootloader by running
Copy the blur2-boot.img file available here to your phone.
Install Magisk Manager, then generate a patched version of the blur2-boot.img file using the app.
Copy the patched version back to your computer and flash it to the boot partition with
After this you should have root via the Magisk Manager app.
Click to expand...
Click to collapse
You would be better off to patch my boot image and fastboot boot it.
Then backup your boot image, patch it with magisk, and flash that one back to the device.
Code:
adb shell su -c "dd if=/dev/block/mmcblk0p7 of=/sdcard/blur2-boot.img"
This keeps things clean, just incase you are using a boot image that is different from your own device. Plus you have a "stock" boot image backup if you ever need it.
Not a bad idea to grab recovery also.
Code:
adb shell su -c "dd if=/dev/block/mmcblk0p8 of=/sdcard/blur2-recovery.img"
Sent from my ford using XDA Labs
BLU R2 LTE files. Link
somed4ze said:
I managed to root the phone by unlocking the bootloader with fastboot, then using Magisk in conjunction with the boot image file dumped by ipdev in this post.
Unlock your bootloader by running
Code:
fastboot oem unlock
Copy the blur2-boot.img file available here to your phone.
Install Magisk Manager, then generate a patched version of the blur2-boot.img file using the app.
Copy the patched version back to your computer and flash it to the boot partition with
Code:
fastboot flash boot /path/to/patched_boot.img
After this you should have root via the Magisk Manager app.
Click to expand...
Click to collapse
Does it matter if I get the 1gb ram/16gb flash or 2gb ram/32gb flash, or will this work on both? I was planing on ordering this one. Thanks!
bobsmithy said:
Does it matter if I get the 1gb ram/16gb flash or 2gb ram/32gb flash, or will this work on both? I was planing on ordering this one. Thanks!
Click to expand...
Click to collapse
The size of memory "shouldn't" matter.
Braunish said:
Hi there, am trying to root this phone also. Stumbled upon your thread and had a question. If I take the 3 image files (recovery, boot, system) that are included at mediafire site (that you included in your post) and replace the same 3 image files in stock rom, would that work to root the phone? Thank you for any help, I've tried kingoroot, kingroot, and framaroot to no avail.
Click to expand...
Click to collapse
Read back few post on this thread. They discuss successful root method.
Basically unlock bootloader and use majisk manager to patch boot.img and flash patched image with fastboot.
Root R2 Plus w/ BLU R0190WW V7.0.04.01 GENERIC 11-02-2018
DaGoo_Balls said:
Thanks. Looks like I have plans for NYE
Click to expand...
Click to collapse
Hi there, I recently got a Blu R2 Plus and am aiming to root. I used the boot-sign.img that came with that ROM version in title (9447 KB) when patching with Majisk Manager and came up with a patched file of 9.57 MB size. Is there a way to test this ROM, or can you verify that is the same sizes you dealt with when you went through this process. Thank you for any information. It took me a while and a factory reset before I could get majisk manager installed to patch the correct boot-sign.img file.
Hi There copy img file to where on phone
To where do I copy the image file on the phone that gets "patched" by Majisk?
"Copy the blur2-boot.img file available here to your phone."
Thank you very much,
Michael
somed4ze said:
I managed to root the phone by unlocking the bootloader with fastboot, then using Magisk in conjunction with the boot image file dumped by ipdev in this post.
Unlock your bootloader by running
Code:
fastboot oem unlock
Copy the blur2-boot.img file available here to your phone.
Install Magisk Manager, then generate a patched version of the blur2-boot.img file using the app.
Copy the patched version back to your computer and flash it to the boot partition with
Code:
fastboot flash boot /path/to/patched_boot.img
After this you should have root via the Magisk Manager app.
Click to expand...
Click to collapse
Braunish said:
To where do I copy the image file on the phone that gets "patched" by Majisk?
"Copy the blur2-boot.img file available here to your phone."
Thank you very much,
Michael
Click to expand...
Click to collapse
If I understand correctly.
You have adb and fastboot installed.
You have a boot image that works for your device and tested it by using fastboot to boot it. let's call it working_boot.img
You have MagiskManager installed.
The next steps:
adb push working_boot.img /sdcard Doesn't really matter where you put it.
Open MagiskManager
Tap on Install
Select Install
Select Patch Boot Image File
Tap on Internal storage Note: If Internal storage is not displayed. Tap on the 3-dot menu (upper right corner) and select Show SD card.
Scroll down and tap on working_boot.img
When Magisk is done patching the image file, select CLOSE
You can close MagiskManager as well.
adb pull /sdcard/magiskmanager/patched_boot.img
Reboot to bootloader and fastboot boot patched_boot.img
Open MagiskManager. You should see that Magisk is installed and active.
Now that you have temporary root, you have some options.
The easiest way would be to open MagiskManager and use the Direct install option. This will pull, patch and install a patched boot.img to the device.
Unless the the original working_boot.img used is the correct one for your device.
The safer way, pull the stock_boot.img I normally grab recovery also from the device.
For BLU R2 LTE
Code:
adb shell su -c "dd if=/dev/block/mmcblk0p7 of=/sdcard/BLUR2-boot.img"
adb shell su -c "dd if=/dev/block/mmcblk0p8 of=/sdcard/BLUR2-recovery.img"
adb pull /sdcard/BLUR2-boot.img
adb pull /sdcard/BLUR2-recovery.img
Then patch it and fastboot boot it to make sure it works.
After that you can either use MagiskManager Direct install or fastboot to flash the new patched_boot.img.
Bricked my device, used SP Flash Tool to update - Now no OTA?
I hope this is on topic enough to not start a new thread and dirty up the R1 forum
I ended up bricking my Blu R2 LTE by messing with a core APK causing it to boot loop. I didn't have a backup, so I had to resort to using SP Flash Tool to flash back to the only stock rom I could find online. Linked from the post here: www[.]getdroidtips[.]com/nougat-firmware-blu-r2-lte/
The reflash went just fine, but now I noticed I seem to be "stuck" at the January patch level / v01 build, and I'd like to bring it back up to the latest build and use the latest dump you provided w/ Magisk to re-root it again. I've tried all the tricks to get it to try to discover the updates, but nothing is working. It's been about 5 days now with no update offered.
Any idea how I can get it to either accept new OTA releases or where I could find a newer stock rom to reflash?
Thanks for your great work!
Oryx
Just got this phone and should have checked the mediafire link posted by ipdev. -_- Does anyone still have a copy or willing to share a link for me to get it or another method, theres really not much when it comes to this model. I would greatly appreciate it. Must have root to use a blu.
8milerd said:
Just got this phone and should have checked the mediafire link posted by ipdev. -_- Does anyone still have a copy or willing to share a link for me to get it or another method, theres really not much when it comes to this model. I would greatly appreciate it. Must have root to use a blu.
Click to expand...
Click to collapse
These links do not work? Link Direct download links are from MediaFire. Click on the name of the file.
I try to use direct download links from MediaFire. There servers can normally handle it. You do not have to navigate ads and redirects with direct download links.
---------- Post added at 04:58 AM ---------- Previous post was at 04:35 AM ----------
HornyOryx said:
I hope this is on topic enough to not start a new thread and dirty up the R1 forum
I ended up bricking my Blu R2 LTE by messing with a core APK causing it to boot loop. I didn't have a backup, so I had to resort to using SP Flash Tool to flash back to the only stock rom I could find online. Linked from the post here: www[.]getdroidtips[.]com/nougat-firmware-blu-r2-lte/
The reflash went just fine, but now I noticed I seem to be "stuck" at the January patch level / v01 build, and I'd like to bring it back up to the latest build and use the latest dump you provided w/ Magisk to re-root it again. I've tried all the tricks to get it to try to discover the updates, but nothing is working. It's been about 5 days now with no update offered.
Any idea how I can get it to either accept new OTA releases or where I could find a newer stock rom to reflash?
Thanks for your great work!
Oryx
Click to expand...
Click to collapse
A while back , I had to do a factory reset to get an OTA. Then I had to un-root it to get the OTA to flash.

[ROOT] EU LMV405EBW - Magisk

I couldn't find any guide for rooting the V40, so I thought I'd write down the steps I took to root my new EUR V40 - LMV405EBW. Maybe it will help others. Sorry if this is somewhat confusing, I didn't have time to make a polished version. It's basically made from my notes during the process with the commands copied from bash history.
-First, unlock the bootloader following LG's instructions here: https://developer.lge.com/resource/mobile/RetrieveBootloader.dev
There's no TWRP for the V40 and the one made for G7 doesn't work. I don't have the time and knowledge to even attempt to compile TWRP for the V40, so I proceeded with just patching an original boot image with Magisk.
You can get the patched boot images that I used from here:
Oreo 10e: boot_a_magisk_patched_10e.img
Oreo 20f: boot_a_magisk_patched_10f.img
Pie 20a: boot_a_magisk_patched_20a.img
Pie 20b: boot_a_magisk_patched_20b.img
Pie 20f: boot_a_magisk_patched_20f.img
Pie 20g: boot_a_magisk_patched_20g.img
Q 30b: boot_a_magisk_patched_30b.img (this requires flashing to the active boot partition).
Q 30c: boot_a_magisk_patched_30c.img (this requires flashing to the active boot partition)
Q 30d: boot_a_magisk_patched_30d.image (this may or may not work with "fastboot boot" and could require flashing to the active boot partition. I haven't tested if live boot still works. I just did fastboot flash boot_x img_file).
You can try to boot it with with fastboot if you have a LNV405EBW and skip the KDZ extraction part.
Installing Magisk:
Flashing this image isn't necessary, just straight boot should be sufficient and safe.
First install Magisk Manager 7 on the phone then connect the phone to the PC and run:
Code:
adb reboot bootloader
fastboot boot boot_a_magisk_patched_10e.img
After the phone boots the OS with the external boot image, open Magisk Manager and tap on Install. Select the option to Direct install to the active slot. I played it safe and decided to NOT flash also on the inactive slot. I've left it alone so I can use it in case of need of recovery.
You'll probably notice that you don't have a connection to the carrier. Just ignore it, it will back once the phone is booted normally.
Reboot and you will have permanent root until you switch the A/B slots.
In case my patched boot image doesn't work, you can just make your own.
Tools needed:
Magisk Manager 7.0.0 installed on the phone
LG Bridge installed on a Windows machine.
a Linux machine or VM (I used the latest ubuntu desktop), python3 with the zstandard module installed and kdztools from steadfasterX's repo. Maybe kdztools would work on Windows too, I haven't tried it.
adb, fastboot
You need to procure an original ROM file for your phone model. It can be downloaded easily with LG Bridge. Just connect the phone to a Windows PC, start LG bridge, go to the Software update tab and click on Update error recovery. Wait for the download to start and disconnect the phone. Ignore LG Bridge complains about not being able to flash after the downloading stage is completed. Don't click anything in Bridge and before closing it go to C:\Users\<your_username>\AppData\Local\LG Electronics\LG Bridge\SWUpgrade and copy your KDZ somewhere else. Preferably send it to the Linux VM to the LG work folder, it'll be needed there.
On Linux open a terminal:
Code:
cd ~/Documents
mkdir LG
cd LG
git clone https://github.com/steadfasterX/kdztools.git
cd kdztools
nano undz.py -c
For kdztools to be able to extract the V40 images, I needed to edit undz.py and comment the lines 88-90. So, this block should all be commented or undz will fail to extract the boot partitions.
Code:
#if len(dz_item['pad']) != 0:
# print("[!] Error: pad is not empty", file=sys.stderr)
# sys.exit(1)
To extract, with the KDZ copied to ~/Documents/LG/
Code:
cd ~/Documents/LG/kdztools
./unkdz.py -f ../V405EBW10e_00_OPEN_EU_DS_OP_0109.kdz -x
cd kdzextracted/
List the partitions contents and look for the IDs of boot_a and/or boot_b. In my case they were 44 for boot_a and 63 for boot_b
Code:
../undz.py -f V40510e_00.dz -l
Extract boot_a or boot_b or both, they're identical:
Code:
../undz.py -f V40510e_00.dz -s 44
../undz.py -f V40510e_00.dz -s 63
You can find the extracted boot images in the dzextracted subfolder. Get boot_a.image or boot_b.image or both from there and send them to the phone in a location accessible by Magisk Manager. The Download folder should do fine.
Open Magisk Manager and tap Install, select Patch Boot Image file and patch the image file(s) you extracted. Get the patched_boot.img that Magisk Manager saves in the Download folder and send it to a PC where you have adb and fastboot.
Go to the beginning of the post to the Installing Magisk section.
Damned tempting, but I'll wait until after Pie drops.
Sent from my LM-V405 using Tapatalk
Glad to see this, hopefully it's a start for all of us.
If anything, at least a way to unlock the bootloader via legitimate channels! Gonna be generating that string, next chance I get, to be ready.
Sent from my LM-V405 using Tapatalk
Once runningnak3d gets a hold of this, we should be good with the v40. Cool beans.
Hey do the unlock codes online work for $ 12-15 on sprint? I used to flash phones back in the day and got a great deal on a bad IMEI sprint lg v40, but so far I can see there isn’t a way yet. On top off all that I m in Europe and don’t want to get the error message that I m out of the Region. I would have to go to USA just to unlock the phone.
@runningnak3d
Can't I install the firmware on a different device?
V version can not unlock BL, so envious
Getting a boot image like that works but I find it stupid to not upload it so that the others don't have to do it. Besides only one model can be bl unlocked so there won't be any model mismatch (except firmware versions but keeping up with them is not that hard)
LameMonster82 said:
Getting a boot image like that works but I find it stupid to not upload it so that the others don't have to do it. Besides only one model can be bl unlocked so there won't be any model mismatch (except firmware versions but keeping up with them is not that hard)
Click to expand...
Click to collapse
Or I could find you stupid for not noticing the patched image is in my first post.
DLS123 said:
I find you stupid for not noticing the patched images are in my first post.
Click to expand...
Click to collapse
I recommend labeling the boot images with their firmware since future firmwares won't be able to run the same boot image but other than that I'm really sorry.
LameMonster82 said:
I recommend labeling the boot images with their firmware since future firmwares won't be able to run the same boot image but other than that I'm really sorry.
Click to expand...
Click to collapse
I mentioned in the description 1 line below the link that it's for 10e. There was no other update in a long time. I don't think there can be any confusion for now. I can edit and label the file when there's will be another fw update.
It looks like unlocking the bootloader breaks Widevine L1 on the V40 and downgrades is to L3. No more HD or UHD Netflix.
I couldn't find any other solution than to re-lock the bootloader to restore L1.
This doesn't happen on the V30.
@DLS123
Thank you for all!
I ask you for more details; i'm stuck at flashing first image in adb; it returns an error; have LMV405EBW with 10f. unlocked bootloader of course
Thx again for your support!
@daphix what do you mean by flashing the first image? You're not supposed to flash my patched boot image. Just boot it without flashing and Direct install Magisk from it with Magisk Manager.
DLS123 said:
@daphix what do you mean by flashing the first image? You're not supposed to flash my patched boot image. Just boot it without flashing and Direct install Magisk from it with Magisk Manager.
Click to expand...
Click to collapse
Thx for answer; i not have too much experience in working with Magisk;
i just folowed your steps:
First install Magisk Manager 7 on the phone then connect the phone to the PC and run:
adb reboot bootloader
fastboot boot patched_boot_a.img
when i run fastboot comand for flash, is runing, but is returning "an error at line x"
i suppose is something wrong in this instructions.
daphix said:
Thx for answer; i not have too much experience in working with Magisk;
i just folowed your steps:
First install Magisk Manager 7 on the phone then connect the phone to the PC and run:
adb reboot bootloader
fastboot boot patched_boot_a.img
when i run fastboot comand for flash, is runing, but is returning "an error at line x"
Anyway; understand now what to do;
Steps are below:
- first install magisk manager
- download magisk zip from magisk site or from magisk manager himself on phone
- download patched_boot_a.img to phone from our good contributor
- use magisk manager and select inslall image of patched_boot_a.img from phone
- magisk manager will generate a magisk patched image
- transfer this magisk patched image (not patched_boot_a.img) to pc in ADB folder
- flash with Adb this magisk patched image from pc to phone.
Thx to our friend!
---------- Post added at 09:53 AM ---------- Previous post was at 09:21 AM ----------
DLS123 said:
@daphix what do you mean by flashing the first image? You're not supposed to flash my patched boot image. Just boot it without flashing and Direct install Magisk from it with Magisk Manager.
Click to expand...
Click to collapse
Hi;
using Magisk mamanger and your file was generated a file: magisk_patched.img
pls support; trying to flash that image from PC with adb not work:
fastboot flash partition_a magisk_patched.img
Click to expand...
Click to collapse
@daphix
Whatver you're trying to do, is nowhere in the procedure I used. If you already booted with my boot image why are you making another boot image with Magisk and why are you trying to flash that? I never wrote anything of the sort.
if you booted with my patched image you already have temporary root and can use Magisk Manager to Direct install Magisk itself.
DLS123 said:
@daphix
Whatver you're trying to do, is nowhere in the procedure I used. If you already booted with my boot image why are you making another boot image with Magisk and why are you trying to flash that? I never wrote anything of the sort.
if you booted with my patched image you already have temporary root and can use Magisk Manager to Direct install Magisk itself.
Click to expand...
Click to collapse
Hi , thank you for reply;
I tried many combinations of your commands;
maybe due that am noob, but succesion below simply is not working:
First install Magisk Manager 7 on the phone then connect the phone to the PC and run:
adb reboot bootloader
fastboot boot patched_boot_a.img

Categories

Resources