[Q] Fixing the navbar detection issue - Nexus 4 Q&A, Help & Troubleshooting

There are a couple of people whose navigation bar on their N4 isn't working. I'm talking about this.
Found a github repository which contains the fix (credits to gkraynov) for all stock releases: https://github.com/gkraynov/nexus-4-navfix
I've recently installed this ROM, which has a different build number (LMY48G), so this solution would not work for me, because stock 5.1.1 has LMY47V.
The fix (source): https://android-review.googlesource...droid/systemui/statusbar/policy/DeadZone.java
My steps were:
1.) Decompiled the SystemUI.apk with apktool (to get to the smali file):
Code:
java -jar apktool.jar d SystemUI.apk
Here's the decompiled source in a zip file.
2.) Decompiled the same apk with http://www.decompileandroid.com/ to get the java source
3.) Compared the source of the fix with corresponding smali and java file, like in this image.
4.) Recompiled with:
Code:
java -jar apktool.jar b SystemUI
5.) Pushed the apk back to the phone:
- set root access for adb and apps on phone under developer settings
- adb root
- adb remount
- adb push SystemUI.apk /system/priv-app/SystemUI.apk
After that I rebooted the phone, which didn't display the navbar anymore, so I've must have made a mistake somewhere.
Can someone, please, take a look and tell me, what I did wrong? I have zero experience with this.

You can share files you edit?

You didn't set perms right. Reboot to recovery and fix permissions or just change the permissions to
RW-R--R--

I also want to wear a custom rom , but the nav bar I do not work , if you can help ?

chmod?

Can anyone compile this source with android 6.0 marshmallow
Sent from my Nexus 4 using Tapatalk

I tried, I've tried to edit Deadzon.java but I am confused as to restore the file to dex for compile into apk again

I did the same thing using TMA to decompile and to update and got the same issue.
No more NAVBAR.
Any clue?

It appears that the code edit it`s not correct.
Using another tool http://bytecodeviewer.com/ to reverse engineer it appears wrong.
I am also newbie at this.
Can someone help?

same here
I have encountered the same issue with my N4.
To fix it, I tried a stock reset. Did not work.
Than I granted myself root access, installed CyanogenMod, which then allowed me to use the "pie"-Navigation, which works great.
I also found out, because of the full screen option etc., that the area of the screen of the broken navigation bar should be working, as it appears to work in different apps in landscape-mode.
So... My problem is now that I can't try out the patch you writing about because now I am using CM13, not the Stock Version which the fixes are referring to.
I am really new to all this ROM stuff (all I know about it is from this very day) - So, is there a way of applying this way of fixing the navigation bar to CM13?
Thank you.

Sackhaar said:
I have encountered the same issue with my N4.
To fix it, I tried a stock reset. Did not work.
Than I granted myself root access, installed CyanogenMod, which then allowed me to use the "pie"-Navigation, which works great.
I also found out, because of the full screen option etc., that the area of the screen of the broken navigation bar should be working, as it appears to work in different apps in landscape-mode.
So... My problem is now that I can't try out the patch you writing about because now I am using CM13, not the Stock Version which the fixes are referring to.
I am really new to all this ROM stuff (all I know about it is from this very day) - So, is there a way of applying this way of fixing the navigation bar to CM13?
Thank you.
Click to expand...
Click to collapse
I am facing the same issue.
But I am trying to create the patch for Paranoid Rom. If I suceed I think the same concept can be use for any other rom.

Hi all..
does anyone want to help me to update this patch for Lineage OS??
https://github.com/gkraynov/nexus-4-navfix

Related

At my wits end here, what could possibly be going wrong?

Hey everyone.
As many of you know, the S4 system files don't seem to like playing nice. For me, it seems i can't modify literally any of them. No matter what i do, they force close after being baksmali'd.
I've even gone as far as d compile base apk > compile it back to an apk without moding ANYTHING > pushing to the phone.
Nothing will work until i go back to the stock apk the rom flashed with.
I'm currently using apktool1.52, with the 5-13-2103 aapt binary. I've installed the framework-res (if) from the rom itself as well.
Only commands i'm issuing is apktool d name.apk and apktool b name
The apks build fine, minus a few warning messages (no errors).
Does anyone have any idea what could be happening? This is driving me nuts.
kallell said:
Hey everyone.
As many of you know, the S4 system files don't seem to like playing nice. For me, it seems i can't modify literally any of them. No matter what i do, they force close after being baksmali'd.
I've even gone as far as d compile base apk > compile it back to an apk without moding ANYTHING > pushing to the phone.
Nothing will work until i go back to the stock apk the rom flashed with.
I'm currently using apktool1.52, with the 5-13-2103 aapt binary. I've installed the framework-res (if) from the rom itself as well.
Only commands i'm issuing is apktool d name.apk and apktool b name
The apks build fine, minus a few warning messages (no errors).
Does anyone have any idea what could be happening? This is driving me nuts.
Click to expand...
Click to collapse
Bump?

How to fix Cyanogenmod 13 AOSP gesture typing! [Works on all devices running Cm 13]

So, after some research, I found out to fix the AOSP gesture typing on Cm 13. This simple fix works on all devices (So far) running Cyanogenmod 13. So, without further ado, lets get into this.
So depending on what Gapps package you flashed to your device, you may need to download the "Google Keyboard" (https://play.google.com/store/apps/details?id=com.google.android.inputmethod.latin&hl=en) and if your device already has it, then right on!
So, using a file exploring app, (I had some slight trouble with the CM File Explorer) go to Root>Data>App>com.google.android.inputmethod.latin-1>lib>arm and stop.
Once you are there, you should see a file named "libjni_unbundled_latinmegoogle.so" this is the file you need to get the gesture typing working.
So, what you want to do is copy that file to System>Lib. After you've done that, rename the file to "libjni_latinemegoogle.so"
And congratulations! You did it! Now, a quick reboot and your gesture typing should be working, if not, post in the comments and I'll try and fix it for you.
P.S. I know there is a way to do this using a terminal app like "Terminal Emulator" but I had issues doing so. If anyone out there knows how to do this, please share how in the comments!
The specified ARM folder is empthy.
Edit: Don't use CM File Manager as it won't find the file. Also keep in mind that some languages don't support swype functionality.
Excuse the lazy copy-and-paste job from the CyanogenMod Forums, but I have got this to say:
aha360 (CyanogenMod Forums) said:
Thank you very much for helping me out with fixing the AOSP Keyboard Swype gesture fix @MrPockets and @TacoTank
Here's a flashable ZIP with the addon.d BASH survival script so that if you want to install nightly updates and do anything relating to this, you can just flash this ZIP package without the fear of losing this feature.
This has also been tested on CM14 (Android Nougat) and I can confirm that this works without any issue whatsoever.
Enjoy.
https://1drv.ms/u/s!Agj5mSliZ57Fhkekg-w8mQap1umU
Source: https://forum.cyanogenmod.org/topic...ure-typing-fix/?do=findComment&comment=610733
Click to expand...
Click to collapse
aha360 said:
Excuse the lazy copy-and-paste job from the CyanogenMod Forums, but I have got this to say:
Click to expand...
Click to collapse
Hi, I tried to install your zip from recovery, but in my AOSP Unlegacy-Android Marshmallow it did not work. Any troubleshooting?
miomaguro said:
Hi, I tried to install your zip from recovery, but in my AOSP Unlegacy-Android Marshmallow it did not work. Any troubleshooting?
Click to expand...
Click to collapse
https://onedrive.live.com/redir.asp...&authkey=!AC0r2z3f0hk72Bc&ithint=folder%2czip
Download, and extract the whole folder to:
Code:
/system/app/
Be warned that this may cause problems as this was taken from Lineage 7.1.1 so backup your LatinIME files before making any changes.
aha360 said:
https://onedrive.live.com/redir.asp...&authkey=!AC0r2z3f0hk72Bc&ithint=folder%2czip
Download, and extract the whole folder to:
Code:
/system/app/
Be warned that this may cause problems as this was taken from Lineage 7.1.1 so backup your LatinIME files before making any changes.
Click to expand...
Click to collapse
Thanks for your help. Do you think only the shared object will be enough?
miomaguro said:
Thanks for your help. Do you think only the shared object will be enough?
Click to expand...
Click to collapse
The shared object (that is modded to support Swype) and the Swype gesture flashable ZIP will suffice

[Guide][How to] Dynamic Nav Bar for Nougat

I don't understand why this isn't a feature of stock Android. They did it with the notification bar, but why not the navigation bar? The main reason for doing this is to prevent the navigation bar from being burned into your screen. There are Xposed modules for Lollipop/Marshmallow that do this exact same thing, making this mod unnecessary on those versions of Android. Since there's no Xposed for Nougat (or if you don't like using Xposed on Lollipop/Marshmallow), doing this mod will make your navigation bar dynamically change color to match your notification bar.
***Please Note***
This isn't perfect. In applications like Google Messenger the navigation bar doesn't change to match the color of the contact you're texting, but it's better than nothing.
Prerequisites:
- Nexus 6 with USB debugging enabled in developer settings
- TWRP
- ADB fully setup and functional
- Text editor (gedit (Linux), NotePad++ (Windows), or whatever you like to use)
- Archive Manager (Linux) or 7Zip (Windows)
- Apktool 2.2.2 (link at the bottom of this post)
- Apktool Windows wrapper script (Windows only)
Step 1: Boot into TWRP
Step 2: Select mount, then select system
Step 3: Connect your Nexus 6 to your computer and fire up a terminal (Linux) or command prompt (Windows)
Step 4: Navigate to the folder containing ADB (platform-tools).
Step 5: Type "adb pull system/framework/framework-res.apk".
Step 6: Type "apktool if framework-res.apk" This installs the framework
Step 7: Type "apktool d framework-res.apk" This decompiles the apk
Step 8: Navigate to res, values, and open styles.xml with your text editor of choice
Step 9: Search for "navigationBar". There will be three instances of it. You only have to change the last two. Change "@colorBlack" to "?colorPrimaryDark" and save your changes
Step 10: Open colors.xml and search for "input_method_navigation_guard". Change "ff000000" to "00000000" and save the file. If you don't change this, the navigation bar will turn black when you open the keyboard
Step 11: Go back to your terminal window/command prompt and type "apktool b framework-res". This recompiles the apk
IF YOU SKIP THE FOLLOWING STEP YOU WILL END UP IN A BOOTLOOP!!!!!!!!!!
Step 12: Delete META-INF and AndroidManifest.xml from the modified framework-res.apk and copy over the ones from your original framework-res.apk
Step 13: Push the modified framework-res.apk to your device with ADB or by boot into recovery, copy it to your phone, and use the TWRP file manager to move it to /system/framework. If you do the TWRP method, be sure to set the permissions to 0644 or your​ phone will not boot.
Step 14: Boot up your Nexus 6 and test it out!
Link to Apktool
Nice tutorial. However, the reasons you're having issues "reusing" an existing modified copy of framework-res.apk are twofold.
1. You're re-signing a system app. Unless things have changed in the four years since I last modified framework-res.apk, system apps are not signed.
2. The apk can also be moved into /system/framework using a file explorer on the device. It simply cannot be done in one shot as the permissions need to be changed prior to the final move into /system/framework.
The framework is Android version dependent, so an Android 5.x framework will not work in Android 6.x or 7.x. However, replacing the framework on multiple copies of the same version of Android is certainly possible. I have to head off to work, but when I have a spare moment upon getting home I'll generate a "reusable" framework, and a flashable zip as well.
Strephon Alkhalikoi said:
Nice tutorial. However, the reasons you're having issues "reusing" an existing modified copy of framework-res.apk are twofold.
1. You're re-signing a system app. Unless things have changed in the four years since I last modified framework-res.apk, system apps are not signed.
2. The apk can also be moved into /system/framework using a file explorer on the device. It simply cannot be done in one shot as the permissions need to be changed prior to the final move into /system/framework.
The framework is Android version dependent, so an Android 5.x framework will not work in Android 6.x or 7.x. However, replacing the framework on multiple copies of the same version of Android is certainly possible. I have to head off to work, but when I have a spare moment upon getting home I'll generate a "reusable" framework, and a flashable zip as well.
Click to expand...
Click to collapse
1. The first time I did this I didn't sign the app and ended up in a bootloop. After researching the issue I came across a post that said signing the app was necessary. Signing it fixed my problem, so I've signed it ever since out of habit. Next time I do this I'll skip signing it and see what happens. If I don't get a bootloop I'll remove it from the guide. It's possible I had a permissions error or something.
2. While moving it with a file explorer is possible, I just prefer ADB, so that's why I used it in my guide.
I realize that they're version dependant. I wasn't trying to use a modified framework-res from Marshmallow on Nougat or anything like that. For example, when I tried reusing one from the November factory image on the December security update, or one from the November image on Pure Nexus, I get a bootloops, so that's why I assumed it necessary to create a new one each time. It's not like this mod is hard or takes a large amount of time, so why not redo it each time just for fun?
Face_Plant said:
It's not like this mod is hard or takes a large amount of time, so why not redo it each time just for fun?
Click to expand...
Click to collapse
Not everyone likes playing around with app mods. When I last did it, it was to enable the network location service on a Coby tablet running Android 4.0.3. That was NOT fun as it involved smali editing. At least this is only an XML edit.
Strephon Alkhalikoi said:
Not everyone likes playing around with app mods. When I last did it, it was to enable the network location service on a Coby tablet running Android 4.0.3. That was NOT fun as it involved smali editing. At least this is only an XML edit.
Click to expand...
Click to collapse
I didn't mean for all mods, just this one. Like you said, it's only simple changes to two XML files.
After getting some practice by doing this a couple of times it only takes a few minutes to complete, depending on the speed of your computer. It takes me about 30 minutes since my Ubuntu machine is an old early 2000's PC that takes about 10 minutes to decompile the app, 10 minutes to sign it, and 10 more to recompile it... I'll be able to knock 10 minutes of that time if what you're saying is correct and signing it is unnecessary.
I'll try it again after class today and remove the signing bit if all goes well [emoji106]
Great write-up, worked well OP!
You can after recompile of the framework-res folder, you can delete the AndroidManifest.xml in the new APK, and copy the AndroidManifest.xml and META-INF folder from the original framework-res.apk into the newly built APK...hopefully that makes sense.
No need to sign. That's what I did and it worked just fine, eliminates a step. I use 7zip to do all of that BTW.
RMarkwald said:
No need to sign. That's what I did and it worked just fine, eliminates a step. I use 7zip to do all of that BTW.
Click to expand...
Click to collapse
Good to hear. Those steps have been removed from the guide.
I wonder why signing it fixed my problem when I did this on Marshmallow earlier this year... I guess I screwed up something else and the second time around when I signed it I didn't screw up whatever I did wrong the first time.
Face_Plant said:
Good to hear. Those steps have been removed from the guide.
I wonder why signing it fixed my problem when I did this on Marshmallow earlier this year... I guess I screwed up something else and the second time around when I signed it I didn't screw up whatever I did wrong the first time.
Click to expand...
Click to collapse
Could depend on the app maybe? Not too sure there. I started wanting to learn modding apks (mainly making color changes, etc) by guides similar to this, the whole "I wonder if I can do that?" thing. Hopefully this will encourage those looking to try something like this that isn't too difficult to do to give it a shot and try it, just remember to have a backup of framework-res.apk handy, always can be adb pushed back via recovery if something goes south.
Thanks again for this OP, so far working great!
Awesome write up!
Not trying to hijack the thread, but for those not comfy making mods, there is "an app for that" Navbar Apps
Simple app that will dynamically change your nav bar color as well as other goodies.
recompiling it fails. i get this error on Ubuntu 16.10 I even tried using sudo
I: Using Apktool 2.2.0-dirty
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathNotExist: apktool.yml
at brut.androlib.Androlib.readMetaFile(Androlib.java:258)
at brut.androlib.Androlib.build(Androlib.java:270)
at brut.androlib.Androlib.build(Androlib.java:263)
at brut.apktool.Main.cmdBuild(Main.java:224)
at brut.apktool.Main.main(Main.java:84)
Caused by: brut.directory.PathNotExist: apktool.yml
at brut.directory.AbstractDirectory.getFileInput(AbstractDirectory.java:105)
at brut.androlib.Androlib.readMetaFile(Androlib.java:254)
... 4 more
how do i deal with this?
i see the yml file right in the folder
kidhudi said:
recompiling it fails. i get this error on Ubuntu 16.10 I even tried using sudo
I: Using Apktool 2.2.0-dirty
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathNotExist: apktool.yml
at brut.androlib.Androlib.readMetaFile(Androlib.java:258)
at brut.androlib.Androlib.build(Androlib.java:270)
at brut.androlib.Androlib.build(Androlib.java:263)
at brut.apktool.Main.cmdBuild(Main.java:224)
at brut.apktool.Main.main(Main.java:84)
Caused by: brut.directory.PathNotExist: apktool.yml
at brut.directory.AbstractDirectory.getFileInput(AbstractDirectory.java:105)
at brut.androlib.Androlib.readMetaFile(Androlib.java:254)
... 4 more
how do i deal with this?
i see the yml file right in the folder
Click to expand...
Click to collapse
Is Apktool installed correctly? Have you tried using Apktool 2.2.1? Maybe 2.2.0 isn't compatible for some reason? These are obviously just guesses. I'm no master at reading error logs...
ok i figured that out..
will this technique work on nitrogen version 7.1.1 because the nav bar doesnt change but when i pull the framework-res.apk the xml files are in fact altered.
---------- Post added at 09:13 PM ---------- Previous post was at 08:24 PM ----------
Face_Plant said:
Is Apktool installed correctly? Have you tried using Apktool 2.2.1? Maybe 2.2.0 isn't compatible for some reason? These are obviously just guesses. I'm no master at reading error logs...
Click to expand...
Click to collapse
no the command in the tutorial didnt work. because i was compiling a folder named framework-res and not an apk all i did was remove the .apk from the command supplied and it worked finally
also i dont know if it is an error but the push command has an lsystem for the location to be pushed. that wasnt working either.
thanks for the reply bro
Thanks face_plant. It was working the whole time. I thought I would get the pixel icons lol. My bad
Great tut thanks
kidhudi said:
Thanks face_plant. It was working the while time. I thought I would get the pixel icons lol. My bad
Great tut thanks
Click to expand...
Click to collapse
Pixel buttons are from the Substratum theme I'm using. You can get those too by being on a Nougat ROM that supports Substratum and using Pixel UI theme from the Play Store.
Just a heads up, if you're on 7.1.1 the theme won't work. It needs to be updated to support 7.1.1. Haven't tried it on 7.1, so it may or may not work.

A complex situation related to proximity sensor issue running ANDROID 8 builds.

Recently Xposed modules were released for Android7 that gave me a relief for the proximity sensor problem in my device. Before that I used a recompiled dialer.apk from @digital0 (https://forum.xda-developers.com/showpost.php?p=69507586&postcount=253).
As the new Android builds for my device has released LINEAGEOS15, AIM ROM, AEX ROM. I was curious to use them all, the ROM's are working fine but the problem of proximity sensor for dialer came back. As there is no xposed module for Android 8 I had the only option to use the recompiled dialer.apk that I have mentioned above.
The problem starts here I cannot push the dialer.apk to my device using adb/fastboot tools it gives me the error that "adbd cannot run as root in production builds" (https://forum.xda-developers.com/showthread.php?t=833756) again I used this thread to do exactly what it said but It was a fail and In the Fastboot mode I get bootloader unlock:false but I'm running a custom ROM and custom RECOVERY that would not be possible with a locked bootloader.
So i decided to to insert the recompiled dialer.apk to priv-app in system folder of my ROM using Ubuntu(system.new.dat>system.img>system folder). I succeeded to keep the recompiled dialer.apk in the priv-app folder I repacked the folder to system.img>system.new.dat. Compressed all the files to .zip and flashed the ROM, booted the device and as soon as I open the dialer.apk it pops a message saying "Unfortunately app has stopped working".
and for the information I modified AIM ROM which had a dialer.apk(v.10) and mine was dialer.apk(v.3).
Any help will be appreciated. It is a long topic please don't stress out. I know should have changed my display but I'm curious to know why this is happening.
if anyone knows how to recompile a apk please help me.
You have to recompile the app for your version of Android.
How to recompile - get the sources for your Android (LineageOS I assume) version, patch the source (for cm14 it was packages/apps/Dialer/InCallUI/src/com/android/incallui/ProximitySensor.java file), then compile dialer - I used command "make Dialer DISABLE_DEXPREOPT=true WITH_DEXPREOPT=false".
Then the compiled apk was here - out/target/product/generic/system/priv-app/Dialer/Dialer.apk.
digital0 said:
How to recompile - get the sources for your Android (LineageOS I assume) version, patch the source (for cm14 it was packages/apps/Dialer/InCallUI/src/com/android/incallui/ProximitySensor.java file), then compile dialer - I used command "make Dialer DISABLE_DEXPREOPT=true WITH_DEXPREOPT=false".
Then the compiled apk was here - out/target/product/generic/system/priv-app/Dialer/Dialer.apk.
Click to expand...
Click to collapse
Any tutorial that can explain this process step by step.
There are tutorials how to compile LineageOS, you can use any, not specifically for your device, because you need to compile Dialer.apk only.
So can you elaborate it please. More specific how how to do it step by step @digital0
No, I am not writing tutorial how to compile LineageOS step by step, sorry. I can show commands which I used to compile (probably), but you have to adjust them to the new Android version:
repo init -u https://github.com/LineageOS/android.git -b cm-14.1
repo sync
patch
make Dialer DISABLE_DEXPREOPT=true WITH_DEXPREOPT=false
Edit: instead of cm-14.1 you will probably need to use lineage-15.0
See https://github.com/LineageOS/android/tree/lineage-15.0 for more information.
Thanks for the info I will start working on it and let you know when it is finished

Anyone successfully modded framework-res.apk ( Oreo ) ?

Anyone tried Modding framework-res.apk ( Oreo ) ? I have tried a few methods with apktool and was able to compile back to apk. But booting it with ended up in bootloop.
If anyone has successfully done this, try compiling one with enabling navigation bar in bools.xml and see if it gives persistent on screen buttons. ( I know there is a magisk module that does enable nav bar - but it often disappears after reboots. So not a good solution. )
mahfoozceecy said:
Anyone tried Modding framework-res.apk ( Oreo ) ? I have tried a few methods with apktool and was able to compile back to apk. But booting it with ended up in bootloop.
If anyone has successfully done this, try compiling one with enabling navigation bar in bools.xml and see if it gives persistent on screen buttons. ( I know there is a magisk module that does enable nav bar - but it often disappears after reboots. So not a good solution. )
Click to expand...
Click to collapse
which version of apktool did you use (pc or mobile)? you dont need to sign the apk. just extract meta-inf from the original apk and install/push it to the modded one. hth
mahfoozceecy said:
Anyone tried Modding framework-res.apk ( Oreo ) ? I have tried a few methods with apktool and was able to compile back to apk. But booting it with ended up in bootloop.
If anyone has successfully done this, try compiling one with enabling navigation bar in bools.xml and see if it gives persistent on screen buttons. ( I know there is a magisk module that does enable nav bar - but it often disappears after reboots. So not a good solution. )
Click to expand...
Click to collapse
Since you are modding system I assume you don't care about breaking safetynet. If it is so why dont you put
Code:
qemu.hw.mainkeys=0
in your build.prop.
This gives you persistant Nav Bar which you can further customize to your heart's content with Xposed.
---------- Post added at 09:06 AM ---------- Previous post was at 09:04 AM ----------
mahfoozceecy said:
Anyone tried Modding framework-res.apk ( Oreo ) ? I have tried a few methods with apktool and was able to compile back to apk. But booting it with ended up in bootloop.
If anyone has successfully done this, try compiling one with enabling navigation bar in bools.xml and see if it gives persistent on screen buttons. ( I know there is a magisk module that does enable nav bar - but it often disappears after reboots. So not a good solution. )
Click to expand...
Click to collapse
Since you are modding system I assume you don't care about breaking safetynet. If it is so why dont you put
Code:
qemu.hw.mainkeys=0
in your build.prop.
This gives you persistant Nav Bar which you can further customize to your heart's content with Xposed.
I am a bit rusty due to my break from xda, but IIRC you need to deodex for customization.
mahfoozceecy said:
Anyone tried Modding framework-res.apk ( Oreo ) ? I have tried a few methods with apktool and was able to compile back to apk. But booting it with ended up in bootloop.
If anyone has successfully done this, try compiling one with enabling navigation bar in bools.xml and see if it gives persistent on screen buttons. ( I know there is a magisk module that does enable nav bar - but it often disappears after reboots. So not a good solution. )
Click to expand...
Click to collapse
You can compile your changes as an overlay and put it in /vendor/overlay/

Categories

Resources