Themes / Apps / Mods [Xposed] Various Android 12 mods

Search This thread

nijel8

Senior Member
Dec 24, 2011
2,423
5,646
All over US
Google Pixel 5a
Sharing my Android 12 mods as Xposed modules. You need Magisk+Lsposed installed obviously.
Two of the mods do not respond well to user controlled settings within the module so I've made separate modules for them:

1. xPixel
- Disable Screen ON on plugged
- Disable ADB debugging notification
- Activate AOD on plugged
- Disable Lock screen timeout
- Long press actions for Navbar buttons:
___ HOME > Screen OFF (see NOTE bellow)
___ BACK > Kill foreground app
___ RECENT > switch ON - Launch custom app, OFF - acts as MENU key
- Disable 'Power off' on Lock screen if device is secured with pin, pattern or password
- Advanced Power menu with user selectable options:
___ Soft restart
___ Recovery
___ Bootloader
___ Fastboot
___ SystemUI restart
___ Keep A12 Power menu look 'n fill for Restart submenu

2. Battery Estimate Gone
- Show Battery percentage instead of estimated time remaining in expanded notifications Status bar

3. Double Tap to Wake
- Double Tap to check phone instead of the default Single Tap
- Double Tap timeout is user configurable

NOTE: Disable Google Assistant in Settings > Apps > Default apps > Digital assistant app > Default digital assistant app > set to None for better experience if using longpress HOME screen OFF.

Enjoy!
 
Last edited:

meiskam

Member
Jun 13, 2010
14
7
can I get a button to add a shortcut to bg.nijel.xpixel/.SettingsActivity on my homescreen?

or add it to category `android.intent.category.LAUNCHER` / set `android:exported="true"`
 
Last edited:

meiskam

Member
Jun 13, 2010
14
7
so, another feature request 😳, I'd love long-press RECENT to push a KEYCODE_MENU KeyboardEvent, like when phones used to have a hardware menu button

something like:
Java:
Instrumentation m_Instrumentation = new Instrumentation();
m_Instrumentation.sendKeyDownUpSync( KeyEvent.KEYCODE_MENU );
+ INJECT_EVENTS permission
 
  • Like
Reactions: nijel8

nijel8

Senior Member
Dec 24, 2011
2,423
5,646
All over US
Google Pixel 5a
No need for that method, I directly set the key code for recent button in it's instance of KeyButtonView class with Xposed, much easier... As a matter of fact Android 12 on pixel doesn't transmit any key code event for the recent button. Anyway...
MENU key code is actually a pretty good idea, that way when you disable custom app launching you get menu button with long pressing the recent button... How I didn't think of that?! Double functionality... Definitely will do... but I am out of town for the next 2 weeks so later.
 
Last edited:
  • Like
Reactions: meiskam

ap1618

Senior Member
Sharing my Android 12 mods as Xposed modules. You need Magisk+Lsposed installed obviously.
Two of the mods do not respond well to user controlled settings within the module so I've made separate modules for them:

1. xPixel:
-Disable Screen ON on plugged
-Disable ADB debugging notification
-Activate AOD on plugged
-Disable Lock screen timeout
-Long press actions for Navbar buttons:
-HOME > Screen OFF
-BACK > Kill foreground app
-RECENT > switch ON - Launch custom app, OFF - acts as MENU key

2. Battery Estimate Gone
-Show Battery percentage instead of estimated time remaining in expanded notifications Status bar

3. Double Tap to Wake
-Double Tap to check phone instead of the default Single Tap

Enjoy!
For #3, is there an Android 11 equivalent?
 

nijel8

Senior Member
Dec 24, 2011
2,423
5,646
All over US
Google Pixel 5a
For #3, is there an Android 11 equivalent?
Don't know, never looked in A11 code. If you wonna look at it this is the xposed module source code:
Code:
package bg.nijel.doubletaptowake;

import android.annotation.SuppressLint;
import android.view.MotionEvent;

import java.util.Timer;
import java.util.TimerTask;

import de.robv.android.xposed.IXposedHookLoadPackage;
import de.robv.android.xposed.XC_MethodHook;
import de.robv.android.xposed.XposedHelpers;
import de.robv.android.xposed.callbacks.XC_LoadPackage;
import de.robv.android.xposed.callbacks.XCallback;

import static de.robv.android.xposed.XposedBridge.log;

public class DoubleTaptoWake implements IXposedHookLoadPackage {

    private static boolean mDoubleTap = false;

    @Override
    public void handleLoadPackage(XC_LoadPackage.LoadPackageParam lpparam) {

        if (lpparam.packageName.equals("com.android.systemui")) {
            try {
                Class<?> clazz = XposedHelpers.
                        findClass("com.android.systemui.statusbar.phone.NotificationShadeWindowViewController$1",
                                lpparam.classLoader);
                XposedHelpers.findAndHookMethod(clazz,
                        "onSingleTapConfirmed", MotionEvent.class,
                        new XC_MethodHook(XCallback.PRIORITY_HIGHEST) {
                            @SuppressLint("PrivateApi")
                            @Override
                            protected void beforeHookedMethod(MethodHookParam param) {
                                param.setResult(true);
                                //log("nijel888 DoubleTaptoWake onSingleTapConfirmed");
                            }
                        });

                Class<?> clazzz = XposedHelpers.
                        findClass("com.android.systemui.doze.DozeTriggers", lpparam.classLoader);
                XposedHelpers.findAndHookMethod(clazzz,
                        "onSensor", int.class, float.class, float.class, float[].class,
                        new XC_MethodHook(XCallback.PRIORITY_HIGHEST) {
                            @SuppressLint("PrivateApi")
                            @Override
                            protected void beforeHookedMethod(MethodHookParam param) {
                                int pulseReason = (int) param.args[0];
                                if (pulseReason == 9) {
                                    if (!mDoubleTap) {
                                        param.setResult(null);
                                        mDoubleTap = true;
                                        new Timer().schedule(new TimerTask() {
                                            @Override
                                            public void run() {
                                                mDoubleTap = false;
                                            }
                                        }, 400);
                                    }
                                }
                                //log("nijel888 DoubleTaptoWake onSensor");
                            }
                        });

            } catch (Throwable t) {
                log(t);
            }
        }
    }
}
 

ap1618

Senior Member
I have no idea what's going on there in the code :)

When i tried to install the apk it said problem parsing the package, then I saw that the title says Android 12...


Don't know, never looked in A11 code. If you wonna look at it this is the xposed module source code:
Code:
package bg.nijel.doubletaptowake;

import android.annotation.SuppressLint;
import android.view.MotionEvent;

import java.util.Timer;
import java.util.TimerTask;

import de.robv.android.xposed.IXposedHookLoadPackage;
import de.robv.android.xposed.XC_MethodHook;
import de.robv.android.xposed.XposedHelpers;
import de.robv.android.xposed.callbacks.XC_LoadPackage;
import de.robv.android.xposed.callbacks.XCallback;

import static de.robv.android.xposed.XposedBridge.log;

public class DoubleTaptoWake implements IXposedHookLoadPackage {

    private static boolean mDoubleTap = false;

    @Override
    public void handleLoadPackage(XC_LoadPackage.LoadPackageParam lpparam) {

        if (lpparam.packageName.equals("com.android.systemui")) {
            try {
                Class<?> clazz = XposedHelpers.
                        findClass("com.android.systemui.statusbar.phone.NotificationShadeWindowViewController$1",
                                lpparam.classLoader);
                XposedHelpers.findAndHookMethod(clazz,
                        "onSingleTapConfirmed", MotionEvent.class,
                        new XC_MethodHook(XCallback.PRIORITY_HIGHEST) {
                            @SuppressLint("PrivateApi")
                            @Override
                            protected void beforeHookedMethod(MethodHookParam param) {
                                param.setResult(true);
                                //log("nijel888 DoubleTaptoWake onSingleTapConfirmed");
                            }
                        });

                Class<?> clazzz = XposedHelpers.
                        findClass("com.android.systemui.doze.DozeTriggers", lpparam.classLoader);
                XposedHelpers.findAndHookMethod(clazzz,
                        "onSensor", int.class, float.class, float.class, float[].class,
                        new XC_MethodHook(XCallback.PRIORITY_HIGHEST) {
                            @SuppressLint("PrivateApi")
                            @Override
                            protected void beforeHookedMethod(MethodHookParam param) {
                                int pulseReason = (int) param.args[0];
                                if (pulseReason == 9) {
                                    if (!mDoubleTap) {
                                        param.setResult(null);
                                        mDoubleTap = true;
                                        new Timer().schedule(new TimerTask() {
                                            @Override
                                            public void run() {
                                                mDoubleTap = false;
                                            }
                                        }, 400);
                                    }
                                }
                                //log("nijel888 DoubleTaptoWake onSensor");
                            }
                        });

            } catch (Throwable t) {
                log(t);
            }
        }
    }
}
 

nijel8

Senior Member
Dec 24, 2011
2,423
5,646
All over US
Google Pixel 5a
Don't know if the hooked methods even exist in A11... Lot is changed, for example 90% and more of A11 GravityBox code doesn't work in A12, that was what actually made me do these modules...

Edit: Nope, the important method that captures the tap is missing from A11 code and I don't feel like digging again... sorry
 
Last edited:
  • Like
Reactions: peikojose

Reechings

Senior Member
Jan 22, 2012
5,279
1,359
Google Pixel 6 Pro
Oh undo
Sharing my Android 12 mods as Xposed modules. You need Magisk+Lsposed installed obviously.
Two of the mods do not respond well to user controlled settings within the module so I've made separate modules for them:

1. xPixel:
-Disable Screen ON on plugged
-Disable ADB debugging notification
-Activate AOD on plugged
-Disable Lock screen timeout
-Long press actions for Navbar buttons:
-HOME > Screen OFF
-BACK > Kill foreground app
-RECENT > switch ON - Launch custom app, OFF - acts as MENU key

2. Battery Estimate Gone
-Show Battery percentage instead of estimated time remaining in expanded notifications Status bar

3. Double Tap to Wake
-Double Tap to check phone instead of the default Single Tap

Enjoy!
Thank you so much for making these. I was so tired of getting accidental wakeups with the single tap. The double tap to wake works well but I am running into times where it doesn't wake up after it's been off for a little while.
 

Reechings

Senior Member
Jan 22, 2012
5,279
1,359
Google Pixel 6 Pro
@nijel8

Not sure what phone you have but I don't think the double tap to wake mod works for me at all on January build for Pixel 6 Pro. I think it may also be because of a mod I am using by Typhus that adds a bunch of custom ROM stuff.
 

nijel8

Senior Member
Dec 24, 2011
2,423
5,646
All over US
Google Pixel 5a
@nijel8

Not sure what phone you have but I don't think the double tap to wake mod works for me at all on January build for Pixel 6 Pro. I think it may also be because of a mod I am using by Typhus that adds a bunch of custom ROM stuff.
Works well on my Pixel 5a with latest January build and all monthly builds before. Nothing has changed in AOSP code since A12 release...
The xposed module source code is few posts above.
 

Reechings

Senior Member
Jan 22, 2012
5,279
1,359
Google Pixel 6 Pro
Works well on my Pixel 5a with latest January build and all monthly builds before. Nothing has changed in AOSP code since A12 release...
The xposed module source code is few posts abov
Works well on my Pixel 5a with latest January build and all monthly builds before. Nothing has changed in AOSP code since A12 release...
The xposed module source code is few posts above.
Ok I guess maybe it's conflicting with this mod or something: https://forum.xda-developers.com/t/...for-pixel-devices-pixel-6-pro-thread.4362595/
 

Top Liked Posts

  • There are no posts matching your filters.
  • 9
    Sharing my Android 12 mods as Xposed modules. You need Magisk+Lsposed installed obviously.
    Two of the mods do not respond well to user controlled settings within the module so I've made separate modules for them:

    1. xPixel
    - Disable Screen ON on plugged
    - Disable ADB debugging notification
    - Activate AOD on plugged
    - Disable Lock screen timeout
    - Long press actions for Navbar buttons:
    ___ HOME > Screen OFF (see NOTE bellow)
    ___ BACK > Kill foreground app
    ___ RECENT > switch ON - Launch custom app, OFF - acts as MENU key
    - Disable 'Power off' on Lock screen if device is secured with pin, pattern or password
    - Advanced Power menu with user selectable options:
    ___ Soft restart
    ___ Recovery
    ___ Bootloader
    ___ Fastboot
    ___ SystemUI restart
    ___ Keep A12 Power menu look 'n fill for Restart submenu

    2. Battery Estimate Gone
    - Show Battery percentage instead of estimated time remaining in expanded notifications Status bar

    3. Double Tap to Wake
    - Double Tap to check phone instead of the default Single Tap
    - Double Tap timeout is user configurable

    NOTE: Disable Google Assistant in Settings > Apps > Default apps > Digital assistant app > Default digital assistant app > set to None for better experience if using longpress HOME screen OFF.

    Enjoy!
    3
    xPixel module updated, please redownload from OP:

    - Added option to disable 'Power off' on Lock screen if device is secured with pin, pattern or password
    - Added Advanced Power menu with user selectable options:
    ___ Soft restart
    ___ Recovery
    ___ Bootloader
    ___ Fastboot
    2
    Two modules updated, please redownload from OP...

    - xPixel - fixed bug that was causing Double Tap to Wake module not working in some cases
    - Double Tap to Wake - now should work with @Typhus_(thanks) magisk module Addon Features for Pixel Devices installed(not tested, please report)

    I can confirm that it's working with Addon Features module. Just tested it right now.

    :)
    2
    @nijel8

    Not sure what phone you have but I don't think the double tap to wake mod works for me at all on January build for Pixel 6 Pro. I think it may also be because of a mod I am using by Typhus that adds a bunch of custom ROM stuff.
    Works well on my Pixel 5a with latest January build and all monthly builds before. Nothing has changed in AOSP code since A12 release...
    The xposed module source code is few posts above.
    2
    Yeah, me too, will see if I can debug it...