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

Chaitanya Kumar

Senior Member
Jan 9, 2017
51
6
8
26
Bharuch
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.
 

digital0

Senior Member
Oct 18, 2010
345
146
0
Vilnius
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.
 
  • Like
Reactions: Chaitanya Kumar

Chaitanya Kumar

Senior Member
Jan 9, 2017
51
6
8
26
Bharuch
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.
Any tutorial that can explain this process step by step.
 

digital0

Senior Member
Oct 18, 2010
345
146
0
Vilnius
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.
 
Last edited:
  • Like
Reactions: Chaitanya Kumar