Last active
September 19, 2024 04:16
-
-
Save natsumerinchan/b7a44acadfa66d0e07ead299423695c4 to your computer and use it in GitHub Desktop.
Extract libhoudini from WSA.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
@rem Set variables | |
set "TMP_PATH=/data/local/tmp" | |
set "WSA_PORT=127.0.0.1:58526" | |
@rem Check whether platform-tools is exist or not | |
adb devices >nul | |
if not %errorlevel% == 0 ( | |
cls | |
echo [ERROR] It seems that adb is not exist! | |
goto EXIT1 | |
) | |
@rem Check whether WSA is online or not | |
adb connect %WSA_PORT% >nul | |
adb -s %WSA_PORT% shell echo Hello World! >nul | |
if not %errorlevel% == 0 ( | |
cls | |
adb devices | |
echo [ERROR] It seems that WSA is not running! | |
goto EXIT1 | |
) | |
echo [INFO] Connected to WSA %WSA_PORT% | |
@rem Check whether root access is exist or not | |
echo [INFO] Checking root access | |
adb -s %WSA_PORT% shell su -c echo Hello World! >nul | |
if not %errorlevel% == 0 ( | |
echo [ERROR] You don't have root access! | |
goto EXIT0 | |
) | |
echo [INFO] Success! | |
@rem Create Folders | |
adb -s %WSA_PORT% shell mkdir -p %TMP_PATH%/libhoudini/system/bin | |
adb -s %WSA_PORT% shell mkdir -p %TMP_PATH%/libhoudini/system/lib | |
adb -s %WSA_PORT% shell mkdir -p %TMP_PATH%/libhoudini/system/lib64 | |
@rem Copy files to /data/local/tmp | |
echo [INFO] Extracting libhoudini...... | |
adb -s %WSA_PORT% shell su -c cp -r /vendor/bin/houdini %TMP_PATH%/libhoudini/system/bin | |
adb -s %WSA_PORT% shell su -c cp -r /vendor/bin/houdini64 %TMP_PATH%/libhoudini/system/bin | |
adb -s %WSA_PORT% shell su -c cp -r /vendor/bin/arm %TMP_PATH%/libhoudini/system/bin | |
adb -s %WSA_PORT% shell su -c cp -r /vendor/bin/arm64 %TMP_PATH%/libhoudini/system/bin | |
adb -s %WSA_PORT% shell su -c cp -r /vendor/lib/arm %TMP_PATH%/libhoudini/system/lib | |
adb -s %WSA_PORT% shell su -c cp -r /vendor/lib/libhoudini.so %TMP_PATH%/libhoudini/system/lib | |
adb -s %WSA_PORT% shell su -c cp -r /vendor/lib64/arm64 %TMP_PATH%/libhoudini/system/lib64 | |
adb -s %WSA_PORT% shell su -c cp -r /vendor/lib64/libhoudini.so %TMP_PATH%/libhoudini/system/lib64 | |
adb -s %WSA_PORT% shell su -c chmod -R -f 777 "%TMP_PATH%/libhoudini" | |
@rem Moving files to the Windows desktop | |
adb -s %WSA_PORT% pull "%TMP_PATH%/libhoudini" "%USERPROFILE%\Desktop\libhoudini" | |
adb -s %WSA_PORT% shell su -c rm -rf "%TMP_PATH%/libhoudini" | |
@rem Create version file | |
adb -s %WSA_PORT% shell su -c houdini --version >%USERPROFILE%\Desktop\libhoudini\VERSION | |
adb -s %WSA_PORT% shell su -c houdini64 --version >>%USERPROFILE%\Desktop\libhoudini\VERSION | |
echo [INFO] Already extracted to the desktop: %USERPROFILE%\Desktop\libhoudini | |
:EXIT0 | |
adb disconnect %WSA_PORT% >nul | |
echo [INFO] Disconnected WSA %WSA_PORT% | |
:EXIT1 | |
pause |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment