land: Releasetool extension to remove fp blobs

This commit is contained in:
karthick111 2017-07-28 14:04:15 +02:00 committed by Darshan Manjrekar
parent 7dcacc8fa3
commit 8ee9910310
5 changed files with 63 additions and 1 deletions

2
board/releasetools.mk Normal file
View file

@ -0,0 +1,2 @@
# Releasetools
TARGET_RELEASETOOLS_EXTENSIONS := device/xiaomi/land

27
configs/check_features.sh Executable file
View file

@ -0,0 +1,27 @@
#!/sbin/sh
board_id="";
for e in $(cat /proc/cmdline);
do
tmp=$(echo $e | grep "board_id" > /dev/null);
if [ "0" == "$?" ]; then
board_id=$(echo $e |cut -d":" -f0 |cut -d"=" -f2);
fi
done
if [ "$board_id" = "S88537AC1" ]; || [ "$board_id" = "S88537EC1"]; then
# Redmi 3S Don't have FP
rm /firmware/image/fpc*
rm /firmware/image/goodix*
rm /system/bin/fingerprintd
rm /system/bin/gx_fpcmd
rm /system/bin/gx_fpd
rm /system/etc/permissions/android.hardware.fingerprint.xml
rm /system/lib/hw/fingerprint.msm8937.so
rm /system/lib/libcom_fingerprints_service.so
rm /system/lib64/hw/fingerprint.msm8937.so
rm /system/lib64/hw/fingerprint.goodix.so
rm /system/lib64/hw/gxfingerprint.default.so
rm /system/lib64/libcom_fingerprints_service.so
rm /system/lib64/libfp_client.so
rm /system/lib64/libfpservice.so
fi

View file

@ -5,3 +5,7 @@ PRODUCT_PACKAGES += \
# Permissions
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.fingerprint.xml:system/etc/permissions/android.hardware.fingerprint.xml
# Non-fp patch
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/configs/check_features.sh:install/bin/check_features.sh

29
releasetools.py Executable file
View file

@ -0,0 +1,29 @@
# Copyright (C) 2016 The CyanogenMod Project
# Copyright (C) 2017 The LineageOS Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
def IncrementalOTA_InstallEnd(info):
ReplaceDeviceConfig(info)
def FullOTA_InstallEnd(info):
ReplaceDeviceConfig(info)
def ReplaceDeviceConfig(info):
info.script.Mount("/firmware")
info.script.Mount("/system")
info.script.AppendExtra('ui_print("Checking FP support");')
info.script.AppendExtra('run_program("/sbin/sh", "/tmp/install/bin/check_features.sh");')
info.script.Unmount("/firmware")
info.script.Unmount("/system")