Skip to content

Instantly share code, notes, and snippets.

@shellexy
Last active January 20, 2019 16:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shellexy/b255a0cb424e92ffce7e4a4978c9dd73 to your computer and use it in GitHub Desktop.
Save shellexy/b255a0cb424e92ffce7e4a4978c9dd73 to your computer and use it in GitHub Desktop.
让 LineageOS、Piexl Experience 刷机清除 /data 后继续保持开启 Camera2 API 以便使用谷歌相机,可以将这个文件放入 /system/addon.d/99-enable-camera2-api.sh
#!/sbin/sh
#
# ADDOND_VERSION=2
#
# /system/addon.d/99-enable-camera2-api.sh
# During a upgrade, this script enable Camera2 API on /system/build.prop
#
# 执行命令 adb shell su -c setprop persist.camera.HAL3.enabled 1 后
# 虽然 getprop 能获得 1 但是谷歌相机无法启动,所以还是需要之前的脚本。
# 或者 adb shell su 后执行
# mount -o rw,remount /system ; echo persist.camera.HAL3.enabled=1 >> /system/build.prop ; mount -o ro,remount /system
#
. /tmp/backuptool.functions
case "$1" in
backup)
# Stub
;;
restore)
grep -q persist.camera.HAL3.enabled=1 /system/build.prop || echo persist.camera.HAL3.enabled=1 >> /system/build.prop
;;
pre-backup)
# Stub
;;
post-backup)
# Stub
;;
pre-restore)
# Stub
;;
post-restore)
# Stub
;;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment