业务需要大量模拟器场景进行测试,单纯的在windows开模拟器不现实,本想着拉取AOSP源码进行编译然后制作镜像,后来发现开源redroid有现成镜像,于是拿来直接使用并在debian11下成功实现多开
系统版本:debian11
内核:5.10.0-26-amd64
docker 24.0.7
测试结论:需要在宿主机上配置binder或BinderFS即可。注意直接用k8s可以直接测通。如果你有自己的构建机以及统一维护的发布系统可以使用这套。(测试通过)
测试结论:新物理机 配置docker、binder或BinderFS就可使用。轻量级适合独立维护。(测试通过)
20240301更新
宿主机如果没有开启网桥,会造成设备无法链接问题。
sudo modprobe binder_linux devices
=
binder1,binder2,binder3,binder4,binder5,binder6
chmod
666
/
dev
/
binder
*
sudo modprobe binder_linux devices
=
binder1,binder2,binder3,binder4,binder5,binder6
chmod
666
/
dev
/
binder
*
sudo apt
-
get update
sudo apt
-
get install build
-
essential libncurses5
-
dev flex bison libssl
-
dev libelf
-
dev bc
sudo apt
-
get source linux
-
source
cd linux
-
*
make menuconfig
CONFIG_ANDROID_BINDER_IPC
=
y
CONFIG_ANDROID_BINDERFS
=
y
CONFIG_ANDROID_BINDER_DEVICES
=
"binder,hwbinder,vndbinder"
CONFIG_ANDROID_BINDER_IPC_SELFTEST
=
y
make
-
j$(nproc)
sudo make modules_install
sudo make install
sudo reboot
sudo apt
-
get update
sudo apt
-
get install build
-
essential libncurses5
-
dev flex bison libssl
-
dev libelf
-
dev bc
sudo apt
-
get source linux
-
source
cd linux
-
*
make menuconfig
CONFIG_ANDROID_BINDER_IPC
=
y
CONFIG_ANDROID_BINDERFS
=
y
CONFIG_ANDROID_BINDER_DEVICES
=
"binder,hwbinder,vndbinder"
CONFIG_ANDROID_BINDER_IPC_SELFTEST
=
y
make
-
j$(nproc)
sudo make modules_install
sudo make install
sudo reboot
mkdir ~
/
MagiskOnRedroid
cd ~
/
MagiskOnRedroid
find
-
maxdepth
1
-
iname
"magisk*"
-
not
-
name
"*.apk"
-
exec
rm
-
r {} \;
magisk_file
=
"app-debug.apk"
if
[ !
-
f $magisk_file ]; then
wget
"https://cdn.jsdelivr.net/gh/topjohnwu/magisk-files@1cea72840fbf690f9a95512d03721f6a710fe02e/app-debug.apk"
fi
unzip
-
j $magisk_file
"lib/x86_64/libmagisk64.so"
-
d magisk
unzip
-
j $magisk_file
"lib/x86_64/libbusybox.so"
-
d magisk
mv
-
v magisk
/
libmagisk64.so magisk
/
magisk
mv
-
v magisk
/
libbusybox.so magisk
/
busybo
tar
-
-
transform
's/.*\///g'
-
cf ~
/
magisk.tar
-
-
absolute
-
names $( find ~
/
MagiskOnRedroid | grep
-
E
"magisk/|app-debug.apk$"
)
mkdir ~
/
MagiskOnRedroid
cd ~
/
MagiskOnRedroid
find
-
maxdepth
1
-
iname
"magisk*"
-
not
-
name
"*.apk"
-
exec
rm
-
r {} \;
magisk_file
=
"app-debug.apk"
if
[ !
-
f $magisk_file ]; then
wget
"https://cdn.jsdelivr.net/gh/topjohnwu/magisk-files@1cea72840fbf690f9a95512d03721f6a710fe02e/app-debug.apk"
fi
unzip
-
j $magisk_file
"lib/x86_64/libmagisk64.so"
-
d magisk
unzip
-
j $magisk_file
"lib/x86_64/libbusybox.so"
-
d magisk
mv
-
v magisk
/
libmagisk64.so magisk
/
magisk
mv
-
v magisk
/
libbusybox.so magisk
/
busybo
tar
-
-
transform
's/.*\///g'
-
cf ~
/
magisk.tar
-
-
absolute
-
names $( find ~
/
MagiskOnRedroid | grep
-
E
"magisk/|app-debug.apk$"
)
cat <<\EOF > ~
/
remove.rc
on early
-
init
export PATH
/
sbin:
/
product
/
bin
:
/
apex
/
com.android.runtime
/
bin
:
/
apex
/
com.android.art
/
bin
:
/
system_ext
/
bin
:
/
system
/
bin
:
/
system
/
xbin:
/
odm
/
bin
:
/
vendor
/
bin
:
/
vendor
/
xbin
chmod
0700
/
magisk.tar
chown root root
/
magisk.tar
chmod
0700
/
setup.sh
chown root root
/
setup.sh
exec
root root
-
-
/
setup.sh
service magisk
-
d
/
sbin
/
magisk
-
-
daemon
user root
oneshot
on boot
start magisk
-
d
on post
-
fs
-
data
start logd
rm
/
dev
/
.magisk
-
unblock
start s1
wait
/
dev
/
.magisk
-
unblock
5
rm
/
dev
/
.magisk
-
unblock
service s1
/
sbin
/
magisk
-
-
post
-
fs
-
data
user root
oneshot
service s2
/
sbin
/
magisk
-
-
service
class
late_start
user root
oneshot
on
property
:sys.boot_completed
=
1
exec
/
sbin
/
magisk
-
-
boot
-
complete
on
property
:init.svc.zygote
=
restarting
exec
/
sbin
/
magisk
-
-
zygote
-
restart
on
property
:init.svc.zygote
=
stopped
exec
/
sbin
/
magisk
-
-
zygote
-
restart
EOF
sudo chmod
644
~
/
remove.rc
sudo chown root:root ~
/
remove.rc
cat <<\EOF > ~
/
remove.rc
on early
-
init
export PATH
/
sbin:
/
product
/
bin
:
/
apex
/
com.android.runtime
/
bin
:
/
apex
/
com.android.art
/
bin
:
/
system_ext
/
bin
:
/
system
/
bin
:
/
system
/
xbin:
/
odm
/
bin
:
/
vendor
/
bin
:
/
vendor
/
xbin
chmod
0700
/
magisk.tar
chown root root
/
magisk.tar
chmod
0700
/
setup.sh
chown root root
/
setup.sh
exec
root root
-
-
/
setup.sh
service magisk
-
d
/
sbin
/
magisk
-
-
daemon
user root
oneshot
on boot
start magisk
-
d
on post
-
fs
-
data
start logd
rm
/
dev
/
.magisk
-
unblock
start s1
wait
/
dev
/
.magisk
-
unblock
5
rm
/
dev
/
.magisk
-
unblock
service s1
/
sbin
/
magisk
-
-
post
-
fs
-
data
user root
oneshot
service s2
/
sbin
/
magisk
-
-
service
class
late_start
user root
oneshot
on
property
:sys.boot_completed
=
1
exec
/
sbin
/
magisk
-
-
boot
-
complete
on
property
:init.svc.zygote
=
restarting
exec
/
sbin
/
magisk
-
-
zygote
-
restart
on
property
:init.svc.zygote
=
stopped
exec
/
sbin
/
magisk
-
-
zygote
-
restart
EOF
sudo chmod
644
~
/
remove.rc
sudo chown root:root ~
/
remove.rc
cat <<\EOF > ~
/
setup.sh
tmpPushed
=
/
magisk
rm
-
rf $tmpPushed
mkdir $tmpPushed
tar
-
xvf
/
magisk.tar
-
-
no
-
same
-
owner
-
C $tmpPushed
umount
/
magisk.tar ; rm
-
v
/
magisk.tar
mkdir
/
sbin
chown root:root
/
sbin
chmod
0751
/
sbin
cp $tmpPushed
/
magisk
/
sbin
/
cp $tmpPushed
/
app
-
debug.apk
/
sbin
/
stub.apk
find
/
sbin
-
type
f
-
exec
chmod
0755
{} \;
find
/
sbin
-
type
f
-
exec
chown root:root {} \;
ln
-
f
-
s
/
sbin
/
magisk
/
system
/
xbin
/
su
mkdir
/
product
/
bin
chmod
751
/
product
/
bin
ln
-
f
-
s
/
sbin
/
magisk
/
product
/
bin
/
su
mkdir
-
p
/
data
/
adb
/
magisk
chmod
700
/
data
/
adb
mv $tmpPushed
/
busybox
/
data
/
adb
/
magisk
/
chmod
-
R
755
/
data
/
adb
/
magisk
chmod
-
R root:root
/
data
/
adb
/
magisk
EOF
sudo chmod
700
~
/
setup.sh
sudo chown root:root ~
/
setup.sh
cat <<\EOF > ~
/
setup.sh
tmpPushed
=
/
magisk
rm
-
rf $tmpPushed
mkdir $tmpPushed
tar
-
xvf
/
magisk.tar
-
-
no
-
same
-
owner
-
C $tmpPushed
umount
/
magisk.tar ; rm
-
v
/
magisk.tar
mkdir
/
sbin
chown root:root
/
sbin
chmod
0751
/
sbin
cp $tmpPushed
/
magisk
/
sbin
/
cp $tmpPushed
/
app
-
debug.apk
/
sbin
/
stub.apk
find
/
sbin
-
type
f
-
exec
chmod
0755
{} \;
find
/
sbin
-
type
f
-
exec
chown root:root {} \;
ln
-
f
-
s
/
sbin
/
magisk
/
system
/
xbin
/
su
mkdir
/
product
/
bin
chmod
751
/
product
/
bin
ln
-
f
-
s
/
sbin
/
magisk
/
product
/
bin
/
su
mkdir
-
p
/
data
/
adb
/
magisk
chmod
700
/
data
/
adb
mv $tmpPushed
/
busybox
/
data
/
adb
/
magisk
/
chmod
-
R
755
/
data
/
adb
/
magisk
[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)
最后于 2024-3-1 17:47
被XJ。编辑
,原因: