Giter Site home page Giter Site logo

Polestar 2 AVD support? about rootavd HOT 12 CLOSED

jgoyvaerts avatar jgoyvaerts commented on August 18, 2024
Polestar 2 AVD support?

from rootavd.

Comments (12)

newbit1 avatar newbit1 commented on August 18, 2024

Hi, no idea, yet.
It seems just the magisk app is installed!
Please post your full log.

from rootavd.

jgoyvaerts avatar jgoyvaerts commented on August 18, 2024
[*] Set Directorys
[-] Test if ADB SHELL is working
[-] ADB connectoin possible
[-] In any AVD via ADB, you can execute code without root in /data/data/com.android.shell
[*] looking for Magisk installer Zip
[*] Cleaning up the ADB working space
[*] Creating the ADB working space
[*] Push Magisk.zip into /data/data/com.android.shell/Magisk
[-] C:\Users\Jonathan\Projects\rootAVD\Magisk.zip: 1 file pushed, 0 skipped. 238.3 MB/s (11278270 bytes in 0.045s)
[*] create Backup File
Access is denied.
[*] Push ramdisk.img into /data/data/com.android.shell/Magisk
[-] c:\temp\sdk\ramdisk.img: 1 file pushed, 0 skipped. 1339.1 MB/s (1344660 bytes in 0.001s)
[-] Copy rootAVD Script into Magisk DIR
rootAVD.sh: 1 file pushed, 0 skipped. 432.6 MB/s (7856319 bytes in 0.017s)
[-] run the actually Boot/Ramdisk/Kernel Image Patch Script
[*] from Magisk by topjohnwu and modded by NewBit XDA
[!] We are in a ranchu emulator shell
[-] Api Level Arch Detect
[-] Device Platform: x64
[-] ARCH32 x86
[-] Device SDK API: 29
[-] First API Level: 28
[-] The AVD runs on Android 10
[-] Switch to the location of the script file
[*] Extracting busybox and Magisk.zip ...
[*] Move busybox from lib to workdir
[-] Checking AVDs Internet connection...
[!] AVD is online
[!] Checking available Magisk Versions
[?] Choose a Magisk Version to install and make it local
[s] (s)how all available Magisk Versions
[1] local stable '25.2' (ENTER)
[2] stable 26.1
[3] canary d0c93842(26101)
[4] alpha 709f25f6-alpha(26101)
1
[-] You choose Magisk local stable Version '25.2'
[*] Re-Run rootAVD in Magisk Busybox STANDALONE (D)ASH
[-] We are now in Magisk Busybox STANDALONE (D)ASH
[*] rootAVD with Magisk '25.2' Installer
[-] Get Flags
[*] System-as-root, keep dm/avb-verity
[-] Encrypted data, keep forceencrypt
[*] RECOVERYMODE=false
[-] KEEPVERITY=true
[*] KEEPFORCEENCRYPT=true
[*] copy x86 files to /data/data/com.android.shell/Magisk/lib/x86_64
[-] copy all x86_64 files from /data/data/com.android.shell/Magisk/lib/x86_64 to /data/data/com.android.shell/Magisk
[*] Detecting ramdisk.img compression
[!] Ramdisk.img uses gzip compression
[-] taken from shakalaca's MagiskOnEmulator/process.sh
[*] executing ramdisk splitting / extraction / repacking
[*] After decompressing ramdisk.img, magiskboot will work
Detected format: [gzip]
[-] Checking ramdisk STATUS=1
[-] Magisk patched boot image detected
[*] Verifying Boot Image by its Kernel Release number:
[-] This AVD = 4.14.112+
[*] repacking back to ramdisk.img format
[!] Rename Magisk.zip to Magisk.apk
[*] Pull ramdiskpatched4AVD.img into ramdisk.img
[-] /data/data/com.android.shell/Magisk/ramdiskpatched4AVD.img: 1 file pulled, 0 skipped. 90.1 MB/s (1344660 bytes in 0.014s
[*] Pull Magisk.apk into
[-] /data/data/com.android.shell/Magisk/Magisk.apk: 1 file pulled, 0 skipped. 197.7 MB/s (11278270 bytes in 0.054s
[-] Clean up the ADB working space
[-] Install all APKs placed in the Apps folder
[*] Trying to install APPS\Magisk.apk
[-] Performing Streamed Install
[-] Success
[-] Shut-Down and Reboot [Cold Boot Now] the AVD and see if it worked
[-] Root and Su with Magisk for Android Studio AVDs
[-] Modded by NewBit XDA - Jan. 2021
[*] Huge Credits and big Thanks to topjohnwu, shakalaca and vvb2060
[-] Trying to shut down the AVD
[!] If the AVD doesnt shut down, try it manually!

from rootavd.

newbit1 avatar newbit1 commented on August 18, 2024

thanks, I have an idea now...
Can your please post the link to that instruction, instead of that screenshot? I cant copy paste the text from it.
never mind, I've got it...

from rootavd.

jgoyvaerts avatar jgoyvaerts commented on August 18, 2024

https://www.polestar.com/nl-be/developer/get-started/

Scroll down to emulator and click try it out

from rootavd.

newbit1 avatar newbit1 commented on August 18, 2024

Ok, I've got it running on the first run.
After the cold boot, you have to switch to user0

adb shell am switch-user 0

you can check which user is active:

newbit@rootAVD % adb shell pm list users
Users:
	UserInfo{0:Owner:13} running
	UserInfo{10:Owner:12}

Now open the Magisk app, and the additional setup is required message pops up.
That's it.

from rootavd.

jgoyvaerts avatar jgoyvaerts commented on August 18, 2024

I can get everything like you, but when opening Magisk, no popup appears. I've tried several times.

What Magisk version are you using?

from rootavd.

jgoyvaerts avatar jgoyvaerts commented on August 18, 2024

Also what AVD version? I'm using the API 29 one

from rootavd.

newbit1 avatar newbit1 commented on August 18, 2024

samesame. API 29, Magisk 25.2 and 26.1 with the FAKEBOOTIMG argument.
Here are my logs:
Magisk 25.2

newbit@rootAVD % ./rootAVD.sh ~/Library/Android/sdk/system-images/android-29/polestar_emulator/x86_64/ramdisk.img
[!] and we are NOT in an emulator shell
[*] Set Directorys
[-] Test if ADB SHELL is working
[-] In any AVD via ADB, you can execute code without root in /data/data/com.android.shell
[*] Cleaning up the ADB working space
[*] Creating the ADB working space
[-] Magisk installer Zip exists already
[*] Push Magisk.zip into /data/data/com.android.shell/Magisk
[-] ./Magisk.zip: 1 file pushed, 0 skipped. 204.8 MB/s (11278270 bytes in 0.053s)
[*] create Backup File of ramdisk.img
[*] Push ramdisk.img into /data/data/com.android.shell/Magisk/ramdisk.img
[-] /Users/newbit/Library/Android/sdk/system-images/android-29/polestar_emulator/x86_64/ramdisk.img: 1 file pushed, 0 skipped. 115.7 MB/s (884032 bytes in 0.007s)
[*] Push rootAVD.sh into /data/data/com.android.shell/Magisk
[-] rootAVD.sh: 1 file pushed, 0 skipped. 190.9 MB/s (7856319 bytes in 0.039s)
[-] run the actually Boot/Ramdisk/Kernel Image Patch Script
[*] from Magisk by topjohnwu and modded by NewBit XDA
[!] We are in a ranchu emulator shell
[-] Api Level Arch Detect
[-] Device Platform: x64
[-] ARCH32 x86
[-] Device SDK API: 29
[-] First API Level: 28
[-] The AVD runs on Android 10
[-] Switch to the location of the script file
[*] Extracting busybox and Magisk.zip ...
[*] Move busybox from lib to workdir
[-] Checking AVDs Internet connection...
[!] AVD is online
[!] Checking available Magisk Versions
[?] Choose a Magisk Version to install and make it local
[s] (s)how all available Magisk Versions
[1] local stable '25.2' (ENTER)
[2] stable 26.1
[3] canary d0c93842(26101)
[4] alpha 709f25f6-alpha(26101)

[-] You choose Magisk local stable Version '25.2'
[*] Re-Run rootAVD in Magisk Busybox STANDALONE (D)ASH
[-] We are now in Magisk Busybox STANDALONE (D)ASH
[*] rootAVD with Magisk '25.2' Installer
[-] Get Flags
[*] System-as-root, keep dm/avb-verity
[-] Encrypted data, keep forceencrypt
[*] RECOVERYMODE=false
[-] KEEPVERITY=true
[*] KEEPFORCEENCRYPT=true
[*] copy x86 files to /data/data/com.android.shell/Magisk/lib/x86_64
[-] copy all x86_64 files from /data/data/com.android.shell/Magisk/lib/x86_64 to /data/data/com.android.shell/Magisk
[*] Detecting ramdisk.img compression
[!] Ramdisk.img uses gzip compression
[-] taken from shakalaca's MagiskOnEmulator/process.sh
[*] executing ramdisk splitting / extraction / repacking
[*] After decompressing ramdisk.img, magiskboot will work
Detected format: [gzip]
[-] Checking ramdisk STATUS=0
[-] Stock boot image detected
[*] Verifying Boot Image by its Kernel Release number:
[-] This AVD = 4.14.112+
[-] Patching ramdisk
[*] adding overlay.d/sbin folders to ramdisk
Loading cpio: [ramdisk.cpio]
Create directory [overlay.d] (0750)
Create directory [overlay.d/sbin] (0750)
Dump cpio: [ramdisk.cpio]
[!] patching the ramdisk with Magisk Init
Loading cpio: [ramdisk.cpio]
Add entry [init] (0750)
Add entry [overlay.d/sbin/magisk32.xz] (0644)
Add entry [overlay.d/sbin/magisk64.xz] (0644)
Patch with flag KEEPVERITY=[true] KEEPFORCEENCRYPT=[true]
Loading cpio: [ramdisk.cpio.orig]
Backup mismatch entry: [init] -> [.backup/init]
Record new entry: [overlay.d] -> [.backup/.rmlist]
Record new entry: [overlay.d/sbin] -> [.backup/.rmlist]
Record new entry: [overlay.d/sbin/magisk32.xz] -> [.backup/.rmlist]
Record new entry: [overlay.d/sbin/magisk64.xz] -> [.backup/.rmlist]
Create directory [.backup] (0000)
Add entry [.backup/.magisk] (0000)
Dump cpio: [ramdisk.cpio]
[*] repacking back to ramdisk.img format
[!] Rename Magisk.zip to Magisk.apk
[*] Pull ramdiskpatched4AVD.img into ramdisk.img
[-] /data/data/com.android.shell/Magisk/ramdiskpatched4AVD.img: 1 file pulled, 0 skipped. 276.7 MB/s (1344660 bytes in 0.005s)
[*] Pull Magisk.apk into 
[-] /data/data/com.android.shell/Magisk/Magisk.apk: 1 file pulled, 0 skipped. 439.5 MB/s (11278270 bytes in 0.024s)
[-] Clean up the ADB working space
[-] Install all APKs placed in the Apps folder
[*] Trying to install Apps/Magisk.apk
[*] Performing Streamed Install
[*] Success
[-] Shut-Down & Reboot (Cold Boot Now) the AVD and see if it worked
[-] Root and Su with Magisk for Android Studio AVDs
[-] Trying to shut down the AVD
[!] If the AVD doesn't shut down, try it manually!
[-] Modded by NewBit XDA - Jan. 2021
[!] Huge Credits and big Thanks to topjohnwu, shakalaca, vvb2060 and HuskyDG
newbit@rootAVD % adb shell am switch-user 0

Magisk 26.1

newbit@rootAVD % ./rootAVD.sh ~/Library/Android/sdk/system-images/android-29/polestar_emulator/x86_64/ramdisk.img FAKEBOOTIMG
[!] and we are NOT in an emulator shell
[*] Set Directorys
[-] Test if ADB SHELL is working
[-] In any AVD via ADB, you can execute code without root in /data/data/com.android.shell
[*] Cleaning up the ADB working space
[*] Creating the ADB working space
[-] Magisk installer Zip exists already
[*] Push Magisk.zip into /data/data/com.android.shell/Magisk
[-] ./Magisk.zip: 1 file pushed, 0 skipped. 477.2 MB/s (11411692 bytes in 0.023s)
[-] ramdisk.img Backup exists already
[*] Push ramdisk.img into /data/data/com.android.shell/Magisk/ramdisk.img
[-] /Users/newbit/Library/Android/sdk/system-images/android-29/polestar_emulator/x86_64/ramdisk.img: 1 file pushed, 0 skipped. 1730.8 MB/s (884032 bytes in 0.000s)
[*] Push rootAVD.sh into /data/data/com.android.shell/Magisk
[-] rootAVD.sh: 1 file pushed, 0 skipped. 693.7 MB/s (7856319 bytes in 0.011s)
[-] run the actually Boot/Ramdisk/Kernel Image Patch Script
[*] from Magisk by topjohnwu and modded by NewBit XDA
[!] We are in a ranchu emulator shell
[-] Api Level Arch Detect
[-] Device Platform: x64
[-] ARCH32 x86
[-] Device SDK API: 29
[-] First API Level: 28
[-] The AVD runs on Android 10
[-] Switch to the location of the script file
[*] Extracting busybox and Magisk.zip ...
[*] Move busybox from lib to workdir
[-] Checking AVDs Internet connection...
[!] AVD is online
[!] Checking available Magisk Versions
[?] Choose a Magisk Version to install and make it local
[s] (s)how all available Magisk Versions
[1] local stable '26.1' (ENTER)
[2] stable 26.1
[3] canary d0c93842(26101)
[4] alpha 709f25f6-alpha(26101)

[-] You choose Magisk local stable Version '26.1'
[*] Re-Run rootAVD in Magisk Busybox STANDALONE (D)ASH
[-] We are now in Magisk Busybox STANDALONE (D)ASH
[*] rootAVD with Magisk '26.1' Installer
[-] Get Flags
[*] System-as-root, keep dm/avb-verity
[-] Encrypted data, keep forceencrypt
[*] RECOVERYMODE=false
[-] KEEPVERITY=true
[*] KEEPFORCEENCRYPT=true
[*] copy x86 files to /data/data/com.android.shell/Magisk/lib/x86_64
[-] copy all x86_64 files from /data/data/com.android.shell/Magisk/lib/x86_64 to /data/data/com.android.shell/Magisk
[-] copy 'stub.apk' from /data/data/com.android.shell/Magisk/assets to /data/data/com.android.shell/Magisk
[*] Detecting ramdisk.img compression
[!] Ramdisk.img uses gzip compression
[-] taken from shakalaca's MagiskOnEmulator/process.sh
[*] executing ramdisk splitting / extraction / repacking
[*] After decompressing ramdisk.img, magiskboot will work
Detected format: [gzip]
[*] Processing fake Boot.img
[*] Creating a fake Boot.img
[-] removing old /sdcard/Download/fakeboot.img
[!] Only a minimal header is required for Magisk to repack the ramdisk
[*] repacking ramdisk.img into /sdcard/Download/fakeboot.img
[!] Temporarily installing Magisk
[-] Starting Magisk
[*] Install/Patch /sdcard/Download/fakeboot.img and hit Enter when done(max. 60s)

[!] Removing Temporarily installed Magisk
[!] magisk_patched file(s) could be found!
[*] unpacking latest /sdcard/Download/magisk_patched-26100_g7lfd.img
[-] deleting all magisk_patched files
[-] Checking ramdisk STATUS=1
[-] Magisk patched boot image detected
[*] Verifying Boot Image by its Kernel Release number:
[-] This AVD = 4.14.112+
[*] repacking back to ramdisk.img format
[!] Rename Magisk.zip to Magisk.apk
[*] Pull ramdiskpatched4AVD.img into ramdisk.img
[-] /data/data/com.android.shell/Magisk/ramdiskpatched4AVD.img: 1 file pulled, 0 skipped. 387.7 MB/s (1410471 bytes in 0.003s)
[*] Pull Magisk.apk into 
[-] /data/data/com.android.shell/Magisk/Magisk.apk: 1 file pulled, 0 skipped. 470.8 MB/s (11411692 bytes in 0.023s)
[-] Clean up the ADB working space
[-] Install all APKs placed in the Apps folder
[*] Trying to install Apps/Magisk.apk
[*] Performing Streamed Install
[*] Success
[*] Trying to install Apps/X-plore File Manager_4.30.26_Apkpure.apk
[*] Performing Streamed Install
[*] Success
[-] Shut-Down & Reboot (Cold Boot Now) the AVD and see if it worked
[-] Root and Su with Magisk for Android Studio AVDs
[-] Trying to shut down the AVD
[!] If the AVD doesn't shut down, try it manually!
[-] Modded by NewBit XDA - Jan. 2021
[!] Huge Credits and big Thanks to topjohnwu, shakalaca, vvb2060 and HuskyDG

I am updating the script right now for the FAKEBOOTIMG, so that If the script detects user 10, it switches to user 0.
Makes it easier to see the /sdcard/Download/fakeboot.img file.
Also I am adding a Magisk module to remove all users except user 0.

from rootavd.

jgoyvaerts avatar jgoyvaerts commented on August 18, 2024

Got it working now by running the script as root.
Problem was that the ramdisk.img was in program files and the .bat didn't have access to it apparently.

Maybe an improvement to test if patching the ramdisk actually worked and fail with an error if not?

Thanks for the help!

from rootavd.

newbit1 avatar newbit1 commented on August 18, 2024

You dont have to run the script as root.
Copy your ramdisk.img to a place where the script can read and write it..
Yes good idea, I will see what I can do. But I am not writing anymore so much
on the windows version...

from rootavd.

flazouh avatar flazouh commented on August 18, 2024

Hi I don't get the popup when trying to install on my emulator :

[!] and we are NOT in an emulator shell
[*] Set Directorys
[-] source.properties file exist
[*] AVD system-image Pkg.Revision=7
[-] Test if ADB SHELL is working
[*] ADB connection possible
[-] In any AVD via ADB, you can execute code without root in /data/data/com.android.shell
[*] Cleaning up the ADB working space
[*] Creating the ADB working space
[-] Magisk installer Zip exists already
[*] Push Magisk.zip into /data/data/com.android.shell/Magisk
[-] ./Magisk.zip: 1 file pushed, 0 skipped. 311.8 MB/s (11278270 bytes in 0.035s)
[-] ramdisk.img Backup exists already
[*] Push ramdisk.img into /data/data/com.android.shell/Magisk/ramdisk.img
[-] /Users/alex/Library/Android/sdk/system-images/android-34/google_apis_playstore/arm64-v8a/ramdisk.img: 1 file pushed, 0 skipped. 567.5 MB/s (1941988 bytes in 0.003s)
[*] Push rootAVD.sh into /data/data/com.android.shell/Magisk
[-] rootAVD.sh: 1 file pushed, 0 skipped. 833.0 MB/s (79634 bytes in 0.000s)
[-] run the actually Boot/Ramdisk/Kernel Image Patch Script
[*] from Magisk by topjohnwu and modded by NewBit XDA
[!] We are in a ranchu emulator shell
[-] Api Level Arch Detect
[-] Device Platform is arm64 only
[-] Device SDK API: 25
[-] First API Level:
[-] The AVD runs on Android 7.1.1
[-] Switch to the location of the script file
[*] Looking for an unzip binary
[-] No unzip binary found
[*] Searching for pre installed Magisk Apps
[!] Found a pre installed Magisk App, use it
[*] Copy Magisk Lib Files to workdir
[*] Finding a working Busybox Version
[*] Testing Busybox /data/data/com.android.shell/Magisk/lib/arm64/libbusybox.so
[!] Found a working Busybox Version
[!] BusyBox v1.34.1-Magisk (2022-03-22 04:11:29 PDT) multi-call binary.
[*] Copy busybox from lib to workdir
[*] Extracting Magisk.zip via Busybox ...
[*] Move busybox from lib to workdir
[-] Checking AVDs Internet connection...
[!] AVD is online
[!] Checking available Magisk Versions
[?] Choose a Magisk Version to install and make it local
[s] (s)how all available Magisk Versions
[1] local stable '25.2' (ENTER)
[2] stable 26.1
[3] canary d390ca2f(26104)
[4] alpha 46770db1-alpha(26103)
[-] You choose Magisk local stable Version '25.2'
[*] Re-Run rootAVD in Magisk Busybox STANDALONE (D)ASH
[-] We are now in Magisk Busybox STANDALONE (D)ASH
[*] rootAVD with Magisk '25.2' Installer
[-] Get Flags
[*] RECOVERYMODE=false
[-] KEEPVERITY=false
[*] KEEPFORCEENCRYPT=false
[-] copy all arm64-v8a files from /data/data/com.android.shell/Magisk/lib/arm64-v8a to /data/data/com.android.shell/Magisk
[*] Detecting ramdisk.img compression
[!] Ramdisk.img uses lz4_legacy compression
[-] taken from shakalaca's MagiskOnEmulator/process.sh
[*] executing ramdisk splitting / extraction / repacking
[*] After decompressing ramdisk.img, magiskboot will work
Detected format: [lz4_legacy]
[-] Checking ramdisk STATUS=1
[-] Magisk patched boot image detected
[*] Verifying Boot Image by its Kernel Release number:
[-] This AVD = 3.18.91+
[-]  Ramdisk = 6.1.23-android14-4-00257-g7e35917775b8-ab9964412
[!] Ramdisk is probably NOT from this AVD
[*] repacking back to ramdisk.img format
[!] Rename Magisk.zip to Magisk.apk
[*] Pull ramdiskpatched4AVD.img into ramdisk.img
[-] /data/data/com.android.shell/Magisk/ramdiskpatched4AVD.img: 1 file pulled, 0 skipped. 317.0 MB/s (1941988 bytes in 0.006s)
[*] Pull Magisk.apk into
[-] /data/data/com.android.shell/Magisk/Magisk.apk: 1 file pulled, 0 skipped. 367.2 MB/s (11278270 bytes in 0.029s)
[-] Clean up the ADB working space
[-] Install all APKs placed in the Apps folder
[*] Trying to install Apps/Magisk.apk
[*] Performing Streamed Install
[*] Success
[-] Shut-Down & Reboot (Cold Boot Now) the AVD and see if it worked
[-] Root and Su with Magisk for Android Studio AVDs
[-] Trying to shut down the AVD
[!] If the AVD doesn't shut down, try it manually!
[-] Modded by NewBit XDA - Jan. 2021
[!] Huge Credits and big Thanks to topjohnwu, shakalaca, vvb2060 and HuskyDG
(base)
Screenshot 2023-07-26 at 03 45 57

Can you help making this work ?

from rootavd.

newbit1 avatar newbit1 commented on August 18, 2024

Hi did you invoke the script?

[-] Checking ramdisk STATUS=1
[-] Magisk patched boot image detected
[*] Verifying Boot Image by its Kernel Release number:
[-] This AVD = 3.18.91+
[-]  Ramdisk = 6.1.23-android14-4-00257-g7e35917775b8-ab9964412
[!] Ramdisk is probably NOT from this AVD

Looks like you are mixing up two different AVDs.
Also it seems, the ramdisk is already patched.
Try to restore the ramdisk and use the one from the AVD which is running.

from rootavd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.