newbit1/rootAVD

Script does not work as intended (Windows 10)

bulutg opened this issue · 12 comments

bulutg commented
Screenshot 2023-05-26 at 21 33 01

Nothing happens after sh call
[*] from Magisk by topjohnwu and modded by NewBit XDA

Please add between line 114 and 115 the command set -x

Run the script again and post me the log please.

bulutg commented

Same behavior again :(, Thank you for your help

C:\Users\bul\Documents\GitHub\rootAVD>rootAVD.bat %LOCALAPPDATA%\Android\Sdk\system-images\android-29\polestar_emulator\x86_64\ramdisk.img
[] 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\bul\Documents\GitHub\rootAVD\Magisk.zip: 1 file pushed, 0 skipped. 1052.6 MB/s (11278270 bytes in 0.010s)
[-] Backup exists already
[
] Push ramdisk.img into /data/data/com.android.shell/Magisk
[-] C:\Users\bul\AppData\Local\Android\Sdk\system-images\android-29\polestar_emulator\x86_64\ramdisk.img: 1 file pushed, 0 skipped. 1109.5 MB/s (884032 bytes in 0.001s)
[-] Copy rootAVD Script into Magisk DIR
rootAVD.sh: 1 file pushed, 0 skipped. 159.3 MB/s (78953 bytes in 0.000s)
[-] run the actually Boot/Ramdisk/Kernel Image Patch Script
[*] from Magisk by topjohnwu and modded by NewBit XDA

echo [] from Magisk by topjohnwu and modded by NewBit XDA
set -x
adb shell sh %ADBBASEDIR%/rootAVD.sh %

bulutg commented

I have tried to manually run the script, here is the output:

ihu_emulator:/data/data/com.android.shell/Magisk $ ls
Magisk.zip ramdisk.img rootAVD.sh
ihu_emulator:/data/data/com.android.shell/Magisk $ sh rootAVD.sh
: inaccessible or not found
: inaccessible or not found
'ootAVD.sh[14]: syntax error: unexpected 'in

bulutg commented

Fixed the issue by changing Windows CR LF to UNIX LF

Which one did you change ?
rootavd.sh?
rootavd.bat?

bulutg commented

Which one did you change ? rootavd.sh? rootavd.bat?

rootavd.sh

But this is already in unix format. Did you changed anything in the script and saved it?

bulutg commented

I think I have figured out what is the issue, it depends how I download the project

Download rootAVD via
Click (Downloads Unix sh)
git clone https://github.com/newbit1/rootAVD.git (Downloads Windows CR LF sh)

Thanks, is this git under windows?

Thanks again, for bringing this up to me. It seems to be a "standard" git issue I can take care of.
I will add a .gitattributes file with *.sh text eol=lf
in it, to keep the line ending.

bulutg commented

Thanks, is this git under windows?

Correct

Thanks again, for bringing this up to me. It seems to be a "standard" git issue I can take care of. I will add a .gitattributes file with *.sh text eol=lf in it, to keep the line ending.

Thank you too

Hi @bulutg,
do you mind checking for the line ending now?
My windows git is downloading it already in LF by default, so I can't test the attributes effect.