Cam 2 - Moto G5 Plus Questions & Answers

On stock ROM, I can not edit the build prop because it just gives me system can not be mounted errors and on custom ROMs (7.1 because I can't use 8.0 due to WiFi calling and volte not working for me) I am able to edit the build prop just fine but then the camera won't launch. After deleting the line and restarting cameras still don't work. What gives?

you have to restore your build.prop permission to rw-r-r

jackydroid68 said:
you have to restore your build.prop permission to rw-r-r
Click to expand...
Click to collapse
Stock it won't let me do that. I prefer stock so I wish I could remember how I fixed the Mount issue. I believe I've done it before.

Are you stock and rooted... or just "stock" and using TWRP to modify the file? If you are using TWRP to modify the file, you will have to change it's permissions with adb in TWRP after you have mounted system read-write in TWRP, like this:
Code:
adb shell
cd system
chmod 644 build.prop
- Source

acejavelin said:
Are you stock and rooted... or just "stock" and using TWRP to modify the file? If you are using TWRP to modify the file, you will have to change it's permissions with adb in TWRP after you have mounted system read-write in TWRP, like this:
- Source
Click to expand...
Click to collapse
I'm stock rooted. However on stock rom, it won't even let me mount the system in TWRP. I check the box and nothing happens.

carnivalrejectq said:
I'm stock rooted. However on stock rom, it won't even let me mount the system in TWRP. I check the box and nothing happens.
Click to expand...
Click to collapse
Since your not really explaining how you are trying to do it, I am going to assume adb (which is easiest)...
Code:
adb shell
su
mount -o rw,remount -t ext4 /system
chmod 644 /system/build.prop
if the mount command doesn't work, try it like this...
mount -o rw,remount /dev/block/dm-0 /system
Then exit and reboot the phone, should be good after that.
I haven't tried rooting my G5 yet, probably never will, but I do know that many newer phones have special security in place and you cannot remount from adb.
I assume you have tried mounting /system RW in ES File Manager or Solid Explorer?

acejavelin said:
Since your not really explaining how you are trying to do it, I am going to assume adb (which is easiest)...
if the mount command doesn't work, try it like this...
mount -o rw,remount /dev/block/dm-0 /system
Then exit and reboot the phone, should be good after that.
I haven't tried rooting my G5 yet, probably never will, but I do know that many newer phones have special security in place and you cannot remount from adb.
I assume you have tried mounting /system RW in ES File Manager or Solid Explorer?
Click to expand...
Click to collapse
Yeah I haven't even tried it through adb yet because my laptop is slow as molasses but I have tried through TWRP and solid explorer. Everything mounts fine on custom roms, just not stock.

I just went through this a few days ago, I was going bonkers. I managed in the end to mount system in TWRP, but it was like a different set of files... build.prop was there, I pulled it, edited, and pushed it back, but reboot into system had a DIFFERENT build.prop. Made no sense. I rebooted back into TWRP, mounted system again, found the build.prop there had my changes. It was like there were two versions of /system, one that TWRP gave me and one that the system used. It was maddening, to say the least. Somewhere around 2 or 3am, I started getting sloppy trying to get to the bottom of all this, and I accidentally deleted my system partition and soft bricked the phone.
Thankfully I found this thread:
https://forum.xda-developers.com/g5-plus/development/rom-twrp-flashable-stock-builds-t3675616
These are stock roms that are flashable in TWRP, but modified in that Dm-verity and force encryption have been disabled in the boot images. With this installed, my phone booted properly again and TWRP had no problem accessing the file system... and thankfully this time around, it was the same /system being mounted as the booted phone, everything actually made sense for a change.
I would strongly recommend flashing that modified stock rom and starting over. Camera2 and everything are running properly and I couldn't be happier.

Dishe said:
I just went through this a few days ago, I was going bonkers. I managed in the end to mount system in TWRP, but it was like a different set of files... build.prop was there, I pulled it, edited, and pushed it back, but reboot into system had a DIFFERENT build.prop. Made no sense. I rebooted back into TWRP, mounted system again, found the build.prop there had my changes. It was like there were two versions of /system, one that TWRP gave me and one that the system used. It was maddening, to say the least. Somewhere around 2 or 3am, I started getting sloppy trying to get to the bottom of all this, and I accidentally deleted my system partition and soft bricked the phone.
Thankfully I found this thread:
https://forum.xda-developers.com/g5-plus/development/rom-twrp-flashable-stock-builds-t3675616
These are stock roms that are flashable in TWRP, but modified in that Dm-verity and force encryption have been disabled in the boot images. With this installed, my phone booted properly again and TWRP had no problem accessing the file system... and thankfully this time around, it was the same /system being mounted as the booted phone, everything actually made sense for a change.
I would strongly recommend flashing that modified stock rom and starting over. Camera2 and everything are running properly and I couldn't be happier.
Click to expand...
Click to collapse
I believe I AM using one of those zips so im not sure how this ended up happening but I'll flash again and see if it helps. Thank you so very much for the reply. Really appreciate it. How's camera2 working for you? You using that modified Google cam with HDR+ or is it just helping the stock camera even more so?

carnivalrejectq said:
I believe I AM using one of those zips so im not sure how this ended up happening but I'll flash again and see if it helps. Thank you so very much for the reply. Really appreciate it. How's camera2 working for you? You using that modified Google cam with HDR+ or is it just helping the stock camera even more so?
Click to expand...
Click to collapse
Stock camera still seems to have sharpening and NR that reduces details. I think it improved some other apps, especially enabling the use of Camera2 on apps that use it (and even allows some apps to record in RAW, which is neat but too much trouble to get working properly). But apps that don't necessarily use Camera2 will still look similar I think, including the stock app.
The Google HDR+ app really makes the hardware here shine, I've got to admit. Its a shame that since I'm running the stock firmware we're stuck with the 32-bit buggy version. It isn't very stable, and the focusing is kind of frustrating when it decides not to cooperate. There's a workaround to use video mode to focus, then switch back to camera mode and lock AE/AF, but even then sometimes I find that on close-focus objects, the focus will shift a bit upon reinit on photo mode before I can lock AF. But when it works... man, it REALLY makes a difference! I went from wanting to return the phone to being rather pleased with it.
Attaching a couple of samples. One of harsh contrasting light by a window, and another in a dark alley outside my office.

Dishe said:
Stock camera still seems to have sharpening and NR that reduces details. I think it improved some other apps, especially enabling the use of Camera2 on apps that use it (and even allows some apps to record in RAW, which is neat but too much trouble to get working properly). But apps that don't necessarily use Camera2 will still look similar I think, including the stock app.
The Google HDR+ app really makes the hardware here shine, I've got to admit. Its a shame that since I'm running the stock firmware we're stuck with the 32-bit buggy version. It isn't very stable, and the focusing is kind of frustrating when it decides not to cooperate. There's a workaround to use video mode to focus, then switch back to camera mode and lock AE/AF, but even then sometimes I find that on close-focus objects, the focus will shift a bit upon reinit on photo mode before I can lock AF. But when it works... man, it REALLY makes a difference! I went from wanting to return the phone to being rather pleased with it.
Attaching a couple of samples. One of harsh contrasting light by a window, and another in a dark alley outside my office.
Click to expand...
Click to collapse
Those do look pretty good. I'm gonna flash one of the zips when I can finally get a chance and try and do this build prop edit again. Any idea which camera apps from the play store use the API?

Off the top of my head I do not. There was a link to a modified one here somewhere which supported RAW in DNG format, but I found it unreliable and a major pain to edit and make look like anything on the phone.
Meanwhile, I found this thread about modifying the in-camera processing to reduce the sharpening and noise reduction:
https://forum.xda-developers.com/showpost.php?p=72246474&postcount=9
Flashed the zip in that post to my stock rom and it cleaned up a lot of apps, including the stock photo app. Cam2 api is necessary for google's HDR plus, but if you just want a better image out of the stock apps, I think that flash is what you need.

Dishe said:
Off the top of my head I do not. There was a link to a modified one here somewhere which supported RAW in DNG format, but I found it unreliable and a major pain to edit and make look like anything on the phone.
Meanwhile, I found this thread about modifying the in-camera processing to reduce the sharpening and noise reduction:
https://forum.xda-developers.com/showpost.php?p=72246474&postcount=9
Flashed the zip in that post to my stock rom and it cleaned up a lot of apps, including the stock photo app. Cam2 api is necessary for google's HDR plus, but if you just want a better image out of the stock apps, I think that flash is what you need.
Click to expand...
Click to collapse
I ended up flashing the stock zip from the post you linked and after that the change to build prop for sure worked and now I'm playing around with one of the Google cams so thanks a lot for sure man. I've been wanting to try it for months while still being able to remain stock. Really appreciate it.

carnivalrejectq said:
I ended up flashing the stock zip from the post you linked and after that the change to build prop for sure worked and now I'm playing around with one of the Google cams so thanks a lot for sure man. I've been wanting to try it for months while still being able to remain stock. Really appreciate it.
Click to expand...
Click to collapse
No problem! Glad it helped! I should probably compile some sort of FAQ or something, lots of information spread across too many threads to make sense of it. But just FYI, I'm pretty sure OTA updates won't work anymore now that you've modified the system.

Related

[MOD][SCRIPT] Get More Storage by Relocating Dalvik Cache!

DISCLAIMER: YOU AGREE TO TAKE FULL RESPONSIBILITY FOR YOUR DEVICE IF YOU PROCEED.
The original thread (http://forum.xda-developers.com/moto-g/general/mod-save-data-space-cache-partition-t2942765) was getting to cluttered up with development and testing so I decided to start a new thread with the "finished" product. The original thread will be renamed to Q&A/Development. We might even ask for the old thread to be closed down. (up to @Bert98, the thread's creator.)
Moto G's internal eMMC card has a ~600Mb partition called /cache, which is not used since the apps' cache is stored in /data, so the latter fills up and the first one stays empty.
Owning a 8Gb model, having 600Mb not available for storage really bugged me, because my phone's memory (/data partition) was always full because it's a 5.7Gb space shared between apps and microSD files.
Now, it may not work for you if:
a) you have A LOT of apps installed.
And by "a lot", I mean more than 90-100 apps, but if you have a 8Gb model, you probably don't
b) you're running ART (this is default in lollipop and newer)
Since ART uses a lot more space than dalvik, the space in the /cache partition probably won't be enough. When I was running ART, it used 1Gb more than dalvik.
Original post by @Bert98
Click to expand...
Click to collapse
This was tested on my moto g 16GB which is running RetailUS_4.4.4 kitkat with CWM recovery. The custom ROM procedure was tested on the same phone but with cm11 Nightly installed.
Prerequisites:
1. You must have "adb root" functioning. If you don't head to this thread: http://forum.xda-developers.com/showthread.php?t=1687590 and there is a free download link at the bottom of the post.
Download and install the apk on your phone. Open up adbd insecure (the new app) and grant it superuser rights PERMANENTLY. Check the box that says "enable insecure binary" and make sure to check the box
that says "enable at boot."
2. You must have a recovery that can accept adb shell commands.
3. Root Access Duh?!
4. A windows machine capable of running batch files.
5. A decent text editor, notepad will work but notepad++ is strongly recommended. (Only needed if you are using STOCK ROM procedure)
Please, please make a nandroid backup before you continue!!!!
Stock ROM procedure:
Read the directions very carefully and then read them again, before continuing.
1. Download the cachemover_v1.3.zip from: LINK REMOVED DUE TO SCRIPT ISSUES.
2. Extract the contents.
3. Connect device to PC and navigate to the extracted folder.
4. Double click/Run the cachemover_Stock.bat
5. Follow the onscreen instructions until you get to the part where it says to edit a file.
6. About halfway through the script it will pull a file called "init.qcom.post_boot.sh" to the folder.
7. Open it with a TEXT editor and navigate to about line 487 (Might be different for 8gb model). Look here for a better understanding: https://www.dropbox.com/s/jr5lyl5s5i2jtpg/where to paste code.PNG?dl=0
8. Start a new line and paste this code in the file: (Refer to the image above for help)
Code:
chmod 655 /cache
chmod 655 /cache/dalvik-cache
chmod 655 /cache/dalvik-cache/*
9. Make sure to save the file in the same folder as the cachemover_Stock.bat
10. Press any key to continue on the script and let it do its thing.
11. It will reboot several times and land you on the home screen/lock screen.
12. If the script hangs after a reboot, you need to unlock the device to reestablish a connection with your computer.
13. There might be one or two force closes but once you close the notifications they will not come back.
Custom ROM procedure:
USE THIS FOR ROMS THAT DO NOT REMOUNT OR CHANGE PERMISSIONS OF /CACHE ON BOOT
1. Download the cachemover_v1.3.zip from: https://www.dropbox.com/s/bzj34g4q1s61ojz/cachemover_v1.3.zip?dl=0
2. Extract the contents.
3. Connect device to PC and navigate to the extracted folder.
4. Double click/Run the cachemover.bat
5. Follow the onscreen instructions.
If anything goes wrong:
Go to recovery, wipe cache, then wipe dalvik-cache and reboot. This should get your device back to how it was.
(If you used STOCK ROM procedure)
The script made a backup of the "init.qcom.post_boot.sh" file to /sdcard/init_backup
You can restore the shell script to /system/etc/ via shell commands or by using a root browser. To restore permissions:
Code:
chmod 740 /system/etc/init.qcom.post_boot.sh
chown root:root /system/etc/init.qcom.post_boot.sh
Custom ROM procedure already has a restore script!
I am currently working on an auto restore script for stock and that will be relased soon, hopefully! :good:
Changelog:
v1.0 - First stable release. Does not work on STOCK ROM.
v1.1 - Added a restore script.
v1.3 - Added support for STOCK ROM. There are still a few bugs.
How it works?!?!
Coming soon...
Huge thanks to @Bert98 and @dd043
Hit the thanks button if it worked! I went through about 50 factory resets, and reflashed the ROM about 25 times, and put about 10 hours of work into this script! Really motivates me for future projects. :laugh:
Thanks for your help man and effort.
I encountered a problem, everything works up until my device boots in CWM to fix permissions, then just sits there doing not alot I don't even see the option in my CWM.
Any ideas? cheers
Sent from my XT1032 using XDA Free mobile app
When it reboots to cwm unplug the cable and replug it, if it hangs just type these commands manually from a command window.
chmod 655 /cache
chmod 655 /cache/dalvik-cache
chmod 655 /cache/dalvik-cache/*
reboot
If this does not work you may ned to go into mounts & storage in the cwm menu and click mount /cache. Then try the commands again.
I'm having some issues on stock.
I thought 0655 fixed everything but no, I can't install any app after moving the dalvik-cache to /cache. I tried chmoding 0777 on the new cache folder, on /cache itself, to no avail.
Code:
E/dexopt cannot open '/data/dalvik-cache/[email protected]' for output
Anyone can confirm it's not only my device? And/or can help find a fix?
Also does someone knows how to execute commands on a particular init step? Real init.rc scripts can do:
Code:
on post-fs-data
mount -o bind /cache/dalvik /data/dalvik-cache
It there was a way to achieve the same from post_boot/init.d we could mount -o bind /cache/dalvik /data/dalvik-cache and all permissions issues would disappear as well as the need for symlink.
You have a typo in the threads title. Just a heads up.
Vuciz said:
You have a typo in the threads title. Just a heads up.
Click to expand...
Click to collapse
Thanks for letting me know!
dd043 said:
I'm having some issues on stock.
I thought 0655 fixed everything but no, I can't install any app after moving the dalvik-cache to /cache. I tried chmoding 0777 on the new cache folder, on /cache itself, to no avail.
Code:
E/dexopt cannot open '/data/dalvik-cache/[email protected]' for output
Anyone can confirm it's not only my device? And/or can help find a fix?
Also does someone knows how to execute commands on a particular init step? Real init.rc scripts can do:
Code:
on post-fs-data
mount -o bind /cache/dalvik /data/dalvik-cache
It there was a way to achieve the same from post_boot/init.d we could mount -o bind /cache/dalvik /data/dalvik-cache and all permissions issues would disappear as well as the need for symlink.
Click to expand...
Click to collapse
Let me try and do that right now... Ill get back to you if it does!
My script works on stock btw... But the mount way seems a bit easier and might cause less errors than my way.
Try it please.
skyguy126 said:
Let me try and do that right now... Ill get back to you if it does!
My script works on stock btw... But the mount way seems a bit easier and might cause less errors than my way.
Try it please.
Click to expand...
Click to collapse
Yes I've tried your script, all went well but the result is the same. The script itself works nicely btw
Applications present before moving cache work perfectly, but I can't install anything new. I suspect it might be my device but before wiping everything I'd prefer feedback from others :fingers-crossed:.
I cannot install new apps as well. The mount command you showed me has the same effect too. I honestly don't know anymore, the sym link did not allow the install of new apps nor did the mount command you sent me. Correct me if I am wrong.
Edit: Going through all the init files on my phone to see which one remounts /cache at boot.
Why does the init.rc get overwritten at boot. Is it because the kernel (boot.img) is the one that copies it over? I have found by changing the perms/locations in this file and init.target.rc you can achieve what this mod is trying to acomplish.
I don't see the mount cache command in CWM strange
I've managed to get back to normal, thanks for everyone's help though, I will keep and eye on the thread
Sent from my XT1032 using XDA Free mobile app
non-windows version?
Thanks for this tool. It's a great idea and our Motos really need it.
However, I have a problem - I do not own a windows license (os x and ubuntu user) and I would prefer not to spend $120 just to use it for this script. Pirating is out of the question for me.
I was wondering if there is any chance of having this script written for linux and/or mac. If impossible, is there a LEGAL way of running windows in a virtual machine? Something like a trial or similar?
If you know how just convert it to shell script for osx and Linux. I give you permission to do this but you may not take credit or rehost your creation.
Ok so I have the kernel extracted and we could modify and flash that, but I believe that it's not really necessary. There are a lot of risks to flashing kernels and I am not willing to take it. So is there a way we can modify dalvik so it creates it's cache in /cache instead.
skyguy126 said:
Why does the init.rc get overwritten at boot. Is it because the kernel (boot.img) is the one that copies it over? I have found by changing the perms/locations in this file and init.target.rc you can achieve what this mod is trying to acomplish.
Click to expand...
Click to collapse
Yes the init.rc is in the boot ramdisk. I don't think it would be worth the trouble to rebuild a boot.img. The moto g is fairly unbrickable but it's quite a lot of work to setup an environment to rebuild an image :/.
Too bad for the mount command, I was sure it was working but maybe I had changed something else and don't quite remember the steps to reproduce
We could possibly implement a shell script toggler for when we need to install new apps, but I'm afraid it'd become annoying fairly quickly: I noticed the issue initially because google play services decided to update itself, failed, and broke all google apps. As far as I know this autoupate can't be disabled.
Thanks for trying!
dd043 said:
Yes the init.rc is in the boot ramdisk. I don't think it would be worth the trouble to rebuild a boot.img. The moto g is fairly unbrickable but it's quite a lot of work to setup an environment to rebuild an image :/.
Too bad for the mount command, I was sure it was working but maybe I had changed something else and don't quite remember the steps to reproduce
We could possibly implement a shell script toggler for when we need to install new apps, but I'm afraid it'd become annoying fairly quickly: I noticed the issue initially because google play services decided to update itself, failed, and broke all google apps. As far as I know this autoupate can't be disabled.
Thanks for trying!
Click to expand...
Click to collapse
How about making a simple apk that toggles this feature. Something like when you click the icon it doesn't even open but gives a little notification of success. Something like that. I myself am not experienced with apks but I can put together a shell script for the apk.
skyguy126 said:
Ok so I have the kernel extracted and we could modify and flash that, but I believe that it's not really necessary. There are a lot of risks to flashing kernels and I am not willing to take it. So is there a way we can modify dalvik so it creates it's cache in /cache instead.
Click to expand...
Click to collapse
Patching dalvik itself sounds promising. It can probably be done with in a batch script with a command line hex editor.
The path is defined in frameworks/base/cmds/installd/installd.h
Code:
#define DALVIK_CACHE_PREFIX "/data/dalvik-cache/"
Not sure if there is another mention in the source tree.
But there's nothing to say we wouldn't face the same issue, the error message in the logcat is pretty generic
dd043 said:
Patching dalvik itself sounds promising. It can probably be done with in a batch script with a command line hex editor.
The path is defined in frameworks/base/cmds/installd/installd.h
Code:
#define DALVIK_CACHE_PREFIX "/data/dalvik-cache/"
Not sure if there is another mention in the source tree.
But there's nothing to say we wouldn't face the same issue, the error message in the logcat is pretty generic
Click to expand...
Click to collapse
Ill try it. I don't mind doing a bunch of resets because I am using my moto g as a test bench anyway. My daily driver is the OnePlus One
dd043 said:
Patching dalvik itself sounds promising. It can probably be done with in a batch script with a command line hex editor.
The path is defined in frameworks/base/cmds/installd/installd.h
Code:
#define DALVIK_CACHE_PREFIX "/data/dalvik-cache/"
Not sure if there is another mention in the source tree.
But there's nothing to say we wouldn't face the same issue, the error message in the logcat is pretty generic
Click to expand...
Click to collapse
EDIT: Unfortunately it didn't work. I don't know if I modified the installd file correctly. The program I used is HxD.
Is there a way we can force dalvik to start after the directories are created. And change dalvik to create it in /cache.

Modify the system partition on Android Nougat?

Hi all,
has anyone been able to do this? Following the guide here, no longer works for Android N. The phone boots, but ignores all changes to system. How do I modify both build.prop and hosts? It seems that there are now possibly two system partitions?
Thanks!
Same issue on Nexus 5X
No answer on this? How is it that nobody else seems to be having this issue?
What I've done
It looks to me like everyone has moved to systemless and the /system partition cannot be adequately modified in this way anymore.
Maybe this will help others:
I was modifying the system directory for two reasons: 1. modify /system/etc/hosts to remove ads and modifying build.prop to increase lcd.density. I found that here are the alternatives for each:
Removing Ads
Using something similar to AdAway_systemless_hosts_v2.zip (google it for a copy) and modifying the hosts file in that zip file to be the one I use (and rezipping, deploying on the Android device). This basically mounts over /system/etc/hosts with a custom hosts file instead of actually modifying the system specific hosts file which is no longer writable.
The alternative is to use Netguard which routes non https network traffic through a private VPN where you can block ads according to a hosts file. This seems to work OK, but I have noticed that websites seem to take longer to load.
Modifying lcd.density
You can use the same trick as AdAway_systemless_hosts_v2.zip uses, but modify it to also mount a modified copy of build.prop. Alternatively just use the Android N Display settings that are small (what I did anyhow).
I have been able to edit build.prop and still maintain systemless root.
Sent from my Nexus 6P using XDA-Developers mobile app
I was able to modify my system partition; by installing busy box to /su/xbin and running "su busybox mount -o rw,remount system" (no quotes) in material terminal with root
ArminasAnarion said:
I was able to modify my system partition; by installing busy box to /su/xbin and running "su busybox mount -o rw,remount system" (no quotes) in material terminal with root
Click to expand...
Click to collapse
Have you been able to do this with simply fastboot boot <twrp-image>, mounting system in rw mode and modifying it? I did that as I didn't want to root the phone, and while it looks like it did the write, it does not affect the system partition that is used by the phone after boot. I think there are two system partitions, and twrp mounts only one in rw mode. It does seem like it may be possible to do what you say using adb though after the phone is fully booted up. I'll try that!
dontblinkwatchout said:
Have you been able to do this with simply fastboot boot <twrp-image>, mounting system in rw mode and modifying it? I did that as I didn't want to root the phone, and while it looks like it did the write, it does not affect the system partition that is used by the phone after boot. I think there are two system partitions, and twrp mounts only one in rw mode. It does seem like it may be possible to do what you say using adb though after the phone is fully booted up. I'll try that!
Click to expand...
Click to collapse
I had the same problem. I don't want to root but I do make a few changes to my /system partition through adb in recovery such as the hosts file and some font files (namely the Emoji font file). I had modified stock boot image to not enforce encryption. I would boot back up into the system and couldn't see any changes made. The only thing I found that worked was installing a custom kernel (I use ElementalX). After that, changes I made to /system in TWRP were reflected in the OS. I don't know enough about kernel development to understand why on (mostly) stock kernel my changes couldn't be seen but on a custom one they were.
I never had this "problem" prior to Nougat.
Same issue here. Something has changed with how this is handled in Nougat.
I don't want to root just to overwrite the hosts file...
I'll keep debugging but my capability in this is definitely limited!
I use a similar approach as described in the OP's linked guide except I use my own recovery image that I compiled as an engineering build from source, and I am also experiencing the same behavior. Modifying the hosts file seems to have no impact on the system though the changes persist. Comparing the host file I installed and the host file from the latest Nexus 5X image with 'ls -lZ' the SELinux info looks to be the same. The only information that appears to differ is the modified date and one additional line in the file itself for testing. I thought I was doing something wrong with my hosts file, even though I have been using this approach since Android 6.0. However, I agree, it appears that changes to system are being ignored. Further, changing the system partition no longer shows the red warning at boot about the system being corrupted.
---------- Post added at 09:58 PM ---------- Previous post was at 09:38 PM ----------
DanRyb;68654939 I would boot back up into the system and couldn't see any changes made.[/QUOTE said:
Oooh. You're right. Neither /etc/hosts or /system/etc/hosts is modified in the booted OS after I modify it from live image, but the change is retained when I reboot into live image and mount system. Hmm, so either:
1) Need to figure out where the the system files are being loaded from and modify them from live image if possible
2) Use a mechanism similar to what dontblinkwatchout described AdAway is using of having a custom mount setup (have to reverse engineer AdAway I guess to see what it's doing)
3) ?
Click to expand...
Click to collapse
There's absolutely no way to modify or mount system partition r+w unless you disable dm-verity
Enviado desde mi Nexus 6P mediante Tapatalk
alexiuss said:
There's absolutely no way to modify or mount system partition r+w unless you disable dm-verity
Enviado desde mi Nexus 6P mediante Tapatalk
Click to expand...
Click to collapse
dm-verity has been around since Android 4.4. Are you saying there is something new around this in Android 7.0?
You can modify the system partition by compiling an engineering build of Android and booting it, then mounting the system partition and modifying it. I've been doing this to update the hosts file since Android 6.0 for every OTA update (since more recently OTA updates bomb out unless you reflash the clean "uncorrupted" system.img first). Changing the system image before Android 7.0 did result in an extra screen with a red warning about a corrupted something or other (I'm sure because dm-verity checking failed). Regardless, you can still change the system partition, the information just no longer seems to be used, which is a bit perplexing to me atm.
crashenx said:
dm-verity has been around since Android 4.4. Are you saying there is something new around this in Android 7.0?
Click to expand...
Click to collapse
Android 7.0 introduced redundant bits for reed solomon forward error correction into the system and vendor partitions and code in the kernel to perform the error correction.
Your changes are being written to emmc but when you boot with 7.0 kernel with dm-verity enabled your changes are being treated as data corruption and on-the-fly error corrected back to original.
You can see your changes if you boot into twrp because it has dm-verity disabled. However if you boot into android with dm-verity enabled it will look like original image again even though your changes are technically still there.
It took me a day to figure out what was really going on because i initially had no idea they added this feature to Android N.
The simple way to disable dm-verity is to install SuperSU, but you can also accomplish the same patching your own kernel, installing pre-patched kernel, installing custom kernel, etc.
sfhub said:
Android 7.0 introduced redundant bits for reed solomon forward error correction into the system and vendor partitions and code in the kernel to perform the error correction.
Your changes are being written to emmc but when you boot with 7.0 kernel with dm-verity enabled your changes are being treated as data corruption and on-the-fly error corrected back to original.
You can see your changes if you boot into twrp because it has dm-verity disabled. However if you boot into android with dm-verity enabled it will look like original image again even though your changes are technically still there.
It took me a day to figure out what was really going on because i initially had no idea they added this feature to Android N.
The simple way to disable dm-verity is to install SuperSU, but you can also accomplish the same patching your own kernel, installing pre-patched kernel, installing custom kernel, etc.
Click to expand...
Click to collapse
That's good info and makes total sense. Thanks! Pretty neat actually, just a bummer for me.
Yeah so SuperSU path is not really one I want to pursue. I could learn how to update the dm-verity shas used for verification. That'd probably be the most secure, but it's gonna be a PITA I bet. I imagine I'd need to compile my own image similar to how I made my live image and update a few things. Might have to deal with encryption which is probably an even bigger headache. Also, I bet it would break OTA and have to reflash to update, though that's true now.
I'm really curious what AdAway is doing. Maybe I should pursue reverse engineering that.
I really appreciate you pointing us in the right direction.
I am glad found this thread..willing to assist here without permanent root..
Ericarthurc said:
I was able to modify my system partition; by installing busy box to /su/xbin and running "su busybox mount -o rw,remount system" (no quotes) in material terminal with root
Click to expand...
Click to collapse
I was trying to create a /system/xbin/post-boot but couldn't remount /system, and so I added busybox to the front of my command. I am not using adb so I cut that part off. Thanks a lot!

Viper4Android Discussion

Overall I love the Pixel XL, but with all of my previous Android phones having Root access, I have always run Viper4Android, and in my opinion the sound quality output of the stock Pixel is awful by comparison. So, my primary reason to use the awesome work done by those who brought us bootloader unlock and Root, is to be able to use Viper4Android.
With the changes to Pixel partitions and overall structure, as well as the method of Root, so far I have not been able to get Viper4Android working. This thread will be a place for us to discuss what we have tried, learned, and hopefully figure out a solution! I do think that what ever needs to be done to get it working will be the same for both the Google version of the Pixel (XL) and the Verizon version, as the method of Root is the same for both as well as the overall structure for the partitions and images.
So far, after unlocking bootloader, and then using the Root method, I have not gotten Viper4Android to even detect root. This was with stock kernel, and no other changes to any audio files or other settings. I did install a couple of apps (Titanium Backup, Solid Explorer) to validate Root was working. I also tried installing BusyBox, which seemed to install just fine, but no change to Viper.
I am not very up to speed yet on how systemless root may be a factor in this, the Pixel XL is the first device I have had with it. Anyway, I will keep plugging away at some things and post what I learn.
once there is a custom recovery, it will be very easy to flash packages that will make viper work..
search XDA for the Arise Sound mods
What error are you getting? I'm getting a bad BusyBox error. I fixed the I/O error by renaming audio_effects.conf.
Sent from my Pixel XL using Tapatalk
sionicion said:
What error are you getting? I'm getting a bad BusyBox error. I fixed the I/O error by renaming audio_effects.conf.
Click to expand...
Click to collapse
Viper4Android cannot detect root. See screenshot.
mrhds said:
Viper4Android cannot detect root. See screenshot.
Click to expand...
Click to collapse
I got that error when viper was in priv-app, make sure you set the kernel to permissive. I do it by going into the terminal app and entering the commands su, to gain root, setenforce 0, to switch to permissive, getenforce, to make sure it's permissive.
Sent from my Pixel XL using Tapatalk
To make viper work we have to use the same trick that is used for adaway but with all the files needed by viper which is:
- Move the files to /su
- Make copies of the files viper needs to change, make the changes and copy the modified ones to /su
- Create a /su/su.d/60viper with mount binds on all the files
Or have a modified version of Viper that could read from /su or /system_root instead.
exadeci said:
To make viper work we have to use the same trick that is used for adaway but with all the files needed by viper which is:
- Move the files to /su
- Make copies of the files viper needs to change, make the changes and copy the modified ones to /su
- Create a /su/su.d/60viper with mount binds on all the files
Or have a modified version of Viper that could read from /su or /system_root instead.
Click to expand...
Click to collapse
That's nothing I can figure out but it does confirm my thoughts that viper is having trouble because there is no /system and instead a /system_root. I guess we'll have to wait it out until someone patches viper. Or someone figures out that trick and posts a guide for it.
Sent from my Pixel XL using Tapatalk
I did it! I can't believe it! Viper is working!
So I was googling manual installs of Viper and came across Arise, somebody said you just have to paste the contents to system if you can't flash. That's what I've been doing kinda but it wasn't working before. Anyway I got Arise and went into the zip and into the Leviticus folder and pasted the contents where I believed they belonged. I got some errors so I had to use FX and ES File Explorer together, to rename files, copy files over, etc. I copied over the files to the folders underneath /system_root/system/, except su and su.d. su is just /su in my file apps. Although I think the permissive script is in the wrong spot since I still had to manually run the setenforce 0 command.
Doing it manually this way avoids Viper wanting to install a driver, it's just ready to be powered on, avoiding I/O and busybox errors. Leviticus 1.3 is what I used from the Arise website since I couldn't find any other download and it was on the header of the website.
Now if I could just figure out how to increase sound output. The mixer_paths.xml is different slightly, the digital volumes are like digital mix volumes, and changing their values doesn't seem to have an effect. I still have to play around with that, I might just wait for someone else to discover what values alter the headphone sound output. But at least I made progress! Hope this helps some people out.
Sent from my Pixel XL using Tapatalk
Viper is working!!
@Mentalmuso posted his work on a script that takes care of permissive, busybox issues, etc.! Thanks a ton! I downloaded the zip package, ran the script and it works! Here is the link:
http://forum.xda-developers.com/pixel-xl/themes/mod-weta-audio-t3491179
@sionicion: I was about to test out your route as it looked promising, but then noticed the other post
quick question... (this may be stupid)
If you root - get viper working
can you then unroot and be good as far as safetynet and stuff?
Or does viper ALWAYS need root?
I'm trying to warm up to the idea of not rooting this phone and maybe doing android pay.
So much stuff that I used to use root for isn't needed anymore (culminating with the "autotools" addon for tasker)
But I just don't know if I can live without viper, it makes such a huge difference.
Thanks,
I've learned to live without it. It's tough as Viper is really good but I really grew tired of coming up with workarounds for an app that isn't even maintained anymore. Fiddled around with the stock eq in Play Music for awhile before I was satisfied.
Yea, I really miss Viper too but not sure if I want to root anymore. The only reason I use Viper is for the volume boost for my BT earbuds when watching mkv files in MX Player. For some, all mkv files play at a pretty low volume. Viper is able to increase it substantially. I sitll haven't found a non-root substitute for this problem yet. If anyone can advise on an app that does volume boost for BT headsets, that would be greatly appreciated.

[Q] Ads reapearing after Rooting->Building hosts file>Uninstalling Magisk

Hey, I'm having an interesting issue that I haven't seen before on my previous phones. Normally, I'll occasionally flash magisk to root and update my hosts file with Adaway (and several lists that I've added to it which seem to block most/all ads), then unroot my phone. I noticed with the 6T that after I unroot (restore images, then uninstall through Magisk Manager) that the hosts file seems to be restored back to the stock file without any of my blocks. Am I doing something wrong? Thanks!
the00guy said:
Hey, I'm having an interesting issue that I haven't seen before on my previous phones. Normally, I'll occasionally flash magisk to root and update my hosts file with Adaway (and several lists that I've added to it which seem to block most/all ads), then unroot my phone. I noticed with the 6T that after I unroot (restore images, then uninstall through Magisk Manager) that the hosts file seems to be restored back to the stock file without any of my blocks. Am I doing something wrong? Thanks!
Click to expand...
Click to collapse
Without having some type of ramdisk patch in place, like Magisk or custom kernel, the system will default to the stored system image and effectively undo any changes to the /system partition. Any changes to the system partition that you have made will not be there until you install Magisk or a custom kernel again.
So basically with the stock boot image unmodified you cannot make persistent edits on the /system partition from my experience.
Wow, I was not aware that the system started keeping a clean system image like that. Historically I've always been able to modify /system with root and then unroot and the changes would remaim. Since TWRP is part of /boot now, perhaps that would be sufficient to prevent the stock boot from rewriting my /system changes...? Are there any other ways to prevent the system from being restored to stock after unrooting?
the00guy said:
Wow, I was not aware that the system started keeping a clean system image like that. Historically I've always been able to modify /system with root and then unroot and the changes would remaim. Since TWRP is part of /boot now, perhaps that would be sufficient to prevent the stock boot from rewriting my /system changes...? Are there any other ways to prevent the system from being restored to stock after unrooting?
Click to expand...
Click to collapse
As far as I know the phone wont boot with just TWRP installed, you need Magisk as well. So if you don't want to keep Magisk installed I suggest installing only a custom kernel. I personally love Smurf Kernel here (https://forum.xda-developers.com/oneplus-6t/development/kernel-smurfkernel-2-0-49-t3868360). Although I have not tested to see if /system modifications stick with only custom kernel but I feel like they should since it is modifying the ramdisk to allow the phone to boot modified. I know that Smurf Kernel will detect if you have Magisk or not and patch the boot image accordingly. So you will be able to run just a custom kernel without root if this is what you want.
Also if you are not aware you can disable all root access from the Magisk app without having to uninstall anything, maybe that could work for you as well.
Make sure to hit the thanks button if I was able to help you out here!
the00guy said:
Wow, I was not aware that the system started keeping a clean system image like that. Historically I've always been able to modify /system with root and then unroot and the changes would remaim. Since TWRP is part of /boot now, perhaps that would be sufficient to prevent the stock boot from rewriting my /system changes...? Are there any other ways to prevent the system from being restored to stock after unrooting?
Click to expand...
Click to collapse
You could always, edit the partition directly in TWRP and install an alternative host file.
tech_head said:
You could always, edit the partition directly in TWRP and install an alternative host file.
Click to expand...
Click to collapse
The issue is that Android will replace the /system partition with the stored stock system image if you do not have a modified ramdisk. So if you remove Magisk and don't use custom kernel you effectively cannot modify anything on /system as it will not persist.
yerger said:
The issue is that Android will replace the /system partition with the stored stock system image if you do not have a modified ramdisk. So if you remove Magisk and don't use custom kernel you effectively cannot modify anything on /system as it will not persist.
Click to expand...
Click to collapse
Hopefully the community can find a workaround eventually for this that won't replace the /system with a clean image, or find a way to patch the clean image when performing root operations. Some apps can still detect/are broken by magisk, as good as it is, and I hate running any of my phone without ad blocking. I tried going the DNS route, but have yet to find a good private dns provider that oxygen os plays nicely with that also doesn't log.
the00guy said:
Hopefully the community can find a workaround eventually for this that won't replace the /system with a clean image, or find a way to patch the clean image when performing root operations. Some apps can still detect/are broken by magisk, as good as it is, and I hate running any of my phone without ad blocking. I tried going the DNS route, but have yet to find a good private dns provider that oxygen os plays nicely with that also doesn't log.
Click to expand...
Click to collapse
Try using just a custom kernel. You can do that without root and it should prevent /system from being overwritten with the stored system image. The issue is that you need a patched ramdisk in order for the /system partition to boot modified. No way around that unfortunately.
I personally use Smurf Kernel (https://forum.xda-developers.com/one...-0-49-t3868360) and get much better battery life than the stock kernel. The phone is much smoother and snappier as well.
yerger said:
Try using just a custom kernel. You can do that without root and it should prevent /system from being overwritten with the stored system image. The issue is that you need a patched ramdisk in order for the /system partition to boot modified. No way around that unfortunately.
I personally use Smurf Kernel (https://forum.xda-developers.com/one...-0-49-t3868360) and get much better battery life than the stock kernel. The phone is much smoother and snappier as well.
Click to expand...
Click to collapse
Thank you all for the information. It seems I need to read up more on how android pie works behind the scenes particularly with the ramdisk and how the system position is managed.
https://blokada.org/
Non root adblocker, many lists available, DNS change
Or just use Adguard DNS. Works great.

What have you guys done with your rooted ZTE Blade ZMAX?

After a year since the release, the ZTE Blade Zmax is finally able to be rooted . I want to know, what have you guys done so far with your rooted devices? Any custom tweaks, used a cheat engine, etc? Have you looked into any custom ROMs that may possibly work for this phone? Comment below what you have done so far. Me personally, I tweaked my battery a lot and did a little modification to my kernel. With both magisk and xposed, I have been able to do a lot so far, but I want to do more. That is why I am curious to know cool things that you guys have done so far.
Removed SO much bloat, did the usual magisk modules, used SystemUI Tuner to make some visual changes in the statusbar, and noticed how heavily ZTE modified the system all the way down to the weather app. Currently looking into decompiling and recompiling the systemui to remove the annoying top left carrier wasn't successful in the first attempt so going at it again.
JasonSec said:
Removed SO much bloat, did the usual magisk modules, used SystemUI Tuner to make some visual changes in the statusbar, and noticed how heavily ZTE modified the system all the way down to the weather app. Currently looking into decompiling and recompiling the systemui to remove the annoying top left carrier wasn't successful in the first attempt so going at it again.
Click to expand...
Click to collapse
Interesting. What type of bloatware did you remove? ANy app specific used for that? For the last couple of days, I have been trying to change the boot animation. After may methods and attempts, it serves as no avail, so likewise to you, we both have things we are trying to accomplish. Hopefully, all goes well. Keep me updated on your status.
evtoofly said:
Interesting. What type of bloatware did you remove? ANy app specific used for that? For the last couple of days, I have been trying to change the boot animation. After may methods and attempts, it serves as no avail, so likewise to you, we both have things we are trying to accomplish. Hopefully, all goes well. Keep me updated on your status.
Click to expand...
Click to collapse
Facebook, metrozone, chrome, few other I can't remember. No app just deleted them from /system/(priv-)app via recovery.
For the bootanimation I found a megathread under Android customization, grabbed the zip for the animation I wanted, rebooted to recovery, setenforce 0 via adb, renamed the old bootanimation.zip to old.zip just in case, then pushed the zip to /system/media and rebooted.
JasonSec said:
Facebook, metrozone, chrome, few other I can't remember. No app just deleted them from /system/(priv-)app via recovery.
For the bootanimation I found a megathread under Android customization, grabbed the zip for the animation I wanted, rebooted to recovery, setenforce 0 via adb, renamed the old bootanimation.zip to old.zip just in case, then pushed the zip to /system/media and rebooted.
Click to expand...
Click to collapse
Im going to try that, hopefully, it works. Why did you remove chrome though? Do you find other browsers better? I personally have good experience with chrome. Im trying to do as much tweaks as possible with the device itself, but I done so much already, Im confused on what else there is to do
Update: Bootanimations only work with soft reboots. Im looking for a way to have my custom boot when I hard reboot my phone.
evtoofly said:
Im going to try that, hopefully, it works. Why did you remove chrome though? Do you find other browsers better? I personally have good experience with chrome. Im trying to do as much tweaks as possible with the device itself, but I done so much already, Im confused on what else there is to do
Update: Bootanimations only work with soft reboots. Im looking for a way to have my custom boot when I hard reboot my phone.
Click to expand...
Click to collapse
I find Via much faster and love the customization. Chrome removal that was less about bloat and more about something I'll never use and if I ever do decide to use it or Facebook again it's available in the play store.
Not sure what you mean about boot animations I believe they're loaded and appear each time the system is booted regardless of hard/soft boot (assuming you're not going to recovery mode obviously)
JasonSec said:
I find Via much faster and love the customization. Chrome removal that was less about bloat and more about something I'll never use and if I ever do decide to use it or Facebook again it's available in the play store.
Not sure what you mean about boot animations I believe they're loaded and appear each time the system is booted regardless of hard/soft boot (assuming you're not going to recovery mode obviously)
Click to expand...
Click to collapse
Well, I use the app quick reboot that allows me to boot into recovery, quick restart, or full restart,etc. When I quick reboot, it will show my custom boot animation I downloaded, but when I full reboot, it shows the default metropcs screen which is annoying in my opinion. Maybe because I set my phone in permissive mode using Terminal and not adb
Well anyway, I'm still going to try and fix this because I hard reboot my phone a lot and I just dont wanna see that metro pcs screen anymore. Also, am I the only blade user whose power button does not know how to function I am really about to take this phone apart because my power button seems impossible to work unless I hold it a certain way, and its been like this for a while and I just dont understand why.
Ive spent over a year trying to make a gps spoofing app work on this phone.
Root really didnt help but twrp did.
Moved the app from /data/app to /system/priv-app
then I chmodded the folder and base.apk to 777
additionally I chowned the folder and base.apk to root:root
xxMoon said:
Ive spent over a year trying to make a gps spoofing app work on this phone.
Root really didnt help but twrp did.
Moved the app from /data/app to /system/priv-app
then I chmodded the folder and base.apk to 777
additionally I chowned the folder and base.apk to root:root
Click to expand...
Click to collapse
interesting, I was just thinking about using gps spoof. Did you end up successful in it
Yup
xxMoon said:
Ive spent over a year trying to make a gps spoofing app work on this phone.
Root really didnt help but twrp did.
Moved the app from /data/app to /system/priv-app
then I chmodded the folder and base.apk to 777
additionally I chowned the folder and base.apk to root:root
Click to expand...
Click to collapse
Bro! Not sure if you read the post I made on the other thread, but actually one of my reasons for rooting was achieving a "working" Spoofing method.
Rooting and moving app to system kind of works, but there it a better way and actually works great on this phone.
Just download Smali Patcher 0.0.4.2 from this thread https://forum.xda-developers.com/apps/magisk/module-smali-patcher-0-7-t3680053 (Thx to F0mey)) and follow the ADB method (Options 1 and 4),
then just flash the generated magisk module,
install your prefered spoofing app (Im using Ninja's) - **Remember to clone**
set as Mock Location
Everything unchecked on Spoof App (I just leave the distance info one on Ninja's app)
Enjoy!
BlazeMz3 said:
Bro! Not sure if you read the post I made on the other thread, but actually one of my reasons for rooting was achieving a "working" Spoofing method.
Rooting and moving app to system kind of works, but there it a better way and actually works great on this phone.
Just download Smali Patcher 0.0.4.2 from this thread https://forum.xda-developers.com/apps/magisk/module-smali-patcher-0-7-t3680053 (Thx to F0mey)) and follow the ADB method (Options 1 and 4),
then just flash the generated magisk module,
install your prefered spoofing app (Im using Ninja's) - **Remember to clone**
set as Mock Location
Everything unchecked on Spoof App (I just leave the distance info one on Ninja's app)
Enjoy!
Click to expand...
Click to collapse
im going to try this. Question, what were your reasons for spoofing? Why did you want to achieve this with root?
xxMoon said:
Ive spent over a year trying to make a gps spoofing app work on this phone.
Root really didnt help but twrp did.
Moved the app from /data/app to /system/priv-app
then I chmodded the folder and base.apk to 777
additionally I chowned the folder and base.apk to root:root
Click to expand...
Click to collapse
Hello could you help me?
Guys might find this easier to use.
(EASY ROOT) Z982 via QFIL or TWRP B20_Modified SYSRW 4/8/19

Categories

Resources