[SCRIPT] Move clock to the right - Xiaomi Redmi 8 Themes, Apps, and Mods

I'm not responsible for damage, loss, etc cause by this script. This script lacks of situation and error management. Please read the script and understand what it does. Please backup your /system/priv-app/MiuiSystemUI/MiuiSystemUI.apk
Tested on xiaomi.eu 11.0.4.0. Should work on any miui11, maybe even other devices with notch.
This scripts moves the system clock in the notch-enabled status bar to the right side of the notch. It does this by pulling the apk, decompiling it in tmp folder and recompiling it. I made this because I got annoyed by the fact that there is tons of space on the right side of the notch while there is no space for notification icons on the left side.
SafetyNet should pass. Reboot after execution to ensure root is read-only.
Requirements:
MIUI 11
Magisk v20+
apktool < v2.6.0 (-c option is required)
adb
a decent linux install
The patch.patch file on the same directory of where you run it. If you're dev you can edit this file to make your custom patch.
PS: xda doesn't let me upload sh, the script is script.txt, rename it into script.sh, make it executable and execute it
EDIT: Will bootloop on Android 10 MIUI 11!

Thanks, it's very useful.
But can you please explain how to run the script?
---------- Post added at 11:00 AM ---------- Previous post was at 11:00 AM ----------
Thanks, it's very useful.
But can you please explain how to run the script?

he script is script.txt, rename it into script.sh, make it executable and execute it

DP FH said:
he script is script.txt, rename it into script.sh, make it executable and execute it
Click to expand...
Click to collapse
I'd rename it. but how to execute it? dublle click on the file or how?

yamabokra1 said:
I'd rename it. but how to execute it? dublle click on the file or how?
Click to expand...
Click to collapse
Via terminal

DP FH said:
Via terminal
Click to expand...
Click to collapse
It seems that you don't have time to explain. thanks anyway

yamabokra1 said:
It seems that you don't have time to explain. thanks anyway
Click to expand...
Click to collapse
Mate, if you don't know how to execute scripts from terminal you probably shouldn't mess around with them.

JaSomTy said:
Mate, if you don't know how to execute scripts from terminal you probably shouldn't mess around with them.
Click to expand...
Click to collapse
Please, spend 10 second to tell here if it worked, so we know on which systems it works

DP FH said:
Please, spend 10 second to tell here if it worked, so we know on which systems it works
Click to expand...
Click to collapse
I'm not getting it right.
Can you assist?
https://ibb.co/N7GXpcS
https://ibb.co/XDMZSv9
I run it, but it says apktool not found?
Please check the link for the picture. Do i have the correct APK tool there? I see you said < 2.6.0, but the highest i can find is 2.4.1

Dude... Running Windows binaries from Linux ain't gonna work. Just install everything from apt.
V2.6.0 does not yet exist, I wrote it for the time being

Rooted phone?
Maybe an obvious question, but does the phone need to be rooted to allow that manipulation?

duplicate message lol

josephlegrand33 said:
Maybe an obvious question, but does the phone need to be rooted to allow that manipulation?
Click to expand...
Click to collapse
Requirements: Magisk v20+ so yes. You can unroot after a successful installation, but if the mod goes away (ota update) you need root to reinstall it

Hey, I think I set up everything right, but when I run it I get
Input file (MiuiSystemUI.apk) was not found or was not readable.
Script: modding
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- /tmp/miuis/res/layout/drip_status_bar_contents_container.xml 2020-01-04 20:09:39.224390176 +0100
|+++ /tmp/miuis/res/layout/drip_status_bar_contents_container.new 2020-01-04 20:09:56.504390102 +0100
--------------------------
File to patch:
Am I missing something?
I'm attaching the output
Thx for your work

I also think I did it right, but get "MiuiSystemUI.apk was not found or was not readable".
(Redmi Note 8 Pro, MIUI Global 11.0.3)
I've also tried to move that stupid clock with Substratum, but overlays seem not affecting system stuff in statusbar and, sadly, CustoMIUIzer doesn't include this setting.

Hi, sorry if I didn't read it straight away. That means MiuiSystemUI.apk couldn't be read. Do you have correct permissions to write files in /tmp?
Try to execute the commands in the script manually. for example, adb pull /system/priv-app/MiuiSystemUI/MiuiSystemUI.apk /tmp/
Can you manage to read the file? Do you see it in /tmp?
If it is, apktool d -p /tmp -o /tmp/miuis/ -s MiuiSystemUI.apk
should work right away

Tancredus said:
I'm attaching the output
Click to expand...
Click to collapse
I've read the log, the apktool decompilation gets straight away skipped for some reason. I'm using 2.4.1 as well.
What happens when you run apktool d -p /tmp -o /tmp/miuis/ -s MiuiSystemUI.apk
manually?

Oh right! My fault. replace
apktool d -p /tmp -o /tmp/miuis/ -s MiuiSystemUI.apk
with
apktool d -p /tmp -o /tmp/miuis/ -s /tmp/MiuiSystemUI.apk
And try again.

Also, don't try using it on android 10. will bootloop.

Do you know why it will bootlop in android 10 miui 11?
Because it's only a change on one line of xml... Maybe it's a invalid positioning, let me see it...

Related

LED debugging in Hero (6-22-09)

WOW OK SO I FINALLY GOT LED's WORKING IN HERO!!!
This means they can be manipulated via Terminal but not the Android OS. That will be the next step.
*IMPORTANT 4:50pm CST*
-Correction, you should be copying/symlinking sensors.msm7k.so to sensors.trout.so and not sensors.hero.so to sensors.trout.so. Please see updated instructions below.
If you already copied sensors.hero.so to sensors.trout.so then do the following to fix it. Following the previous instructions could affect auto rotate
Code:
rm /system/lib/hw/sensors.trout.so
ln -s /system/lib/hw/sensors.msm7k /system/lib/hw/sensors.trout.so
*Update 4:44pm CST*
-Changed copy commands to symlink so we save space on /system. Thanks for the tip chunga
*Update 6:01pm CST*
-If you're getting an issue where auto-rotate is no longer working it's most likely you fudged on the symlinking sensors.msm7k.so over to sensors.trout.so.
*Update 9:37pm CST*
-Forgot to add that you need to have /system remounted as read/write. I have added the command below
*Update 8:00pm CST*
The following command does not persist across reboots, therefore it will need to be placed in /init.rc or in /system/init.rc if you have a modded rom that allows for it. Just so everyone is clear, you can NOT edit /init.rc directly. To do that you'll need to unpack boot.img, edit init.rc, then repack boot.img and fastboot flash it to your device. My advice is to download a modded ROM that gets released with this fix.
Code:
echo "1" > /sys/devices/platform/i2c-adapter/i2c-0/0-0062/blink
It was a pretty trick fix to figure out. Here is a revised post with the complete terminal commands. ROM devs you could place these chmod commands in /init.rc to get it working. Please give credit where credit is due if you use my fixes.
Code:
[B]TERMINAL COMMANDS[/B]
mount -o rw,remount /dev/block/mtdblock3 /system
ln -s /system/lib/hw/lights.msm7k.so /system/lib/hw/lights.trout.so
ln -s /system/lib/hw/copybit.msm7k.so /system/lib/hw/copybit.trout.so
ln -s /system/lib/hw/sensors.msm7k.so /system/lib/hw/sensors.trout.so
echo "1" > /sys/devices/platform/i2c-adapter/i2c-0/0-0062/blink
chmod 666 /sys/devices/platform/i2c-adapter/i2c-0/0-0062/leds/blue/brightness
chmod 666 /sys/devices/platform/i2c-adapter/i2c-0/0-0062/leds/red/brightness
chmod 666 /sys/devices/platform/i2c-adapter/i2c-0/0-0062/leds/green/brightness
What's left to fix?
1) Currently the system is only giving the LED's a brightness of 1 so the light that comes on is dim. We need to find where it's getting this default value and up it to 100.
Want to manually change the colors?
You can edit the "brightness" value under leds/[blue/red/green] . The acceptable values are from 0 - 100. If you mix them up you can make any color you want
Exampe to change colors manually:
Code:
echo "50" > /sys/devices/platform/i2c-adapter/i2c-0/0-0062/leds/blue/brightness
echo "50" > /sys/devices/platform/i2c-adapter/i2c-0/0-0062/leds/red/brightness
This would make a purplish color.
okay so does it change colors when its charging after its cut on.
I believe the hero has dual LEDs. It says something about it in logcat...Let me see if i can find it.
jaygajay said:
I believe the hero has dual LEDs. It says something about it in logcat...Let me see if i can find it.
Click to expand...
Click to collapse
Yes it does in fact have dual LED's. So the trick now that LED's work is to get it working just like it was in cupcake. I'll keep working at it you can be sure of that
wizern23 said:
okay so does it change colors when its charging after its cut on.
Click to expand...
Click to collapse
I haven't seen it change colors as my phone is fully charged so the green LED comes on. Since we don't have bluetooth I can't check for the blue LED working. Anyone have chompsms installed? I know you can pick which LED color you want. Anyone wanna test that it's all working?
Terminal codes?
Hello! Thanks for the great fix!! But is there anyway you can post the entire terminal emu code? Kinda new on the copying and replacing of files. Thanks so much !
Try missed call, you can easily sample the different colors
phungshum said:
Hello! Thanks for the great fix!! But is there anyway you can post the entire terminal emu code? Kinda new on the copying and replacing of files. Thanks so much !
Click to expand...
Click to collapse
I updated the main post so others can easily find it
phungshum said:
Hello! Thanks for the great fix!! But is there anyway you can post the entire terminal emu code? Kinda new on the copying and replacing of files. Thanks so much !
Click to expand...
Click to collapse
this is actually editing the init.rc script... what do i open that in to edit it? and after edit can i just remount my system as writable and change the file names in my sys/lib/hw folder to the explained file names?
Zarboz said:
this is actually editing the init.rc script... what do i open that in to edit it? and after edit can i just remount my system as writable and change the file names in my sys/lib/hw folder to the explained file names?
Click to expand...
Click to collapse
You can type those commands from the terminal. If ROM devs want to make it so installing their ROM automatically does this, they would do it in init.rc.
You and I can do this from the terminal. It should hold those changes across a reboot. Hmmmm, lemme reboot and make sure otherwise it would require unpacking/repacking the boot.img and making the changes to init.rc in there. You can not edit init.rc directly. You have to extract boot.img (you can get this from the ROM you installed). Do a search for unpacking/repacking boot.img
great news
Good job shafty.
tried it, works, restarted my phone by itself after the echo though. Little confuse about the chmod stuff so not gonna try that yet. Oh did it in adb too, thanks.
EDIT: seemed to break my 'g-sensor', so no auto-rotate.
this is going into 1.65 Thanks shafty023 for the work!
running jacman hero and his lights.msm7k.so is already renamed do i need to worry about this and after the chmod lines after the /brightness/ can i enter a modifier to change the ammount of light given out?
just to clarify the terminal commands,
using JACMAN 1.64, files are already renamed.
Zarboz said:
running jacman hero and his lights.msm7k.so is already renamed do i need to worry about this and after the chmod lines after the /brightness/ can i enter a modifier to change the ammount of light given out?
Click to expand...
Click to collapse
Ya that's because he got it from justanothercrowd who got it from me. I was sending him most of my fixes directly since I'm using his ROM. Only seemed fair.
So you can ignore the line pertaining to lights.msm7k.
Yes you can feel free to change the value in brightness to whatever you want. I actually think the max is somewhere around 256. You can mix brightness values and that will allow you to change the colors manually. But unfortunately when you plug an a/c adapter it turns on the green led at a brightness value of only 1
so for example at the endo f my chmod 666 .... /brightness/100 ?? or would it be /brightness100
cool! thanks for the fix!
did nothing for me? wonder what i did wrong

Installing Maps w/ Navigation

Thanks to FollowingInsanity for editing the build.prop file to get it working corectly, and thanks to Maxisma for the Droid dump. Thanks to everyone else who pitched in on this whole thing. Really all I did was realize the exact line that needed to be changed....everyone else did the rest
Here are instructions on how I got the new maps w/ Navigation to work via adb. I'm running the official rooted 1.6 build, but this should work for anyone.
(if you don't know how you use adb, go to the here
Next, you need to uninstall the old maps.apk file and here's how I personally did it since you can't just go to "uninstall" from the Application Settings(these instructions start already in the ADB shell):
# mount -o rw,remount /dev/block/mtdblock3 /system
# cd system
# cd app
# rm xxxxxxx (this is whatever your maps.apk is titled. sometimes is just maps.apk, but it could also be com.android.google.maps.apk or somethin like that)
# exit
Click to expand...
Click to collapse
Now you've uninstalled the google maps. You can then do these next steps outside of adb.(for instructions purposes i'm using my own Android location):
C:\android\tools> adb pull /system/build.prop C:\Android
C:\android\tools> adb pull /system/build.sapphire.prop C:\Android
The 2nd may not be may be build.trout.prop or something to that effect...build.xxxx.prop
Click to expand...
Click to collapse
Next, change those 2 file names on your PC from build.prop to build-backup.prop and build.xxxx-backup.prop(if you have one) so that you don't lose those files in case anything stupid happens in the mean time lol.
Make a 2nd copy of build.xxxx-backup.prop and rename it is build.xxxx.prop. So now you should have a build.xxxx.prop AND a build.xxxx-backup.prop
Now you'll need the build.prop file to use
build.prop
(IF you are running a sapphire build, you can also use the build.sapphire.prop file located there and skip down to "re-loading prop files")
I saved that file to the same location that I saved my original files.
open build.xxxx.prop in notepad. look for where it says:
ro.build.description=kila-user 1.6 DRC83 14721 ota-rel-keys,release-keys
ro.build.fingerprint=xxxxxxxxxx:user/ota-rel-keys,release-keys
# end build properties
Click to expand...
Click to collapse
you'll need to delete the line that says ro.build.fingerprint=xxxxxxxxxx:user/ota-rel-keys,release-keys but DO NOT delete the line that says #end build properties
replace the line you deleted with the following:
ro.build.fingerprint=verizon/voles/sholes/sholes:2.0/ESD20/17572:user/ota-rel-keys,release-keys
Reloading Prop Files
next, back in your command line window do the following:
c:\android\tools> adb push c:\android\build.prop /system/
c:\android\tools> adb push c:\android\build.xxxx.prop /system/
Click to expand...
Click to collapse
then restart your phone
while the phone is restarting, go back and rename your build.prop and build.xxxx.prop files to build-update.prop and build.xxxx-update.prop, then change your build-backup.prop and build.xxxx-backup.prop to build.prop and build.xxxx.prop
After it restarts you'll want to locate your maps.apk file(the new one) and go back into your command line and type:
c:\android\tools> adb shell
# mount -o rw,remount /dev/block/mtdblock3 /system
# exit
c:\android\tools> adb install c:\android\maps.apk
(install crap...if it doesn't install correctly then don't do whats below)
Click to expand...
Click to collapse
Go check your google maps, type in two locations and click "go" and on the next screen you should see a button that says "Navigate"
go back to your command line screen and type:
Sorry if this is confusing, anyone who could make it more simple, please feel free to give it a try, but this is the best I could offer so people wouldn't have to go looking though the whole think tank thread to get everything they need to get it working
IF THE INSTALL GAVE YOU AND INVALID_UPGRADE ERROR THEN TRY THIS:
(again these instructions are using my own android sdk location, replace the
c:\android\tools with YOUR sdk location
from the command line type the following:
c:\android\tools> adb shell
# mount -o rw,remount /dev/block/mtdblock3 /system
# exit
c:\android\tools> adb pull /data/system/packages.xml c:\android\
Click to expand...
Click to collapse
BACK UP THIS FILE BEFORE EDITING IT
Once that's done, open that xml file in a text editor hit ctrl+f and search for maps, the first one will probably say auth.sitemaps, ignore that, keep searching untile you get to something to the effect of com.android.google.maps.apk or something like that. when you see that, you'll want to delete everything from "<packagename=" to "</package>" for the google maps app. BE VERY CAREFUL!!!! you don't want to accidentally delete something else, thus the reason for the back up.
after you've done that, go back to your command prompt and type:
c:\android\tools> adb push c:\android\ /data/system/packages.xml
c:\android\tools> adb install c:\android\maps.apk
Click to expand...
Click to collapse
it should then install perfectly fine. thats what I had to do to get it to work for me
I love you guys! will try this when I get home from work!
it does not appear to be 100% working....yet...
as posted by dwang, http://forum.xda-developers.com/showpost.php?p=4921655&postcount=275
dwang said:
If you push the old build.prop files back, after a while, the nav option disappears.
Click to expand...
Click to collapse
which I can confirm. About midnight last night it was working okay, and this morning it was gone.
followinginsanity says he will work on it today. http://forum.xda-developers.com/showpost.php?p=4921665&postcount=278
followinginsanity said:
Confirmed... will work on it tomorrow.....
Click to expand...
Click to collapse
may not want to rush to get it working only for it to not work a few hours later...but ..like most people here...that probably won't stop many
I edited the build.prop file...and now it will only work with Sapphire builds. For CM builds, build.prop file that FollowingInsanity created
Code:
c:\android\tools> abd push c:\android\build.prop /system/
c:\android\tools> abd push c:\android\build.xxxx.prop /system/
Should be
Code:
c:\android\tools> adb push c:\android\build.prop /system/
c:\android\tools> adb push c:\android\build.xxxx.prop /system/
Takenover83 said:
Code:
c:\android\tools> abd push c:\android\build.prop /system/
c:\android\tools> abd push c:\android\build.xxxx.prop /system/
Should be
Code:
c:\android\tools> adb push c:\android\build.prop /system/
c:\android\tools> adb push c:\android\build.xxxx.prop /system/
Click to expand...
Click to collapse
Changed lol. thanks
where can i get the new maps apk? the old one fails to install
i get error
Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE]
ahronzombi said:
where can i get the new maps apk? the old one fails to install
Click to expand...
Click to collapse
http://forum.xda-developers.com/showpost.php?p=4921092&postcount=196
That's the one I did, it also has all the needed files just grab the files from there and you should be able to use them for these instructions
ahronzombi said:
i get error
Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE]
Click to expand...
Click to collapse
When that happens you need to:
adb push <path to>/Maps.apk /system/app
adb shell
# install /system/app/Maps.apk
# exit
hey hey hey
could you or somone who got this to work try to make a video tuturiol on this so we can all clearly see how it works!!! please someone make an post it on youtube if possible thanks!!!!!!!!!
navigation doesn't work outside of the US at the moment right?
I was able to get the new maps.apk to install - and it is clearly a different application (with the new layers), but no navigate button. : (
seaweeduk said:
navigation doesn't work outside of the US at the moment right?
Click to expand...
Click to collapse
Nope, not until the big G says so.
mianosm said:
I was able to get the new maps.apk to install - and it is clearly a different application (with the new layers), but no navigate button. : (
Click to expand...
Click to collapse
what rom are you using?
mianosm said:
I was able to get the new maps.apk to install - and it is clearly a different application (with the new layers), but no navigate button. : (
Click to expand...
Click to collapse
You might have to try editing your packages.xml file even though it didn't give you an install error. Also, if you push your original build.prop's back, you lose navigation after a few hours. I guess the quick solution to that would be to keep the new build.prop's, but I'm not sure what the problems that might or might not create for other apps.
I'm using CM-4.2.3.1 with the edited build.prop and the build.sapphire.prop files.
# mount -o rw,remount /dev/block/mtdblock3 /system
Click to expand...
Click to collapse
A quick shortcut is to drop the device from this command. As you're re-mounting, the kernel knows the device name. Like this:
# mount -o rw,remount /system
Click to expand...
Click to collapse
Wow dude your the bomb, I did it a different way but it worked perfect. I just took a dount rom extracted it, deleted the maps.apk, then I took the droid dump maps app and put it into the donut rom. Then I made the changes to the build.trout.prop so that it recognized the g1 as the verizon phone, used your downloadable build.prop, of course I just deleted the original build.prop in the donut build, I resigned the donut rom, flashed it like it was brand new, and bingo everything worked perfectly. Wow good job dude. I would upload my rom but I dont want to get into any trouble.
I am using "AOSP1.6_r1.4+ADP DRD20 ROM". Maps on here is called "GoogleMaps.apk". I also do not have just a build.prop. I have a build.sapphire.prop and build.trout.prop. I modified both and replaced according to the first post. When I rebooted, GoogleMaps.apk was reinstalled, so I had to uninstall it again.
I did get the error described in post #8, but was able to get around it with the help of post #10.
But for some reason my network is completely down so I can't do nothing. Wifi and Cellular network. Hmmmm.
Edit: Replacing the files I backed up with the originals, brought my networks back.

[SOLVED] [Q] [CM 10.2] Two questions about USB debugging and fsync control

Hello.
1. I can't find development/enable USB debugging. Where did it go?
2. I found '/sys/module/sync/parameters/fsync_enabled'.
I assume kernel support for fsync control is available.
Is that exposed in a UI? Or do I have to set it via a script?
What is the recommended way to execute stuff at start up? [I don't see /etc/rc.local available ]
BTW, executing 'exit' in terminal seems to get stuck here. Can someone confirm?
* I'm experience in GNU/Linux and *nix in general but I'm new to Android.
tf700_13 said:
Hello.
1. I can't find development/enable USB debugging. Where did it go?
2. I found '/sys/module/sync/parameters/fsync_enabled'.
I assume kernel support for fsync control is available.
Is that exposed in a UI? Or do I have to set it via a script?
What is the recommended way to execute stuff at start up? [I don't see /etc/rc.local available ]
BTW, executing 'exit' in terminal seems to get stuck here. Can someone confirm?
* I'm experience in GNU/Linux and *nix in general but I'm new to Android.
Click to expand...
Click to collapse
1. Go to settings and about, click the build number 7 times and developer options will be made available.
2. Usually set it via a startup script. Assuming the cm10 kernel supports it.
sbdags said:
1. Go to settings and about, click the build number 7 times and developer options will be made available.
Click to expand...
Click to collapse
Done! Thanks.
2. Usually set it via a startup script. Assuming the cm10 kernel supports it.
Click to expand...
Click to collapse
Is there a recommended way/app to manage startup scripts?
And just to make sure, /sys/module/sync/parameters/fsync_enabled is set to 1. I need to set it to 0 to disable fsync (not some other value), right?
tf700_13 said:
Done! Thanks.
Is there a recommended way/app to manage startup scripts?
And just to make sure, /sys/module/sync/parameters/fsync_enabled is set to 1. I need to set it to 0 to disable fsync (not some other value), right?
Click to expand...
Click to collapse
Yes set it to 0. Just echo it in a script. In my ROM I use init.d enabled scripting to achieve this. I think cm uses the same theory but does it slightly differently.
I'll post my script later when I get home.
sbdags said:
Yes set it to 0. Just echo it in a script. In my ROM I use init.d enabled scripting to achieve this. I think cm uses the same theory but does it slightly differently.
I'll post my script later when I get home.
Click to expand...
Click to collapse
I know how to write scripts And yes, /etc/init.d/ is used.
So all I need is adding a file there (e.g. 80disablefsync) with content:
Code:
#!/system/bin/sh
echo 0 > /sys/module/sync/parameters/fsync_enabled
Assuming that is correct, I'm stuck now at writing a file there.
The *nix way 'mount -o remount,rw /' is not working.
Read-only file system error didn't go away.
tf700_13 said:
The *nix way 'mount -o remount,rw /' is not working.
Read-only file system error didn't go away.
Click to expand...
Click to collapse
You have to remount /system, not /.
Another workaround: You could use /data/userinit.d instead (don't know if that is the exact name).
_that said:
You have to remount /system, not /.
Another workaround: You could use /data/userinit.d instead (don't know if that is the exact name).
Click to expand...
Click to collapse
I could have sworn I didn't see a mount point for /system earlier.
Anyway all is good now.
Thank you guys.
The only problem remaining is C-d not exiting in terminal. and executing exit afterwards gets stuck. But that's not a big deal.
tf700_13 said:
The only problem remaining is C-d not exiting in terminal. and executing exit afterwards gets stuck. But that's not a big deal.
Click to expand...
Click to collapse
Preferences -> Close window on exit [x] ?
_that said:
Preferences -> Close window on exit [x] ?
Click to expand...
Click to collapse
That's already checked and works.
The problem is, CTRL-d is an escape sequence that should exit and it's not working when you're root.

[GUIDE/MOD] DNSCrypt for AArch64 (ZIP) (2016/03/17)

NOT SYSTEMLESS!
This writes to system, so systemless master race stay away.
Someone wanna make a Magisk version?
Instructions:
0. Download zip below and place inside internal storage.
1. Boot to TWRP.
2. Mount>System
3. Flash zip
4. Boot to Android and open a terminal emulator
5. Run dnscrypt enable. You probably have to do this every reboot.
Changing resolver:
Edit /system/etc/init.d/99dnscrypt. There's a line RESOLVER_NAME, change it to a suitable one from here under Name. I suggest you ping every server geographically nearby and go with the lowest ping.
Changing DNS server:
On Nexus 5X at least, use a Terminal Emulator and run
Code:
setprop net.dns1 127.0.0.1:53
Self-compile guide:
Requirements:
Linux computer (x86_64)
Android NDK (r12b is the newest so far, get the 64-bit one)
libsodium
dnscrypt-proxy
Here's how I did it:
1. Extract the NDK (unzip android-ndk-rXXb.zip )
2. Run
Code:
export ANDROID_NDK_HOME=<NDK Location>
3. Extract libsodium and dnscrypt-proxy.
4. Enter the folder of libsodium/dist-build, then edit android-build.sh such that NDK_PLATFORM:-android-16 becomes NDK_PLATFORM:-android-24. Then modify android-armv8-a.sh and add
Code:
-mtune=cortex-a57.cortex-a53 -mcpu=cortex-a57.cortex-a53
to the end of CFLAGS.
5. Return to libsodium root folder (cd ..) and do ./autogen.sh then ./dist-build/android-armv8-a.sh. When the script finishes it will tell you where the output is.
6. (Optional) Run android-toolchain-armv8-a/aarch64-linux-android/bin/strip on the output .so (typically in libsodium-android-armv8-a/lib/libsodium.so)
7. Now we do
Code:
export SODIUM_ANDROID_PREFIX=<libsodium output>
8. Enter the folder of dnscrypt, do the same modifications to dnscrypt's dist-builds. Again, do ./autogen.sh and ./dist-build/android-armv8-a.sh.
9. Now you have a fresh compilation of AArch64 dnscrypt-proxy!
It's usually dnscrypt-proxy-android-armv8-a.zip
10. Finally, we need to edit the zip file and rename the /system/lib folder to lib64, and change references in updater-script and /system/addon.d/75-dnscrypt.sh.
11. (Optional) Add --ephemeral-keys to 99dnscrypt for extra security.
Credits:
qwerty12 for the basic instructions
Changelog:
02/19: Updated libsodium (1.0.8->master) and dnscrypt-proxy(01/27 master->master)
03/17: Pulled freshest code from masters, compiled with NDK r11b and platform android-23
09/26: Latest stable branch of libsodium and master of dnscrypt. Compilation target now android-24. Compiled with NDK r12b
Changes to both dnscrypt-proxy and libsodium:
dist-build/android-build.sh:
Code:
NDK_PLATFORM:-android-16 to NDK_PLATFORM:-android-24
dist-build/android-arm-v8-a.sh:
Code:
Appended:
-mtune=cortex-a57.cortex-a53 -mcpu=cortex-a57.cortex-a53
to end of CFLAGS
Why not just release the compiled binaries ? would safe others with tinkering compiling it
Flashable zip
DragonHunt3r said:
Why not just release the compiled binaries ? would safe others with tinkering compiling it
Click to expand...
Click to collapse
Uploaded. I just thought most people would be more comfortable compiling their own code rather than trust a stranger. I still don't know how to fix the updater script though, it's the default one for now.
aschere said:
Uploaded. I just thought most people would be more comfortable compiling their own code rather than trust a stranger. I still don't know how to fix the updater script though, it's the default one for now.
Click to expand...
Click to collapse
That's true, but at the other side we trust random flashable zips for roms, mods etc from XDA
Thanks for the upload will take a look
Edit: well it works but in DNSManager for example it shows greyed out "Enable DnsCrypt"
dnsleaktest.com shows dnscrypt works though
DragonHunt3r said:
That's true, but at the other side we trust random flashable zips for roms, mods etc from XDA
Thanks for the upload will take a look
Edit: well it works but in DNSManager for example it shows greyed out "Enable DnsCrypt"
dnsleaktest.com shows dnscrypt works though
Click to expand...
Click to collapse
Shows up OK in my device.
So can I just flash the zip and use dns manager? nothing else?
---------- Post added at 03:25 AM ---------- Previous post was at 03:17 AM ----------
Will this work with a non 64 bit snapdragon 805
gangrenius said:
So can I just flash the zip and use dns manager? nothing else?
---------- Post added at 03:25 AM ---------- Previous post was at 03:17 AM ----------
Will this work with a non 64 bit snapdragon 805
Click to expand...
Click to collapse
This works only on 64-bit devices. For 32-bit devices, a download is provided here.
Yes, this is a flashable zip. However, DNS needs to be changed manually such as through DNS Manager because iptables doesn't entirely work.
Any major changes with 4/6? Thanks for updating this BTW.
th3g1z said:
Any major changes with 4/6? Thanks for updating this BTW.
Click to expand...
Click to collapse
It's all commits from 03/17 to 04/06.
Installed the zip successfully, when in terminal emulator, its not working, pls help!:crying:
Using rooted Lenovo A7000
Here's the full text directly copied from terminal emulator:
[email protected]:/ $ dnscrypt enable
Enabling dnscrypt-proxy...
iptables v1.4.20: can't initialize iptables table `nat': Permission denied (you must be root)
Perhaps iptables or your kernel needs to be upgraded.
iptables v1.4.20: can't initialize iptables table `nat': Permission denied (you must be root)
Perhaps iptables or your kernel needs to be upgraded.
[INFO] - [cs-uswest] does not support DNS Security Extensions
[INFO] + Namecoin domains can be resolved
[INFO] + Provider supposedly doesn't keep logs
[NOTICE] Starting dnscrypt-proxy 1.6.1
[INFO] Generating a new session key pair
[INFO] Done
[INFO] Server certificate #808464433 received
[INFO] This certificate is valid
[INFO] Chosen certificate #808464433 is valid from [2015-11-05] to [2016-11-04]
[INFO] Server key fingerprint is 881A:AED0:0427:BAF0:47D6:BDFA:6161A38:F019:571C:9BD2:A083:4A5F:C938:7E5D:8434
iptables v1.4.20: can't initialize iptables table `nat': Permission denied (you must be root)
Perhaps iptables or your kernel needs to be upgraded.
Done
[email protected]:/ $
kuchienkz said:
Installed the zip successfully, when in terminal emulator, its not working, pls help!:crying:
Using rooted Lenovo A7000
Here's the full text directly copied from terminal emulator:
[email protected]:/ $ dnscrypt enable
Enabling dnscrypt-proxy...
iptables v1.4.20: can't initialize iptables table `nat': Permission denied (you must be root)
Perhaps iptables or your kernel needs to be upgraded.
iptables v1.4.20: can't initialize iptables table `nat': Permission denied (you must be root)
Perhaps iptables or your kernel needs to be upgraded.
iptables v1.4.20: can't initialize iptables table `nat': Permission denied (you must be root)
Perhaps iptables or your kernel needs to be upgraded.
Done
[email protected]:/ $
Click to expand...
Click to collapse
Did you read the error you got? You have to be root. Try running 'su' before 'dnscrypt enable'
aschere said:
Did you read the error you got? You have to be root. Try running 'su' before 'dnscrypt enable'
Click to expand...
Click to collapse
Lol, i would not post my problem here if that could solve my problem :v
Already tried that several times. Still gives the same error.
kuchienkz said:
Lol, i would not post my problem here if that could solve my problem :v
Already tried that several times. Still gives the same error.
Click to expand...
Click to collapse
Can you post what version of Android, what phone?
aschere said:
Can you post what version of Android, what phone?
Click to expand...
Click to collapse
Android Version: 5.0.2
Lenovo A7000 : Phone Spec
kuchienkz said:
Android Version: 5.0.2
Lenovo A7000 : Phone Spec
Click to expand...
Click to collapse
Hmmm... I can't really think of anything other than the root: are you sure you rooted it? When you type su, do you switch to the root user?
aschere said:
Hmmm... I can't really think of anything other than the root: are you sure you rooted it? When you type su, do you switch to the root user?
Click to expand...
Click to collapse
Ah nevermind, i just reinstalled my phone with stock ROM, then rooted it. Now it works. :good:
If you curious about last rom, it is MIUI 7
Thank you so much for your help :victory:
Btw now that i understand how to run it. But as u said that i have to run it on every boot. Is there a way to run it automatically? Actually, im quite new to Terminal Emulator
kuchienkz said:
Ah nevermind, i just reinstalled my phone with stock ROM, then rooted it. Now it works. :good:
If you curious about last rom, it is MIUI 7
Thank you so much for your help :victory:
Btw now that i understand how to run it. But as u said that i have to run it on every boot. Is there a way to run it automatically? Actually, im quite new to Terminal Emulator
Click to expand...
Click to collapse
Good to hear that!
For automatic execution, you can create a script in /system/su.d or /system/addon.d I guess.
Ah actually, it should be in /system/etc/init.d
aschere said:
Ah actually, it should be in /system/etc/init.d
Click to expand...
Click to collapse
And.... how to make that script?
Im seriously beginner here
I dont have any idea what kind of script it is and what language it uses.
Maybe you can give me link to a site where i could learn to make one
kuchienkz said:
And.... how to make that script?
Im seriously beginner here
I dont have any idea what kind of script it is and what language it uses.
Maybe you can give me link to a site where i could learn to make one
Click to expand...
Click to collapse
Actually, the script should already be in there. See this.

[GUIDE]How to install Bromite SystemWebView without Magisk (Android 12+ included)

This has not been tested on any other version other than Android 12.1. If you have issues please report them here or open an issue on GitHub.
I just upgraded to LineageOS 19 from 18.1 and as usual I want to apply my own modifications on top of it but the NanoDroid script that I previously used doesn't seem to work on 19. I couldn't find an answer neither on r/LineageOS, r/fossdroid or even XDA so I wrote a way to install Bromite SystemWebView in a way that's a lot more elegant and doesn't need Magisk or root.
Method 1 (preferred):
Download the flashable package and install it in recovery mode either by placing it on the SD card or by sideloading, then reboot:
Bash:
adb sideload BromiteSystemWebViewOverlay.zip
Download the latest Bromite SystemWebView release and install it as you would a regular app.
Navigate to Settings > Developer options > WebView implementation and select Bromite SystemWebView.
Method 2 (legacy):
Enable Rooted debugging by navigating to Settings > Developer options > Rooted debugging.
Connect your phone to your PC and type
Bash:
adb root
Mount the vendor folder:
Bash:
adb shell mount -o rw,remount /vendor
Copy the package downloaded from here to the overlay directory:
Bash:
adb push treble-overlay-bromite-webview.apk /vendor/overlay
Mount the system as read-write:
Bash:
adb shell mount -o rw,remount /
Copy the OTA survival script to the appropriate location:
Bash:
adb push 99-bromite-webview.sh /system/addon.d
Make the script executable:
Bash:
adb shell chmod 755 /system/addon.d/99-bromite-webview.sh
Reboot the device:
Bash:
adb reboot
Download the latest Bromite SystemWebView release and install it as you would a regular app.
Navigate to Settings > Developer options > WebView implementation and select Bromite SystemWebView.
For a more in-depth explanation check the GitHub repository.
It is worth mentioning that after installing Bromite SystemWebView, developers will not provide any support when their banking applications are not functioning properly. Proven in practice.
ze7zez said:
It is worth mentioning that after installing Bromite SystemWebView, developers will not provide any support when their banking applications are not functioning properly. Proven in practice.
Click to expand...
Click to collapse
I never encountered a mobile banking app that uses WebView (at least for the main functionality), but your mention is most welcome.
I've been debloating and degoogling and old HTC 10 running android 8. I've been wanting to get bromite installed because chrome is installed as the webview. I'm rooted, but unfortunately the webview manager magisk module fails to install.
I just found this thread and would love to give this approach a try.
I have the /system/addon.d directory. I have /vendor but not /vendor/overlay. I have /mnt but not /mnt/system. The scripts I have in /system/addon.d (fdroid and minmicrog) only reference the system app and priv-app directories so no help there, unless those locations are fallback options. Can your instructions be adjusted for android 8?
I also have a rooted microg LOS 19 moto g7 that's served as a reference with my debloating/degoogling effort. I looked at the contents of /vendor/overlay there and found that all but one of the apk's in there had "vendor" in the name, so I searched recursively from / on my HTC and didn't find any apk's with "vendor" in the name. Do you have any other ideas on how I might identify the equivalent directory on my HTC?
TheShanMan said:
I have /vendor but not /vendor/overlay.
Click to expand...
Click to collapse
Then try looking into /system/product/overlay.
TheShanMan said:
I have /mnt but not /mnt/system.
Click to expand...
Click to collapse
Your path will be /mnt/system only if you mount the root from recovery mode.
TheShanMan said:
all but one of the apk's in there had "vendor" in the name
Click to expand...
Click to collapse
The name doesn't matter, you can call the apks anything and they will still work.
Can you attach the output of the following command?
Bash:
adb shell cmd overlay list
arovlad said:
Then try looking into /system/product/overlay.
Click to expand...
Click to collapse
I don't have a /system/product directory. Here are the contents of my /system directory:
Code:
addon.d
app
bin
build.prop
compatibility_matrix.xml
customize
etc
fake-libs
fake-libs64
fonts
framework
lib
lib64
lost+found
manifest.xml
media
priv-app
tts
usr
vendor
xbin
And since "vendor" is part of the discussion, here are the contents of my /system/vendor directory:
Code:
app
bin
compatibility_matrix.xml
etc
firmware
framework
lib
lib64
manifest.xml
media
radio
rfs
ueventd.rc
arovlad said:
Can you attach the output of the following command?
Bash:
adb shell cmd overlay list
Click to expand...
Click to collapse
The output from that command is nothing.
I'm happy to try as much as you'd like, including experimentation (I've gotten very used to nandroid backups and restores while degoogling and debloating ). Thanks for the help!
Try it out:
Installing SystemWebView
Bromite is a Chromium fork with ad blocking and privacy enhancements; take back your browser! - bromite/bromite
github.com
Yeah I've seen that. It's a bit complicated, which is why I was hoping to either do it via the magisk manager module or via these steps. Ultimately if all else fails, I may give that a try. Hoping @arovlad will have the magic touch here, but I totally understand if there's no desire to invest time figuring out how to do this on an old device and android version.
TheShanMan said:
I totally understand if there's no desire to invest time figuring out how to do this on an old device and android version.
Click to expand...
Click to collapse
I am all for supporting old hardware. The thing is I actually thought every device running Project Treble (TL;DR Android 8 and above) use overlays of some kind.
I have the following ideas:
Do steps 1-3 as explained above and then make a folder called overlay inside the vendor partition:
Bash:
adb shell mkdir -m 755 /vendor/overlay
Do step 4 and then run the following command:
Bash:
adb shell cmd overlay enable com.arovlad.bromite.webview.overlay
TheShanMan said:
The output from that command is nothing.
Click to expand...
Click to collapse
Does it output nothing or does it output cmd: Can't find service: overlay? If the service cannot be found then the device may not be Treble-enabled. Please check if it is.
If it is try running:
Bash:
adb shell cmd overlay dump
and paste the output here.
TheShanMan said:
Thanks for the help!
Click to expand...
Click to collapse
Thank you for your patience and investing time in this.
Edit: added link for Treble support
It outputted nothing, and the treble check app says it's not enabled. Does that mean I'm out of luck or is there anything else to try? Thanks!
TheShanMan said:
It outputted nothing
Click to expand...
Click to collapse
You mean the first command, the second, or both? Please use quotes accordingly so I can know what you're referring to.
TheShanMan said:
the treble check app says it's not enabled. Does that mean I'm out of luck...?
Click to expand...
Click to collapse
You may be. You mentioned earlier that the Magisk module fails to install and that may be because your ROM is not Treble-enabled.
TheShanMan said:
is there anything else to try?
Click to expand...
Click to collapse
Have you tried creating the overlay folder manually and then enabling it via ADB as I wrote above?
Sorry, when I said it outputted nothing, it was in response to your question about the command "adb shell cmd overlay list". I tried creating the overlay folder and enabling it. The enable command gave no output so I don't know if it worked or not. I tried rebooting and then checking the webview setting in dev options, but it's still not there.
I'm guessing you assumed I would also then do steps 6 and 7. Is that right? If so, I'll have to try creating a magisk module to put the script in that location and hope it runs. I can't touch the actual system partition because doing so causes VoLTE to stop working on my phone, so I'm doing all my debloating/degoogling through magisk modules. I don't mind giving this a try, but since my phone isn't treble enabled, I'd like to verify that you think I ought to before I spend the time creating a magisk module for it.
Appreciate the help!
TheShanMan said:
The enable command gave no output so I don't know if it worked or not. I tried rebooting and then checking the webview setting in dev options, but it's still not there.
Click to expand...
Click to collapse
Run the following command:
Bash:
adb shell dumpsys webviewupdate
and if it outputs org.bromite.webview is NOT installed then it works.
TheShanMan said:
I'm guessing you assumed I would also then do steps 6 and 7. Is that right?
Click to expand...
Click to collapse
If your phone is old and doesn't receive official updates anymore, there's no need for addon.d, so no.
May I have the contents of the / (root) folder? Is there any partition called oem or odm? If so, what do they contain?
I'm a little confused by you saying it works if it says "NOT installed", but no, it doesn't say anything about bromite. Here's the output:
Current WebView Update Service state
Fallback logic enabled: true
Current WebView package (name, version): (com.google.android.webview, 62.0.3202.84)
Minimum WebView version code: 320208452
Number of relros started: 2
Number of relros finished: 2
WebView package dirty: false
Any WebView package installed: true
Preferred WebView package (name, version): (com.google.android.webview, 62.0.3202.84)
WebView packages:
Valid package com.android.chrome (versionName: 62.0.3202.84, versionCode: 320208452, targetSdkVersion: 27) is NOT installed/enabled for all users
Valid package com.google.android.webview (versionName: 62.0.3202.84, versionCode: 320208400, targetSdkVersion: 27) is installed/enabled for all users
And the contents of / are:
acct
bt_firmware
bugreports
cache
carrier
charger
config
cota
crashdump.d
cwkeys
d
data
default.prop
dev
devlog
dsp
etc
fataldevlog
file_contexts.bin
firmware
fstab.qcom
init
init.environ.rc
init.hosd.cradio.rc
init.hosd.htc_pme.rc
init.hosd.usb.configfs.rc
init.hosd.usb.rc
init.hosd_fusion.usb.rc
init.htc.storage.exfat.rc
init.htc.storage.mocana.rc
init.rc
init.recovery.common.rc
init.recovery.htc_pme.rc
init.usb.configfs.rc
init.usb.rc
init.zygote32.rc
init.zygote64_32.rc
mnt
nonplat_file_contexts
nonplat_hwservice_contexts
nonplat_property_contexts
nonplat_seapp_contexts
nonplat_service_contexts
oem
persist
plat_file_contexts
plat_hwservice_contexts
plat_property_contexts
plat_seapp_contexts
plat_service_contexts
preload
proc
res
root
sbin
sdcard
sdcard2
sepolicy
storage
sys
system
tombstones
ueventd.htc_pme.rc
ueventd.rc
vendor
vndservice_contexts
vzw
vzwqualitylogger
/oem is empty.
TheShanMan said:
I'm a little confused by you saying it works if it says "NOT installed"
Click to expand...
Click to collapse
Yeah, it's a little confusing, but if the overlay was successfully installed it should output NOT installed.
TheShanMan said:
but no, it doesn't say anything about bromite. Here's the output:
Click to expand...
Click to collapse
Then it doesn't work.
TheShanMan said:
/oem is empty.
Click to expand...
Click to collapse
Then try putting the overlay package inside, enable it (even if there is no output, just in case) and reboot the phone.
If it doesn't work, then you are out of luck as far as I know and your only option is to patch framework-res.apk manually.
Edit: clarification
Not only did that not work, but the /oem directory got wiped out after booting up. It must get populated by something during boot. Thank you very much for putting in this much effort to figure out how to make this work in my case. I wish I could've reported victory, but maybe I'll get it figured out via framework-res. I've tried one approach with that unsuccessfully so far (which hung during boot). I'll try more things and hopefully get it figured out! Best of luck with your project and thanks for offering it to people!
TheShanMan said:
Thank you very much for putting in this much effort to figure out how to make this work in my case.
Click to expand...
Click to collapse
Don't sweat it! Thank you for your patience and sorry I couldn't find a proper solution.
TheShanMan said:
I'll try more things and hopefully get it figured out!
Click to expand...
Click to collapse
If you actually DO find a way, it would be awesome if you could report back. Maybe it will help others in the same situation. Good luck!
Hi. Thank you for that step by step process of installing Bromite Webview.
I am a little confused about the 'vendor' part. What does that mean and why is it there? And as a consequence of that, I do not understand steps 6 & 7 beyond adb 'push' or 'shell'.
Any help is massively appreciated!
arovlad said:
This has not been tested on any other version other than Android 12.1. If you have issues please report them here or open an issue on GitHub.
I just upgraded to LineageOS 19 from 18.1 and as usual I want to apply my own modifications on top of it but the NanoDroid script that I previously used doesn't seem to work on 19. I couldn't find an answer neither on r/LineageOS, r/fossdroid or even XDA so I wrote a way to install Bromite SystemWebView in a way that's a lot more elegant and doesn't need Magisk or root.
Prerequisites:
adb
Rooted debugging or a custom recovery
Installation guide:
Enable Rooted debugging by navigating to Settings > Developer options > Rooted debugging.
Connect your phone to your PC and type
Bash:
adb root
Mount the vendor folder:
Bash:
adb shell mount -o rw,remount /vendor
Copy the package downloaded from here to the overlay directory:
Bash:
adb push treble-overlay-bromite-webview.apk /vendor/overlay
Mount the system as read-write:
Bash:
adb shell mount -o rw,remount /
Copy the OTA survival script to the appropriate location:
Bash:
adb push 99-bromite-webview.sh /system/addon.d
Make the script executable:
Bash:
adb shell chmod 755 /system/addon.d/99-bromite-webview.sh
Reboot the device:
Bash:
adb reboot
Download the latest Bromite SystemWebView release and install it as you would a regular app.
Navigate to Settings > Developer options > WebView implementation and select Bromite SystemWebView.
For custom recoveries: skip the first two steps, enable ADB from recovery mode and follow steps 3-10 replacing /vendor/overlay with /mnt/system/vendor/overlay and /system/addon.d with /system/system/addon.d.
For a more in-depth explanation check the GitHub repository.
Click to expand...
Click to collapse
Hi, @arovlad thanks for this workaround. I'm running the exactly same LOS version than you on a OP6. But at step 5 i'm getting the following error : /dev/root is read-only any idea what can i do ? Thx for your help !
amanajosh said:
I am a little confused about the 'vendor' part. What does that mean and why is it there?
Click to expand...
Click to collapse
Starting Android Oreo, the vendor partition is a separate partition containing proprietary manufacturer code not part of AOSP. This separation ensures that the Android system can be updated without recompiling the device-specific software. The vendor partition is typically overlayed over the system partition, making it easy to apply tweaks and modifications without actually touching the system. These modifications are typically named systemless.
Did you install Bromite WebView successfully?
bre75 said:
at step 5 i'm getting the following error : /dev/root is read-only any idea what can i do ?
Click to expand...
Click to collapse
Try the following command instead of step 5 and see if works for you:
Bash:
adb remount

Categories

Resources