utermux

转载自:https://github.com/termux/termux-packages/issues/7332

简介

由于垃圾谷歌的限制,Termux提供的64位java目前无法在安卓12中正常运行:7332

虽然可以改用32位Termux来解决问题,但是需要卸载重装,原先所有的Termux数据都会丢失。
32位termux下载:https://github.com/termux/termux-packages/files/7985220/termux_arm32_118.apk.zip

修复

保证Termux后台不被杀

#添加架构
dpkg --add-architecture arm
pkg up -y
# 创建并进入deb文件夹
mkdir ~/deb
cd ~/deb

# 下载`openjdk-17:arm`
apt download openjdk-17:arm

# 下载`openjdk-17:arm`的所有依赖
LANG=en LANGUAGE=en apt-cache depends --recurse openjdk-17:arm | grep -E '(Depends|PreDepends|Recommends|Suggests):' | awk '{print $2}' | grep -v '<' | xargs apt download
# 创建并进入termux32文件夹
mkdir ~/../termux32
cd ~/../termux32

# 解压下好的deb
find ~/deb/ -type f | while read f; do dpkg -X "$f" ~/../termux32; done
# 设置一个PREFIX32环境变量
PREFIX32="$(realpath ~/../termux32/data/data/com.termux/files/usr)"

# 为深层目录创建一个符号连接
ln -s "$PREFIX32" ~/../usr32
# 为32位程序创建一个包装器

PREFIX32="$(realpath ~/../usr32)"

cat >"$PREFIX/bin/bin32_wrapper" <<EOF
#!$PREFIX/bin/sh

bin="\$(basename "\$0")"

export PREFIX="$PREFIX32"
export JAVA_HOME="\$PREFIX/opt/openjdk"
export PATH="\$PREFIX/bin:\$JAVA_HOME/bin"
export LD_LIBRARY_PATH="\$PREFIX/lib:\$JAVA_HOME/lib"

exec "\$PREFIX/bin/\$bin" "\$@"
EOF

# 给执行权限
chmod +x "$PREFIX/bin/bin32_wrapper"
扫描二维码,在手机上阅读!
支付宝支付

支付宝支付

评论

icon_question.gificon_razz.gificon_sad.gificon_evil.gificon_exclaim.gificon_smile.gificon_redface.gificon_biggrin.gificon_surprised.gificon_eek.gificon_confused.gificon_cool.gificon_lol.gificon_mad.gificon_twisted.gificon_rolleyes.gificon_wink.gificon_idea.gificon_arrow.gificon_neutral.gificon_cry.gificon_mrgreen.gif

This is just a placeholder img.