LSPosed Xposed Framework [8.1-13.0]. Simple Magisk Module

What Xppsed Framework are You Using??


  • Total voters
    1,565
Search This thread

VD171

Senior Member
Jun 21, 2012
2,976
2
2,232
127.0.0.1
LG K10
Samsung Galaxy J7
As I already said before, LSPoes does NOT support Android 8.0.
(Please, ignore the topic of this thread because this thread is NOT officially supported by LSPosed developers.)
As you can see here:
Code:
Drop support for API 26 (Android 8) (please at least use 8.1 because Android 8 is buggy)
 
  • Like
Reactions: Lord Sithek

j_cesarbm

Senior Member
Jun 17, 2017
51
5
Hi, through EDXposed I had an app called Fake GPS Location. How to port it to LSPosed?
 

beeshyams

Senior Member
Dec 29, 2014
1,748
670
Bangalore
As FYI

LSPosed developer on his Tg says

We recently received many complaints from users that they cannot launch the LSPosed manager the second timne. This is because the third-party ROM they use has merged this PR. This is totally wrong and breaks the behavior of standard SDK: the fd changes its offset after calling an open interface. We don't fix this on our side. Please ask your ROM maintainer to revert this commit or fix this commit (open + setoffset instead of dupping the fd). Or switch to another ROM.
 
  • Like
Reactions: josephcsible

winner71

Member
Nov 1, 2007
19
4
Please maybe someone here can help me. After long cat n mouse game with some marketplace applications, I decided to uninstall both magisk and lsposed (unrooting). When I rooted again with only magisk+shamiko+unsf, those apps still worked smoothly. But after I installed lsposed with no xposed module yet, they start to stop working. Now I know this is obviously about lsposed that cause some apps keeps stopping. I've used the parasitic Manager and remove the lsposed icon from homescreen, but doesn't help. How can I solve this problem?
 

heinhuiz

Senior Member
Nov 26, 2011
1,387
1,267
Xiaomi Mi A1
Redmi K20 / Xiaomi Mi 9T
By popular request, this is my setup for automatically adding newly installed packages to some user-defined LSPosed scopes.

[EDIT:] These instructions have been updated on February 1, 2022 and the zip file has been updated on November 14, 2021.

Requirements:
Caveats:
  • LSPosed won't pick up the changes until the device is rebooted.
Instructions:
  1. Unzip the attached LSPosed-Auto-Add.zip
  2. Create the /sdcard/usr/bin directories.
  3. Move lsposed-scopes-add from step 1 file to /sdcard/usr/bin. The file full path must be /sdcard/usr/bin/lsposed-scopes-add
  4. Move xposed-modules-status from step 1 file to /sdcard/usr/bin. The file full path must be /sdcard/usr/bin/xposed-modules-status
  5. Launch Automate, go to settings and change the Superuser command from its default of
    Code:
    su
    to
    Code:
    su -mm
    .
  6. Import LSPosed Auto Add.flo in Automate.
  7. After the flow is imported, grant all needed permissions.
  8. In the imported flow, start Configure. You should see a list of active LSPosed modules like the one seen on the attached screenshot.
  9. Toggle the modules as needed. If shown with a check mark, any newly added package will be added to the module's scope.
  10. Press Cancel to exit from the module list.
  11. Make sure that Automate is set to start at boot (in Automate settings).
There should be two automate fibers running in the flow. If it stops for whatever reason, just start the Init flow.
You can add and remove modules at any time by launching the Configure flow.

Changes:
  • 2021-11-01: Provide missing script.
  • 2021-11-08: Force running scripts in / in Automate flow.
  • 2021-11-14: Also support parasitic manager.
  • 2022-02-01: Add "su -mm" instructions for newer versions of Automate.
Thanks to @Open.Orange, @spawnlives and @randomwordhere for testing.
@Fif_ do you think this Automate flow can be transferred to Tasker? I can't use it because it's more than 30 blocks and I can't buy the full version of Automate without a Google account.

(I don't think it will be easy 😉)
 

Fif_

Senior Member
Jun 5, 2013
1,245
1,368
Google Nexus 10
Google Nexus 4
@Fif_ do you think this Automate flow can be transferred to Tasker? I can't use it because it's more than 30 blocks and I can't buy the full version of Automate without a Google account.

(I don't think it will be easy 😉)
The core of the action is undertaken by the /sdcard/usr/bin/lsposed-scopes-add script.
Automate just maintains the list of modules that need to add new apps to their scope and calls:
Code:
bash /sdcard/usr/bin/lsposed-scopes-add <new-app> <xposed-module1> <xposed-module2>...
whenever a new app is installed.

Reimplementing the logic to parse the list of active modules and the UI in Tasker would be a pain, and may not be possible. I was a Tasker user but have moved to Automate a long time ago because it's way more powerful, but also more complex.
However you should be able to configure Tasker to run the command line above as root for every new package install, as long as you configure the Xposed module list manually. It is just a list of Xposed modules packages names from the list you can get by running:
Code:
bash /sdcard/usr/bin/xposed-modules-status
 
  • Like
Reactions: heinhuiz

heinhuiz

Senior Member
Nov 26, 2011
1,387
1,267
Xiaomi Mi A1
Redmi K20 / Xiaomi Mi 9T
Thank you @Fif_. I've never used Tasker and currently it is a little bit over my head. I don't think investing time for only this project will be too much for me.

If anyone else knows their way around Tasker and can implement a setup like this, it would be very much appreciated! Many people are asking for auto adding new apps to LSPosed modules, but those requests have always been refused,
 

heinhuiz

Senior Member
Nov 26, 2011
1,387
1,267
Xiaomi Mi A1
Redmi K20 / Xiaomi Mi 9T
The core of the action is undertaken by the /sdcard/usr/bin/lsposed-scopes-add script.
Automate just maintains the list of modules that need to add new apps to their scope and calls:
Code:
bash /sdcard/usr/bin/lsposed-scopes-add <new-app> <xposed-module1> <xposed-module2>...
whenever a new app is installed.

Reimplementing the logic to parse the list of active modules and the UI in Tasker would be a pain, and may not be possible. I was a Tasker user but have moved to Automate a long time ago because it's way more powerful, but also more complex.
However you should be able to configure Tasker to run the command line above as root for every new package install, as long as you configure the Xposed module list manually. It is just a list of Xposed modules packages names from the list you can get by running:
Code:
bash /sdcard/usr/bin/xposed-modules-status
@anuraag.neo posted a what he calls "minimal task" to enable new packages in XPL automatically.
@Fif_ said he has some questions about it, but the discussion would be off-topic there. Maybe we can continue that discussion here?
 
  • Like
Reactions: dr4go

Fif_

Senior Member
Jun 5, 2013
1,245
1,368
Google Nexus 10
Google Nexus 4
@anuraag.neo posted a what he calls "minimal task" to enable new packages in XPL automatically.
@Fif_ said he has some questions about it, but the discussion would be off-topic there. Maybe we can continue that discussion here?
My main question was about restarting lspd to pick up the changes made to the lsposed database. On my devices, killing and restarting lspd with:
Code:
kill all lspd
ASH_STANDALONE=1 su -pc /data/adb/magisk/busybox sh /data/adb/modules/*_lsposed/service.sh --system-server-max-retry=-1
doesn't work: lspd is killed but not restarted, there are no messages in logcat but LSPosed reports the framework as not installed.
Of course, after rebooting, everything is back to normal.
This is with Magisk 24.3 and Zygisk LSPosed 1.8.3 (current stable).
 

anuraag.neo

Senior Member
Aug 7, 2013
103
56
Code:
ASH_STANDALONE=1 su -pc /data/adb/magisk/busybox sh /data/adb/modules/*_lsposed/service.sh --system-server-max-retry=-1
Use exact command as mentioned in their GitHub.
Code:
ASH_STANDALONE=1 su -pc /data/adb/magisk/busybox sh /data/adb/modules/*_lsposed/service.sh --system-server-max-retry=-1&
 

anuraag.neo

Senior Member
Aug 7, 2013
103
56
That doesn't make any difference, lspd doesn't respawn on my devices.
I have tried above code on Automate and it's working. Screenshot_2022-06-15-05-01-17-189_com.llamalab.automate.jpg
 

Top Liked Posts

  • There are no posts matching your filters.
  • 6
    Just to let you know, i was just updating lsposed thru fox manager, and stuck into bootloop :(
    A13, LOS20, Lygisk

    removing modules didnt help, safemode not possible.
    Im reflashing everything right now..
    I don't know if you had Magisk Bootloop Protector installed that can help prevent and fix bootloop issues. It does this by disabling problematic Magisk modules one by one until the bootloop is resolved. This can be useful if you find yourself stuck in a bootloop after installing a Magisk module.
    5
    Has anyone installed v1.9.1-6990 yet? Is there any problem on Android 13 or 14 beta on a Pixel 7 Pro?
    No problem. Works fine
    3

    LSPosed v1.9.0 released

    Changelog & download:


    Edit: v1.9.0 was pulled out due to some error


    LSPosed v1.9.1 released


    3
    Maybe, you can try a script to completely remove LSPosed from said device.
    Code:
    #!/bin/bash
    
    # Check if Magisk Manager is installed
    if [ ! -f "/data/adb/magisk.apk" ]; then
      echo "Magisk Manager is not installed."
      exit 1
    fi
    
    # Uninstall LSPosed
    adb shell pm uninstall com.lsposed.module
    
    # Clear the cache and data for the Magisk Manager app
    adb shell pm clear com.lsposed.module
    
    # Boot the device into recovery mode
    adb reboot recovery
    
    # Wipe the cache partition
    adb shell wipe cache
    
    # Reboot the device
    adb reboot

    This script will first check if Magisk Manager is installed. If it is not, the script will exit with an error message. If Magisk Manager is installed, the script will then uninstall LSPosed. Next, the script will clear the cache and data for the Magisk Manager app. Finally, the script will boot the device into recovery mode and wipe the cache partition. Once the cache partition has been wiped, the script will reboot the device.

    Afterwhich, you can try LSPosed v.1.9.1 (6994) - zygisk-release.
    Thank you! What a clever idea(s)! I'll be sure to try it.

    It really makes me wish I could make any heads or tails or "headway" with figuring out what the logs are saying that's causing the issue that most modules launch and work fine enough, unless they have to read & write a config/pref file; no matter how many times I uninstall & re-install LSPosed & Magisk. Hopefully your idea of clearing the cache for Magisk and the partition will help reset it properly.


    I really do appreciate any & all (of your) help!
    3
    Why don't you try it and let us know?
    I did. My P7P worked fine for a few hours then I just got a hard freeze a few minutes ago. Had to force reboot the phone.

    I reinstalled the previous stable version of LSposed. Not convinced by this new "stable" version.
  • 84
    Developers: LSPosed Developers
    Homepage: GitHub
    Requirements:
    • Magisk 21+
    • Android 8.1-13

    Riru(NOT NEEDED) USE ZYGISK
    Description:
    Riru module providing ART interception framework (natively for Android Pie) that provides consistent API -interfaces with OG Xposed, using YAHFA (or SandHook) interception environment, supports Android 8.1 ~ 11.
    & Installation:
    • Install Riru 23+
    • Install Riru - LSPosed via Magisk Manager
    • Install LSPosed Manager app (Note: No Saparate App and Zip, App Will be Installed Automatically)
    • Reboot your device.


    Download:
    For stable release, please go to Github Release page For canary build use telegram.
    Go to second post for latest version Download

    Notes:
    I'm just sharing this from github, I'm not responsible if you bricked your device.

    GPay and other banking apps working fine without any issue so this xposed alternative is worth trying and safer.

    Note: If anyone facing bootloop issue, don't panic, hard reboot again and it will work.


    Screenshot:
    31
    Download:
    Flash zip file through magisk and then install LSPosed Manager app

    Update 1 March 2021
    V1.2.0

    V1.3.7 Updated 15.May.2021
    (Note: No Saparate App and Zip, App Will be Installed Automatically)


    For Newer Version Changelogs and Downloads:
    LsPosed Github




    Changelog

    • Fix manager white screen
      [*]Support split-apk modules (LSPosed will choose only one apk with xposed_init to load)
      [*]Fix manager crash when launching an uninstalled module from notification
      [*]Load modules with SharedMemory (it can speedup app cold launch) 2
      [*]New manager icon
      [*]Fix incorrect update notification in the first installation
      [*]Fix some apps not showing in the scope list in some rare cases
      [*]Show notification of module uninstallation
      [*]Prevent modules from hooking inner methods (methods from XposedBridge's classloader)



    Note:

    Previously LSPosed only recognize modules from the primary user. However, this strategy is not good and leads to some problems: some modules require getting installed app lists for configuration but they cannot do so across users; some require reading themselves from the hooked apps but they cannot do so from non-primary users; some users want to configure modules differently on different users which is not feasible previously. Thus LSPosed now requires every module to be installed to the user on which the apps they want to hook are installed. Some devices restrict modules from installing onto some users. In such a case, you can install them from the manager (but it's recommended).

    1: For some weird devices that prevent installing apps from the root user, please install the manager from /data/adb/lspd/manager.apk or manager.apk from the zip file manually.

    2: Some modules get modules' apk path using reflection of its classloader, it's not recommended and unstable since the apk path from classloader no longer exists when using SharedMemory to load modules. Please use the documented way (from IXposedHookZygoteInit.StartupParam.modulePath) instead.
    18
    Why it's safer than EdXposed?
    I didn't say it's safer than edxposed. I meant xposed alternatives like taichi etc.
    All banking apps works, no system slowdown, i got more free ram etc.
    In edxposed the hooked apps take time to open, no such issue with LSPosed.
    That's why i thought it's worth trying and safer.
    17
    I was considering that until I made an Automate flow to automatically add newly installed apps to select Xposed modules' scope.
    By popular request, this is my setup for automatically adding newly installed packages to some user-defined LSPosed scopes.

    [EDIT:] These instructions have been updated on February 1, 2022 and the zip file has been updated on November 14, 2021.

    Requirements:
    Caveats:
    • LSPosed won't pick up the changes until the device is rebooted.
    Instructions:
    1. Unzip the attached LSPosed-Auto-Add.zip
    2. Create the /sdcard/usr/bin directories.
    3. Move lsposed-scopes-add from step 1 file to /sdcard/usr/bin. The file full path must be /sdcard/usr/bin/lsposed-scopes-add
    4. Move xposed-modules-status from step 1 file to /sdcard/usr/bin. The file full path must be /sdcard/usr/bin/xposed-modules-status
    5. Launch Automate, go to settings and change the Superuser command from its default of
      Code:
      su
      to
      Code:
      su -mm
      .
    6. Import LSPosed Auto Add.flo in Automate.
    7. After the flow is imported, grant all needed permissions.
    8. In the imported flow, start Configure. You should see a list of active LSPosed modules like the one seen on the attached screenshot.
    9. Toggle the modules as needed. If shown with a check mark, any newly added package will be added to the module's scope.
    10. Press Cancel to exit from the module list.
    11. Make sure that Automate is set to start at boot (in Automate settings).
    There should be two automate fibers running in the flow. If it stops for whatever reason, just start the Init flow.
    You can add and remove modules at any time by launching the Configure flow.

    Changes:
    • 2021-11-01: Provide missing script.
    • 2021-11-08: Force running scripts in / in Automate flow.
    • 2021-11-14: Also support parasitic manager.
    • 2022-02-01: Add "su -mm" instructions for newer versions of Automate.
    Thanks to @Open.Orange, @spawnlives and @randomwordhere for testing.
    14
    I have it working on the Poco X3 NFC, running RR, loaded and runs without issue, I used the YAHFA option, has updated without issue.

    Thought I should add that I can't get SafetyNet on, but I've never been worried about that, I think I've only ever had it working once on one of my devices years ago. The one app that refused to play nice I just used MagiskHide on, and it's not a problem now.

    In saying that I only have one module loaded, I haven't had time to go looking for the below answers, to install any others.

    The only thing I haven't figured out yet is what apps need to be picked with what modules, sure some are obvious as they are named after the apps, but is there anything else that needs to be picked with them? For example, do I need to pick the framework app with everything, I'm sure I don't, but how do I know?
    I'm using YAHFA myself, even though I was using SandHook earlier with EdXposed. Also, I'm passing SafetyNet without an issue and Play Store shows certified as well, so that's nice.

    Coming to your question about "scope", basically for a module, you have to select the apps that are hooked by the module. This is pretty straightforward for modules that hook a specific app, for example, if you're using WATweaker, you have to select WhatsApp in its "scope". Similarly, another example, if you're using Instaprefs, you have to select Instagram in its "scope". However, for more systemwide module (like GravityBox, for example), multiple apps have to be selected in the "scope" as the module is more global in nature, so to speak.

    The only way to figure out which apps need to be added in scope for a module is to ask the module developer or by trial and error. Taking GravityBox as an example, you'll find the list of apps that need to be selected for its scope in the first post of its thread (under apps that need to be whitelisted; "whitelisted" term being used in context of EdXposed, since when the post was written, LSPosed wasn't a thing).

    Also, modules can auto-add recommended apps to their scope, but the responsibility of making that happen lies with the module developer. Once again, taking GravityBox as the example, if you install GravityBox in LSPosed, you don't have to select apps manually in its scope. They're auto-selected since the developer has added support for LSPosed and auto-selection of scope apps.

    I know the reply is long-ish, but I hope it helps you and the others who had similar questions. :)