[GUIDE]Magisk, SuperSU and Xposed for MEmu 7.3.2 or LDPlayer 4.0.45

Search This thread

kyleofbennett

New member
Feb 22, 2023
2
1
Hello.

I was able to edit, add, and remove apps directly on BlueStacks disks, even before installation.

At end, I got an updated Play Store, Google Services Framework and Play Games. I removed the default launcher and added Nova Launcher. Also, removed the pre-installed apps, like the built-in games.

Maybe this is a more effective way to install Magisk, and/or updated Google apps like GApps. My aim is to have a certified device on Play Store.

If anyone is interested, I'll show how I did.
Hey mate, I'd love to see how you did this as I'm trying to achieve the same thing at the moment!

Many thanks in advance :)
 

romulocarlos

Senior Member
Oct 10, 2011
552
153
Belo Horizonte
Hey mate, I'd love to see how you did this as I'm trying to achieve the same thing at the moment!

Many thanks in advance :)
Hello!

I abandoned this "project", as I was unable to get a certified device, but isn't a complicated process. You will need a computer or a virtual machine with a Linux distro (like Ubuntu) to preserve the files attributes (Windows can't handle Linux attributes). I've used a Ubuntu distro on VirtualBox, as VirtualBox can work well with the needed files, so I'll show you with this way.

So, at first, do a backup for your c:\programdata\Bluestacks_nxt folder and close any instance!

Now you'll need to convert the BlueStacks's virtual disks to VDI format. Use these commands:
Code:
vboxmanage clonehd "path_to_original_data.vhdx" "path_to_converted_original_data.vdi" --format vdi
and
Code:
vboxmanage clonehd "path_to_original_root.vhd" "path_to_converted_root.vdi" --format vdi

Once converted, VirtualBox will list these virtual disks on Tools tab. Go there, select the VDI files you just converted, and copy the UUID for each disk. You'll need to edit a file with same name as your's BlueStacks instances (I use only one, named Pie64, so my file is Pie64.bstk). It is located at Bluestacks_nxt folder, at subfolder "Engine". This file is like a XML file, so, I recommend you to use Notepad++ instead default Windows notepad.

There are some lines to edit. Look at lines starting with "HardDisk uuid" at top of the file. You do not need to edit the line with "fastboot.vdi", but edit the others to match the UUIDs and the converted VDIs filenames.

At bottom of the file, look for lines starting with "StorageControler". Inside these groups, change the UUID to match the converted VDIs, again. Close the file and start BlueStacks. If you did all correctly, everything will work as expected. Update/install any app you want, and close the instance.

Fire up your VirtualBox, attach the VDIs to the Ubuntu virtual machine as secondary disks, and start it. Inside the machine, open the root.vdi, and do the "mods" you want, like delete default apps. You can also open original_data.vdi, and delete the BlueStacks default app updates, and move the apps you installed/updated to root.vdi. I don't remember exactly where the apps folders are located, but isn't hard to find.

Once you finish, unmount the VDIs inside the virtual machine, and close it. Dettach the VDIs from the virtual machine, and start BlueStacks.

You're done! Good luck!
 
  • Like
Reactions: kyleofbennett

kyleofbennett

New member
Feb 22, 2023
2
1
Hello!

I abandoned this "project", as I was unable to get a certified device, but isn't a complicated process. You will need a computer or a virtual machine with a Linux distro (like Ubuntu) to preserve the files attributes (Windows can't handle Linux attributes). I've used a Ubuntu distro on VirtualBox, as VirtualBox can work well with the needed files, so I'll show you with this way.

So, at first, do a backup for your c:\programdata\Bluestacks_nxt folder and close any instance!

Now you'll need to convert the BlueStacks's virtual disks to VDI format. Use these commands:
Code:
vboxmanage clonehd "path_to_original_data.vhdx" "path_to_converted_original_data.vdi" --format vdi
and
Code:
vboxmanage clonehd "path_to_original_root.vhd" "path_to_converted_root.vdi" --format vdi

Once converted, VirtualBox will list these virtual disks on Tools tab. Go there, select the VDI files you just converted, and copy the UUID for each disk. You'll need to edit a file with same name as your's BlueStacks instances (I use only one, named Pie64, so my file is Pie64.bstk). It is located at Bluestacks_nxt folder, at subfolder "Engine". This file is like a XML file, so, I recommend you to use Notepad++ instead default Windows notepad.

There are some lines to edit. Look at lines starting with "HardDisk uuid" at top of the file. You do not need to edit the line with "fastboot.vdi", but edit the others to match the UUIDs and the converted VDIs filenames.

At bottom of the file, look for lines starting with "StorageControler". Inside these groups, change the UUID to match the converted VDIs, again. Close the file and start BlueStacks. If you did all correctly, everything will work as expected. Update/install any app you want, and close the instance.

Fire up your VirtualBox, attach the VDIs to the Ubuntu virtual machine as secondary disks, and start it. Inside the machine, open the root.vdi, and do the "mods" you want, like delete default apps. You can also open original_data.vdi, and delete the BlueStacks default app updates, and move the apps you installed/updated to root.vdi. I don't remember exactly where the apps folders are located, but isn't hard to find.

Once you finish, unmount the VDIs inside the virtual machine, and close it. Dettach the VDIs from the virtual machine, and start BlueStacks.

You're done! Good luck!
Thank you so much for putting this guide together buddy! I'll give it a go and update this thread with the result in case anyone might be interested.
 
  • Like
Reactions: romulocarlos

aikostes

New member
Dec 11, 2022
3
0
please give me instructions on how to install magisk on memu android 9, I've tried everything( it doesn 't work
 

tech128

Senior Member
Oct 14, 2012
177
118
Well currently kitsune magisk has some bugs that do not allow it to start properly on memu. You have to use the slightly older 26105 delta magisk to get it to work. Why they have removed this version even though its needed for memu is beyond me. Luckily archive.org has a copy.


After you grab a copy, follow the instructions here:

With the exception of you do need to disable root access after you install magisk to the system partition. Why they tell you not to disable it for other emulators besides ldplayer is also beyond me.

Lastly, you probably want to debloat it since memu pushes so much ads and junkware its ridiculous.

 
  • Like
Reactions: HemanthJabalpuri

Top Liked Posts

  • There are no posts matching your filters.
  • 7
    A new tool is available which can install Magisk in emulators. See Delta Magisk

    This tool is depreciated. No support will be provided.



    Magisk

    Note:- This is a experimental feature. I made this guide only for SuperUser management in MEmu. If you want modules then don't expect it to work. Modules like MigiskHideProps are not working. So don't expect much.


    As of now there is no working way for passing SafetyNet for playing games and apps that use it.

    For someone who want to install Magisk in emulators MEmu v7.3.2/LDPlayer v4.0.45 which is based on Android-x86, follow below guide.

    What is this method?
    -This method is used by exploits like mtk-su, qu1ckr00t without patching boot.img. I used this method because I don't know how to modify .vmdk as seen in here. Drawback of this method is that, many modules like MagiskHideProps are not working.

    If you are using MEmu then follow https://xdaforums.com/t/guide-magis...-3-2-or-ldplayer-4-0-45.4222919/post-84574053
    If you are using LDPlayer then follow https://xdaforums.com/t/guide-magis...-3-2-or-ldplayer-4-0-45.4222919/post-84580333

    Reference:-
    -https://xdaforums.com/t/amazing-temp-root-for-mediatek-armv8-2020-08-24.3922213/post-82081703
    -https://github.com/grant-h/qu1ckr00t/blob/master/app/src/main/res/raw/magisk_install

    Credits:-
    @topjohnwu
    @diplomatic

    Enjoy!

    SuperSU
    If you want SuperSU instead of Magisk, then follow below guide
    • Enable Root mode
    • Download SuperSU zip from here
    • Download and install BusyBox from here
    • Download update-binary script from here. We can save this with CTRL + S if using browser in Windows OS
    • In Terminal Emulator run below commands
      Code:
      su
      export PATH=/system/xbin:/system/bin
      cd /sdcard/Download
      sh update-binary 2 1 $PWD/SR5-SuperSU-v2.82-SR5-20171001224502.zip
    • Restart MEmu. Enjoy!

    Credits:-
    @Chainfire

    Xposed
    I have modified youling257's xposed at Github. Since it is not flashable zip by default, we have to do it our own. Made it x86_64 flashable zip like x86 one. Nothing is changed. Just added x86_64 files to x86 system folder after deleting its contents, changed `arch` to x64 and signed.

    We can also install Xposed in MEmu/LDPlayer Android 7.1.2(25) by below

    Reference:-

    Credits:-
    @rovo89
    @youling257
    @Camlin3 for initial thread.

    Enjoy!
    4
    patch ramdisk and kernel
    1. extract kernel and ramdisk from disk1.vmdk (you can use 7zip)
    2. use mkbootimg to make boot.img
    mkbootimg --ramdisk ramdisk --kernel kernel -o boot.img
    3. copy boot.img to MemuDownload
    4. open MEmu install magisk.apk, then patch boot.img
    5. close MEmu copy pacthed.img then extract it with Bootloader (un/re)pack tool
    6. rename the one named ****ramdisk.cpio.gz to ramdisk (without extention)
    7. rename the one named ***zImage** to kernel (also without extention)
    8. now patched ramdisk and kernel is ready

    resizing bootloader partition
    1. install and configure vmware+linux mint(or any linux)
    2. mount disk1.vmdk as second drive in linux vm when prompted select keep format
    3. expand disk1.vmdk size to 2.5GB in vm setting
    (it's easier than editing partition table)
    4. duplicate disk1.vmdk file in windows file explorer (disk1-copy.vmdk)
    5. mount disk1-copy.vmdk as 3rd drive in linux vm (keep format)
    6. boot up Linux VM and install gparted
    7. open gparted select /dev/sdb (it's 2nd drive)
    8. delete sdb6(ext4 system), sdb5(unknown), and sdb4(extended) partition hit apply
    9. resize sdb3(this is bootloader partition) to 16MB hit apply
    10. select unallocated space, create extended partition hit apply
    11. now select another drive /dev/sdc/ and copy sdc5(unknown) paste to /dev/sdb/(2nd Drive)
    12. copy /dev/sdc6(system) paste to /dev/sdb/ then hit apply
    13. you may or may not resize system partition, there's no difference i think
    14. exit gparted. now you can replace ramdisk and kernel file
    (you might have to use root permission to replace those files)

    i know it's all "manual labor" maybe someone could help make script to automize it all

    Which raises another question, whether other emu's will work if one could replace the ramdisk successfully? Is there any file check that prevents booting from a modified ramdisk? Further testing is needed.
    emu works perfectly and magisk installed properly. i don't think there's any file check, at least on MEmu. I tried same method on Nox Player, the emu itself works as intended but magisk doesn't. on Nox player, magisk doesn't detect ramdisk partition. I'll try LDplayer.
    3
    EDIT: Deleting my previous comments for a proper post.
    This is how I managed to get magisk 21.4 over Bluestacks 5 (tested on v5.0.100.2106 - should work on subsequent or previous versions using the same)
    The script file is the same as LDPlayer's instructions with a little modification.

    1) Need to make /system partition writable first.
    For that, you need to go to this directory "%ProgramData%\Bluestacks_nxt\Engine"
    If you're changing this for one of the master instance go to respective folder, Nougat32 for x86 and Nougat64 for the x64 bit android.
    Edit the file Nougatxx.bstk and change type="ReadOnly" to type="Normal" for Root.vdi

    2) Need superuser.
    For this go to "%ProgramData%\Bluestacks_nxt" and edit the file bluestacks.conf present within. Again, remember which instance you're enabling root for. Search for root and look for an entry similar to - bst.instance.Nougat32.enable_root_access="0"
    That entry is for the master instance of Nougat32. Change it's value to 1 and save this file.

    Note: Make sure you made these changes while there were no instances running and no services related to bluestacks were running, if there are please close or kill them via task manager. HD-Player.exe BstkSVC.exe needs to be not running essentially. If not, these changes might revert back.
    Now fire up the emulator and let the instance run. Optional apps you can install - Mixplorer, Terminal

    3) Need to make a file called bootstat.rc for the script to work.
    Head over to /system/etc/init and make a new file within it called bootstat.rc (make sure extension is rc and not txt).
    This directory might not be mounted as rewritable, which you can by either running
    mount -o rw,remount / from terminal or via mixplorer settings, Auto remount
    This file is crucial for magisk to be there when bluestack boots.

    4) You'll also require these files:
    Magisk 21.4 from here - Place it over at /sdcard/init.d/bin/magisk.zip
    Magisk Manager 8.0.7 from here - Install the app
    Script File - Place the run.sh over at any directory like /sdcard/Download
    Bluestacks doesn't work with enforcing selinux and hence needs it to be permissive. The script file changes selinux status once it finishes, by the command setenforce 1 search for it within the script file and change it's value to 0
    Another thing to note is that shell script files only work in UNIX eof. I have already edited the file and provided it here just in case.

    5) Fire up a terminal window and run this code
    Code:
    su
    sh /sdcard/Download/run.sh

    6) Close emulator.
    Edit the bluestacks.conf file once again, disable root access to the instance. Make sure again no bluestacks related services were running.
    That is all. Run Bluestacks once again and fire up magisk app.

    7) Can optionally update busybox after that using the stericson's app.

    Note: If you're making changes to an cloned/non-master instance instead, you'll have to use BStweaker latest version instead. Run BStweaker and choose the instance you want, check it's box and then go to Root tab, click Unlock. This might take a couple seconds to a minute, be patient. Also, this is only necessary for cloned/non-master instance. Bluestacks only creates a cloned/fresh Data.vdi and it's hdd ID hence, any changes to the system partition will all be saved in the master instance instead, defeats the purpose of instances not that they ever thought it'd be getting messed up with.
    BStweaker only works for cloned/non-master instances only, hence it is needed. Using BStweaker, it automatically puts the type to "Normal" so no need to edit manually. Once done, this should make your system partition writable.

    2021-05-24_10h07_57.png
    3
    Magisk v22 for MEmu Emulator

    • Enable Root mode in Settings and Restart MEmu
    • Download and Install Magisk app from here.
    • Install Busybox by using stericson app here
    • Place Magisk.apk as /sdcard/init.d/bin/magisk.apk
    • Extract the run.sh script from below attached zip to any folder like /sdcard/Download
    • Execute the run.sh script. To do this run below commands in Terminal
      Code:
      su
      sh /sdcard/Download/run.sh
    • After executing above, disable Root mode in Settings and Restart MEmu
    • Enjoy!
    3
    @VD171 do u have any ideas?
    srry if i bother u
    couldn't resist myself
    Ah, I made this guide for only SuperUser management in MEmu.
    But it turns into many other things like using Magisk modules, passing SafetyNet etc.,

    I also tried as @VD171 said. Installed Xposed, Magisk and installed HiddenCore but PokenmonGo fails to login.

    I have no idea about these things. Let us wait for someone look into these things.

    Thanks
    I'm not sure. Probably the emulator is beign detected.
    Only XPRIVACYLUA can hides it completely.
    When exactly the app POKEMON GO closes ???
    Beucase I've tried on my device (root magisk + edxposed + xprivacylua + titaniumbackup + luckypatchers + many other root things) and apparentely it is working.
    (I didn't need to enable MAGISK HIDE for that neither XPRIVACYLUA. Only HIDDENCORE-MODULE is acting).
    I am on login screen and it didn't close.

    See screenshot:
    screenshot_2021-02-16-19-31-14-176_com-android-systemui-jpg.5224123