Skip to content

Commit

Permalink
Merge pull request #7 from HuskyDG/test
Browse files Browse the repository at this point in the history
remove Phoenix OS
  • Loading branch information
HuskyDG authored Jan 5, 2022
2 parents 8165326 + f56242d commit 5d9c223
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 22 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ Integrate Magisk root into Nox Player and other Android x86, emulators
Note: Some features might not work on some emulator, Please read [Emulator that Magisk can work properly](https://github.com/HuskyDG/MagiskOnNox/wiki/Emulator-that-Magisk-can-work-properly) to know which Magisk features doesn't work.

## Requirements
- Android x86 project (BlissOS/PhoenixOS)
- Android x86 project: BlissOS 11 - Android 9
- Phoenix OS is not supported yet
- Android Emulator (NoxPlayer, LDPlayer, ...): [Emulator that Magisk can work properly](https://github.com/HuskyDG/MagiskOnNox/wiki/Emulator-that-Magisk-can-work-properly).
- Android version: 7.1 ~ 9.0 (legacy rootfs)

Expand All @@ -24,7 +25,7 @@ Download from [**Releases** tag](https://github.com/HuskyDG/MagiskOnNox/releases

## Installation

### Install Magisk into system partition
### Install Magisk into system

[Video: How to install Magisk and LSPosed on Nox Player emulator]( https://youtu.be/ZtZQPfZjFuU)

Expand All @@ -47,7 +48,7 @@ It's recommended for Android emulator, as you don't have `ramdisk.img`. Also ext

### Install Magisk into ramdisk (system)

Recommended if you have `ramdisk.img` or you are using **Android x86** project (BlissOS, PhoenixOS)
Recommended if you have `ramdisk.img` or you are using **Android x86** project (BlissOS)

This guide is quite confusing and may not be for the average user

Expand Down
16 changes: 11 additions & 5 deletions README_vi.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Magisk trên giả lập, Android x86
# Magisk On Nox
## Giới thiệu
Triển khai root Magisk trên giả lập Nox (dựa trên [MagiskOnWSA](https://github.com/LSPosed/MagiskOnWSA))


<img src="https://github.com/HuskyDG/MagiskOnNox/raw/main/Screenshot%20(3).png"/>

[Video: Hướng dẫn cài đặt Magisk và LSPosed lên giả lập Nox Player]( https://youtu.be/ZtZQPfZjFuU)

## Tính năng
- Đem các tính năng Magisk/Zygisk lên Android x86
- MagiskHide / MagiskDenyList để ẩn root
Expand All @@ -13,7 +15,9 @@ Triển khai root Magisk trên giả lập Nox (dựa trên [MagiskOnWSA](https:
Lưu ý: Một vài tính năng có thể không hoạt động trên một số giả lập, vui lòng đọc [Giả lập mà Magisk có thể hoạt động chính xác](https://github.com/HuskyDG/MagiskOnNox/wiki/Emulator-that-Magisk-can-work-properly) để biết tính năng của Magisk không hoạt động

## Các yêu cầu

- Android x86 project (BlissOS/PhoenixOS)
- PhoenixOS chưa được hỗ trợ!
- Giả lập Android: [Giả lập mà Magisk có thể hoạt động chính xác](https://github.com/HuskyDG/MagiskOnNox/wiki/Emulator-that-Magisk-can-work-properly)
- Phiên bản Android 7.1 ~ 9.0

Expand All @@ -25,6 +29,8 @@ Tải về trong [tag **Releases**](https://github.com/HuskyDG/MagiskOnNox/relea
### Cài đặt Trực tiếp


Cài đặt Magisk vào system image

<img src="https://github.com/HuskyDG/MagiskOnNox/raw/main/Screenshot%20(3).png">

Cài đặt Magisk vào phân vùng system
Expand All @@ -43,7 +49,7 @@ Khuyến nghị cho trình giả lập Android, vì bạn không có `ramdisk.im

### Vá đĩa ảnh ramdisk

Được đề xuất nếu bạn có `ramdisk.img` hoặc bạn đang sử dụng dự án **Android x86** (BlissOS, PhoenixOS)
Được đề xuất nếu bạn có `ramdisk.img` hoặc bạn đang sử dụng dự án **Android x86** (BlissOS)

Hướng dẫn này khá khó hiểu và có thể không dành cho người dùng bình thường

Expand All @@ -59,11 +65,11 @@ Khuyến nghị cho trình giả lập Android, vì bạn không có `ramdisk.im

2. Nhấn *ALT + F1* để mở root shell và chú ý đến văn bản này (nó có thể giống):
```
Detecting Android x86... found at /dev/<blockname>
Detecting Android-x86... found at /dev/<blockname>
```
<img src = "https://github.com/HuskyDG/MagiskOnNox/raw/main/IMG_20220103_074812.png" />

- Điều đó có nghĩa là **Android x86** đã được cài đặt tại `/dev/<blockname>`
- Điều đó có nghĩa là **Android x86** đã được cài đặt tại `/dev/<blockname> '


3. Nhấn * ALT + F7 * để đóng root shell.
Expand All @@ -88,7 +94,7 @@ Khuyến nghị cho trình giả lập Android, vì bạn không có `ramdisk.im

## Cập nhật Magisk

- Vì Nox và các giả lập thường không có đĩa ảnh boot nên bạn không thể cập nhật trực tiếp, vui lòng cập nhật Magisk bằng **Magisk on Nox**
Vì Nox và các giả lập thường không có đĩa ảnh boot nên bạn không thể cập nhật trực tiếp, vui lòng cập nhật Magisk bằng **Magisk on Nox**

- Nếu bạn cài đặt Magisk vào `ramdisk.img`, bạn có thể sử dụng tùy chọn **Cập nhật nhị phân** để cập nhật **Magisk** mà không cần phải vá lại `ramdisk.img`!

Expand Down
39 changes: 25 additions & 14 deletions libbash.so
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ echo -n "[CHOICE]: "
blissos_open_menu(){


pd none "If you are using PhoenixOS or BlissOS"
pd none "If you are using Android x86 (BlissOS)"
pd none "You can press Alt+F1 and type this command:"


Expand Down Expand Up @@ -151,7 +151,7 @@ pd light_cyan "Install Magisk method"
echo " 1 - Install Magisk into \"/system\""
pd gray " Recommended for Android Emulator (NoxPlayer, MEmu, ...)"
echo " 2 - Install Magisk into ramdisk image (systemless)"
pd gray " Recommended for Android x86 project (Phoenix OS, BlissOS)"
pd gray " Recommended for Android x86 project (BlissOS)"
pd gray " Only compatible with legacy rootfs (Android 9 and below)"
echo " 3 - Update binary (must have Magisk)"
pd gray " Update Magisk without having to modify system/ramdisk again"
Expand Down Expand Up @@ -296,7 +296,7 @@ pd light_cyan "Phương thức cài đặt Magisk"
echo " 1 - Cài đặt Magisk vào \"/system\""
pd gray " Khuyên dùng cho các giả lập Android (NoxPlayer, MEmu, ...)"
echo " 2 - Cài đặt Magisk vào ramdisk.img (systemless)"
pd gray " Khuyên dùng cho Android x86 project (Phoenix OS, BlissOS)"
pd gray " Khuyên dùng cho Android x86 project (BlissOS)"
pd gray " Chỉ tương thích với legacy rootfs (Android 9 trở xuống)"
echo " 3 - Cập nhật nhị phân (phải có Magisk)"
pd gray " Cập nhật Magisk mà không cần phải sửa đổi lại hệ thống hoặc ramdisk.img"
Expand Down Expand Up @@ -448,7 +448,10 @@ p "$1" "$2"; echo


abortc(){
pd "$1" "$2"; exit 1
ERR_CODE="$3"
pd "$1" "$2";
test -z "$ERR_CODE" && ERR_CODE=1
exit "$ERR_CODE"
}

if [ "$AGV1" != "noexec" ]; then
Expand Down Expand Up @@ -521,7 +524,10 @@ MAGISKCORE="$MAGISK_MIRROR/system/etc/magisk"


abort(){
echo "$1" ; exit 1
ERR_CODE="$2"
pd "$1";
test -z "$ERR_CODE" && ERR_CODE=1
exit "$ERR_CODE"
}

link(){ (
Expand Down Expand Up @@ -644,6 +650,13 @@ fi
mount -o rw,remount /
# umount previous /sbin tmpfs overlay
until ! mount | grep -q \" /sbin \"; do
umount -l /sbin
sleep 0.1
done
rm -rf /.backup_sbin
mkdir /.backup_sbin
ln /sbin/* /.backup_sbin
Expand Down Expand Up @@ -671,9 +684,6 @@ cp -af ./magiskboot \$MAGISKBIN/magiskboot
cp -af ./busybox \$MAGISKBIN/busybox
cp -af ./loadpolicy.sh \$MAGISKTMP
xz -d \$MAGISKTMP/*.xz
xz -d \$MAGISKBIN/*.xz
API=\$(getprop ro.build.version.sdk)
ABI=\$(getprop ro.product.cpu.abi)
if [ \"\$ABI\" = \"x86\" ]; then
Expand Down Expand Up @@ -918,7 +928,7 @@ echo "******************************"
rm -rf "$TMPDIR"
mkdir -p "$TMPDIR"

[ ! -f "$APKFILE" ] && abortc light_red "! Magisk APK does not exist"

[ ! -f "$RAMDISK" ] && abortc light_red "! Ramdisk does not exist!"

magisk_loader
Expand All @@ -927,7 +937,7 @@ $bb unzip -oj "$APKFILE" 'assets/util_functions.sh' -d "$TMPDIR" &>/dev/null

MAGISK_VER=""
MAGISK_VER_CODE=""
[ -f "$TMPDIR/util_functions.sh" ] || abort "! This apk is not Magisk app"
[ -f "$TMPDIR/util_functions.sh" ] || abortc light_red "This apk is not Magisk app" 2
( . $TMPDIR/util_functions.sh
pd green "** Magisk version: $MAGISK_VER ($MAGISK_VER_CODE)" )

Expand Down Expand Up @@ -1014,7 +1024,7 @@ $bb unzip -oj "$APKFILE" 'assets/util_functions.sh' -d "$TMPDIR" &>/dev/null

MAGISK_VER=""
MAGISK_VER_CODE=""
[ -f "$TMPDIR/util_functions.sh" ] || abort "! This apk is not Magisk app"
[ -f "$TMPDIR/util_functions.sh" ] || abortc light_red "This apk is not Magisk app" 2
. $TMPDIR/util_functions.sh
pd green "** Magisk version: $MAGISK_VER ($MAGISK_VER_CODE)"

Expand Down Expand Up @@ -1063,7 +1073,7 @@ mkdir $TMPDIR
$bb unzip -oj "$APKFILE" 'assets/util_functions.sh' -d "$TMPDIR" &>/dev/null
MAGISK_VER=""
MAGISK_VER_CODE=""
[ -f "$TMPDIR/util_functions.sh" ] || abort "! This apk is not Magisk app"
[ -f "$TMPDIR/util_functions.sh" ] || abortc light_red "This apk is not Magisk app" 2
. $TMPDIR/util_functions.sh
pd green "** Magisk version: $MAGISK_VER ($MAGISK_VER_CODE)"

Expand Down Expand Up @@ -1199,7 +1209,7 @@ if [ "$VAR_OSROOT" ] && [ "$VAR_RAMDISK" ]; then
mount_disk
( patch_ramdisk "$RAMDISK" "true" )
ERR_CODE=$?
if [ "$ERR_CODE" != "0" ]; then
if [ "$ERR_CODE" == "1" ]; then
table_list
patch_ramdisk "$RAMDISK" "true"
fi
Expand All @@ -1217,7 +1227,7 @@ if [ "$VAR_OSROOT" ] && [ "$VAR_RAMDISK" ]; then
mount_disk
( unpatch_ramdisk "$RAMDISK" "true" )
ERR_CODE=$?
if [ "$ERR_CODE" != "0" ]; then
if [ "$ERR_CODE" == "1" ]; then
table_list
unpatch_ramdisk "$RAMDISK" "true"
fi
Expand Down Expand Up @@ -1283,6 +1293,7 @@ case $build in
p none "> "
read custom_magisk_apk
APKFILE="$custom_magisk_apk"
[ ! -f "$APKFILE" ] && abortc light_red "Magisk APK does not exist"
;;
*)
install_magisk=false
Expand Down

0 comments on commit 5d9c223

Please sign in to comment.