Compare commits

..

4 Commits

Author SHA1 Message Date
Pierre-Hugues Husson
e42554da1d Still detect moto on pie. Separate sound changes between pie vendor and previous 2019-03-01 00:01:52 +01:00
Pierre-Hugues Husson
bef5741bde typo 2019-02-28 23:48:32 +01:00
Pierre-Hugues Husson
2a1b5b7e11 force effects change 2019-02-28 23:35:47 +01:00
Pierre-Hugues Husson
cb35d750de Fix audio hal crash on moto 2019-02-28 22:48:04 +01:00
104 changed files with 393 additions and 4419 deletions

View File

@ -1 +0,0 @@
$(call inherit-product, vendor/amy/config/common.mk)

View File

@ -1,17 +0,0 @@
import /system/etc/init/zygote/init.${ro.zygote}.rc
on early-fs
mkdir /mnt/runtime/full 0755 root root
mkdir /mnt/runtime/full/self 0755 root root
mkdir /apex 0777 root root
mount tmpfs tmpfs /apex mode=0755,uid=0,gid=0
restorecon /apex
exec -- /system/bin/apexd --bootstrap
export ANDROID_RUNTIME_ROOT /apex/com.android.runtime
export ANDROID_TZDATA_ROOT /apex/com.android.tzdata
symlink /system/product /product
on fs
exec u:r:su:s0 -- /system/bin/umount -l /product
exec u:r:su:s0 -- /system/bin/rmdir /product
symlink /system/product /product

View File

@ -1,13 +0,0 @@
PRODUCT_COPY_FILES += \
device/phh/treble/apex-setup.rc:system/etc/init/apex-setup.rc \
PRODUCT_COPY_FILES += \
system/core/rootdir/init.zygote32.rc:system/etc/init/zygote/init.zygote32.rc \
system/core/rootdir/init.zygote32_64.rc:system/etc/init/zygote/init.zygote32_64.rc \
system/core/rootdir/init.zygote64_32.rc:system/etc/init/zygote/init.zygote64_32.rc \
system/core/rootdir/init.zygote64.rc:system/etc/init/zygote/init.zygote64.rc \
PRODUCT_COPY_FILES += \
frameworks/av/apex/mediaswcodec.rc:system/etc/init/mediaswcodec-treble.rc \
device/phh/treble/environ/init.treble-environ.rc:system/etc/init/init.treble-environ.rc \

100
base.mk
View File

@ -2,18 +2,14 @@
#TODO: Proper detection
PRODUCT_COPY_FILES := \
frameworks/native/data/etc/android.hardware.fingerprint.xml:system/etc/permissions/android.hardware.fingerprint.xml \
frameworks/native/data/etc/android.hardware.telephony.gsm.xml:system/etc/permissions/android.hardware.telephony.gsm.xml \
frameworks/native/data/etc/android.hardware.telephony.ims.xml:system/etc/permissions/android.hardware.telephony.ims.xml \
frameworks/native/data/etc/android.hardware.bluetooth.xml:system/etc/permissions/android.hardware.bluetooth.xml \
frameworks/native/data/etc/android.hardware.bluetooth_le.xml:system/etc/permissions/android.hardware.bluetooth_le.xml \
frameworks/native/data/etc/android.hardware.usb.host.xml:system/etc/permissions/android.hardware.usb.host.xml \
frameworks/native/data/etc/android.hardware.telephony.gsm.xml:system/etc/permissions/android.hardware.telephony.gsm.xml
#Use a more decent APN config
PRODUCT_COPY_FILES += \
device/sample/etc/apns-full-conf.xml:system/etc/apns-conf.xml
BOARD_PLAT_PRIVATE_SEPOLICY_DIR += device/phh/treble/sepolicy
PRODUCT_PACKAGE_OVERLAYS += device/phh/treble/overlay
DEVICE_PACKAGE_OVERLAYS += device/phh/treble/overlay
$(call inherit-product, vendor/hardware_overlay/overlay.mk)
$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
@ -40,11 +36,11 @@ PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
PRODUCT_COPY_FILES += \
device/phh/treble/vndk-detect:system/bin/vndk-detect \
device/phh/treble/vndk.rc:system/etc/init/vndk.rc \
device/phh/treble/ld.config.26.txt:system/etc/ld.config.26.txt \
#USB Audio
PRODUCT_COPY_FILES += \
frameworks/av/services/audiopolicy/config/usb_audio_policy_configuration.xml:system/etc/usb_audio_policy_configuration.xml \
device/phh/treble/files/fake_audio_policy_volume.xml:system/etc/fake_audio_policy_volume.xml \
frameworks/av/services/audiopolicy/config/usb_audio_policy_configuration.xml:system/etc/usb_audio_policy_configuration.xml
# NFC:
# Provide default libnfc-nci.conf file for devices that does not have one in
@ -55,12 +51,10 @@ PRODUCT_COPY_FILES += \
# LineageOS build may need this to make NFC work
PRODUCT_PACKAGES += \
NfcNci \
NfcNci
PRODUCT_COPY_FILES += \
device/phh/treble/rw-system.sh:system/bin/rw-system.sh \
device/phh/treble/phh-on-data.sh:system/bin/phh-on-data.sh \
device/phh/treble/phh-prop-handler.sh:system/bin/phh-prop-handler.sh \
device/phh/treble/fixSPL/getSPL.arm:system/bin/getSPL
PRODUCT_COPY_FILES += \
@ -68,11 +62,11 @@ PRODUCT_COPY_FILES += \
device/phh/treble/phh-on-boot.sh:system/bin/phh-on-boot.sh
PRODUCT_PACKAGES += \
treble-environ-rc \
treble-environ-rc
PRODUCT_PACKAGES += \
bootctl \
vintf \
vintf
# Fix Offline Charging on Huawmeme
PRODUCT_PACKAGES += \
@ -86,8 +80,7 @@ PRODUCT_COPY_FILES += \
device/phh/treble/twrp/busybox-armv7l:system/bin/busybox_phh
PRODUCT_PACKAGES += \
simg2img_simple \
lptools
simg2img_simple
ifneq (,$(wildcard external/exfat))
PRODUCT_PACKAGES += \
@ -96,7 +89,6 @@ PRODUCT_PACKAGES += \
endif
PRODUCT_PACKAGES += \
android.hidl.manager-V1.0-java \
android.hardware.wifi.hostapd-V1.0-java \
vendor.huawei.hardware.biometrics.fingerprint-V2.1-java \
vendor.huawei.hardware.tp-V1.0-java \
@ -109,28 +101,11 @@ PRODUCT_COPY_FILES += \
PRODUCT_COPY_FILES += \
device/phh/treble/files/samsung-gpio_keys.kl:system/phh/samsung-gpio_keys.kl \
device/phh/treble/files/samsung-sec_touchscreen.kl:system/phh/samsung-sec_touchscreen.kl \
device/phh/treble/files/samsung-sec_touchkey.kl:system/phh/samsung-sec_touchkey.kl \
device/phh/treble/files/oneplus6-synaptics_s3320.kl:system/phh/oneplus6-synaptics_s3320.kl \
device/phh/treble/files/huawei-fingerprint.kl:system/phh/huawei/fingerprint.kl \
device/phh/treble/files/samsung-sec_e-pen.idc:system/usr/idc/sec_e-pen.idc \
device/phh/treble/files/samsung-9810-floating_feature.xml:system/ph/sam-9810-flo_feat.xml \
device/phh/treble/files/mimix3-gpio-keys.kl:system/phh/mimix3-gpio-keys.kl \
device/phh/treble/files/nokia-soc_gpio_keys.kl:system/phh/nokia-soc_gpio_keys.kl \
device/phh/treble/files/lenovo-synaptics_dsx.kl:system/phh/lenovo-synaptics_dsx.kl \
device/phh/treble/files/oppo-touchpanel.kl:system/phh/oppo-touchpanel.kl \
device/phh/treble/files/google-uinput-fpc.kl:system/phh/google-uinput-fpc.kl \
device/phh/treble/files/moto-uinput-egis.kl:system/phh/moto-uinput-egis.kl \
device/phh/treble/files/daisy-buttonJack.kl:system/phh/daisy-buttonJack.kl \
device/phh/treble/files/daisy-uinput-fpc.kl:system/phh/daisy-uinput-fpc.kl \
device/phh/treble/files/daisy-uinput-goodix.kl:system/phh/daisy-uinput-goodix.kl \
device/phh/treble/files/nubia-nubia_synaptics_dsx.kl:system/phh/nubia-nubia_synaptics_dsx.kl \
device/phh/treble/files/unihertz-mtk-kpd.kl:system/phh/unihertz-mtk-kpd.kl \
device/phh/treble/files/unihertz-mtk-tpd.kl:system/phh/unihertz-mtk-tpd.kl \
device/phh/treble/files/unihertz-mtk-tpd-kpd.kl:system/phh/unihertz-mtk-tpd-kpd.kl \
device/phh/treble/files/unihertz-fingerprint_key.kl:system/phh/unihertz-fingerprint_key.kl \
device/phh/treble/files/zf6-goodixfp.kl:system/phh/zf6-goodixfp.kl \
device/phh/treble/files/zf6-googlekey_input.kl:system/phh/zf6-googlekey_input.kl \
device/phh/treble/files/teracube2e-mtk-kpd.kl:system/phh/teracube2e-mtk-kpd.kl \
device/phh/treble/files/mimix3-gpio-keys.kl:system/phh/mimix3-gpio-keys.kl
SELINUX_IGNORE_NEVERALLOWS := true
@ -148,60 +123,3 @@ PRODUCT_COPY_FILES += \
#MTK incoming SMS fix
PRODUCT_PACKAGES += \
mtk-sms-fwk-ready
# Helper to debug Xiaomi motorized camera
PRODUCT_PACKAGES += \
xiaomi-motor \
oneplus-motor
PRODUCT_PACKAGES += \
Stk
PRODUCT_PACKAGES += \
resetprop_phh
PRODUCT_COPY_FILES += \
device/phh/treble/phh-securize.sh:system/bin/phh-securize.sh \
device/phh/treble/files/ota.sh:system/bin/ota.sh \
PRODUCT_COPY_FILES += \
device/phh/treble/remove-telephony.sh:system/bin/remove-telephony.sh \
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.software.secure_lock_screen.xml:system/etc/permissions/android.software.secure_lock_screen.xml \
device/phh/treble/files/android.software.controls.xml:system/etc/permissions/android.software.controls.xml \
PRODUCT_COPY_FILES += \
device/phh/treble/ld.config.26.txt:system/etc/ld.config.26.txt \
PRODUCT_PACKAGES += \
asus-motor
# Privapp-permissions whitelist for PhhTrebleApp
PRODUCT_COPY_FILES += \
device/phh/treble/privapp-permissions-me.phh.treble.app.xml:system/etc/permissions/privapp-permissions-me.phh.treble.app.xml
# Remote debugging
PRODUCT_COPY_FILES += \
device/phh/treble/remote/dbclient:system/bin/dbclient \
device/phh/treble/remote/phh-remotectl.rc:system/etc/init/phh-remotectl.rc \
device/phh/treble/remote/phh-remotectl.sh:system/bin/phh-remotectl.sh \
PRODUCT_PACKAGES += \
android.hardware.biometrics.fingerprint@2.1-service.oppo.compat \
android.hardware.biometrics.fingerprint@2.1-service.oplus.compat \
PRODUCT_PACKAGES += \
vr_hwc \
curl \
healthd \
PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
debug.fdsan=warn_once \
# AOSP overlays
PRODUCT_PACKAGES += \
NavigationBarMode2ButtonOverlay
PRODUCT_PACKAGES += \
oplus-alert-slider

View File

@ -2,5 +2,3 @@ TARGET_SYSTEM_PROP := device/phh/treble/system.prop $(TARGET_SYSTEM_PROP)
BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := device/phh/treble/bluetooth
TARGET_EXFAT_DRIVER := exfat
DEVICE_FRAMEWORK_MANIFEST_FILE := device/phh/treble/framework_manifest.xml
BOARD_ROOT_EXTRA_FOLDERS += bt_firmware sec_storage efs

View File

@ -63,203 +63,3 @@ cc_binary {
"mtk-sms-fwk-ready.rc"
],
}
cc_binary {
name: "xiaomi-display-feature",
srcs: [
"xiaomi-display-feature.cpp",
],
shared_libs: [
"vendor.xiaomi.hardware.displayfeature@1.0",
"libutils",
"libhidlbase",
],
}
cc_binary {
name: "xiaomi-fp",
srcs: [
"xiaomi-fp.cpp",
],
shared_libs: [
"vendor.xiaomi.hardware.fingerprintextension@1.0",
"libutils",
"libhidlbase",
],
}
cc_binary {
name: "lightsctl-sec",
srcs: [
"lightsctl-sec.cpp",
],
shared_libs: [
"vendor.samsung.hardware.light@2.0",
"libutils",
"libhidlbase",
],
}
cc_binary {
name: "lightsctl-seh",
srcs: [
"lightsctl-seh.cpp",
],
shared_libs: [
"vendor.samsung.hardware.light@3.0",
"libutils",
"libhidlbase",
],
}
cc_binary {
name: "xiaomi-motor",
srcs: [
"xiaomi-motor.cpp",
],
shared_libs: [
"vendor.xiaomi.hardware.motor@1.0",
"libutils",
"libhidlbase",
],
}
cc_binary {
name: "oneplus-motor",
srcs: [
"oneplus-motor.cpp",
],
shared_libs: [
"vendor.oneplus.hardware.motorcontrol@1.0",
"libutils",
"libhidlbase",
],
}
cc_binary {
name: "persistprops",
srcs: [
"persistent_properties.proto",
"persistprops.cpp",
],
static_executable: true,
proto: {
type: "lite",
static: true,
},
static_libs: [
"libprotobuf-cpp-lite"
],
}
cc_binary {
name: "lightsctl-huawei",
srcs: [
"lightsctl-huawei.cpp",
],
shared_libs: [
"vendor.huawei.hardware.light@2.0",
"libutils",
"libhidlbase",
],
}
cc_binary {
name: "asus-motor",
srcs: [
"asus-motor.cpp",
],
}
cc_binary {
name: "goodix-fp",
srcs: [
"goodix-fp.cpp",
],
shared_libs: [
"vendor.goodix.extend.service@2.0",
"libutils",
"libhidlbase",
],
}
cc_binary {
name: "lptools",
cflags: [
"-Werror",
"-Wextra",
],
device_supported: true,
shared_libs: [
"libbase",
"liblog",
"liblp",
"libsparse",
"libfs_mgr",
"libutils",
"libcutils",
"android.hardware.boot@1.1",
"libhidlbase",
],
static_libs: [
"libdm",
],
srcs: [
"lptools.cc",
],
cppflags: [
"-D_FILE_OFFSET_BITS=64",
],
}
cc_binary {
name: "lptools_static",
cflags: [
"-Werror",
"-Wextra",
"-DLPTOOLS_STATIC",
],
device_supported: true,
shared_libs: [
"libcrypto",
],
static_libs: [
"libbase",
"liblog",
"liblp",
"libsparse",
"libfs_mgr",
"libutils",
"libcutils",
"libdm",
"libext4_utils",
],
srcs: [
"lptools.cc",
],
cppflags: [
"-D_FILE_OFFSET_BITS=64",
],
}
cc_binary {
name: "sec-camera-list",
srcs: [
"sec-camera-list.cpp",
],
shared_libs: [
"vendor.samsung.hardware.camera.provider@3.0",
"libutils",
"libhidlbase",
],
}
cc_binary {
name: "oplus-alert-slider",
srcs: [
"oplus-alert-slider.cpp",
],
init_rc: [
"oplus-alert-slider.rc",
],
}

View File

@ -1,30 +0,0 @@
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdlib.h>
typedef struct {
int dir;
int angle;
int speed;
} motorDrvManualConfig_t;
#define ASUS_MOTOR_NAME_SIZE 32
#define ASUS_MOTOR_DATA_SIZE 4
#define ASUS_MOTOR_DRV_DEV_PATH ("/dev/asusMotoDrv")
#define ASUS_MOTOR_DRV_IOC_MAGIC ('M')
#define ASUS_MOTOR_DRV_AUTO_MODE _IOW(ASUS_MOTOR_DRV_IOC_MAGIC, 1, int)
#define ASUS_MOTOR_DRV_MANUAL_MODE _IOW(ASUS_MOTOR_DRV_IOC_MAGIC, 2, motorDrvManualConfig_t)
int main(int argc, char **argv) {
if(argc != 2) return 1;
int fd = open("/dev/asusMotoDrv", O_RDWR);
motorDrvManualConfig_t cfg;
cfg.dir = atoi(argv[1]);
cfg.angle = 180;
cfg.speed = 4;
ioctl(fd, ASUS_MOTOR_DRV_MANUAL_MODE, &cfg);
}

View File

@ -1,17 +0,0 @@
#include <iostream>
#include <vendor/goodix/extend/service/2.0/IGoodixFPExtendService.h>
using ::vendor::goodix::extend::service::V2_0::IGoodixFPExtendService;
using ::android::sp;
int main(int argc, char **argv) {
auto svc = IGoodixFPExtendService::getService();
if(argc!=3) return 1;
int a = atoi(argv[1]);
int b = atoi(argv[2]);
auto ret = svc->goodixExtendCommand(a, b);
if(!ret.isOk()) {
std::cerr << "HWBinder call failed" << std::endl;
}
std::cout << "updateStatus returned " << toString(ret) << std::endl;
}

View File

@ -1,38 +0,0 @@
#include <iostream>
#include <vendor/huawei/hardware/light/2.0/ILight.h>
#include <android/hardware/light/2.0/types.h>
using ::vendor::huawei::hardware::light::V2_0::ILight;
using ::android::sp;
int main(int argc, char **argv) {
auto svc = ILight::getService();
svc->HWgetSupportedTypes([](auto types) {
for(const auto& type: types) {
std::cout << "Got type " << type << std::endl;
}
});
uint32_t a = (uint32_t)strtoll(argv[1], NULL, 10);
android::hardware::light::V2_0::LightState state;
state.color = (uint32_t)strtoll(argv[2], NULL, 16);
state.flashMode = android::hardware::light::V2_0::Flash::NONE;
state.brightnessMode = android::hardware::light::V2_0::Brightness::USER;
if(argc == 6) {
std::string flashArg(argv[3]);
if(flashArg == "NONE")
state.flashMode = android::hardware::light::V2_0::Flash::NONE;
if(flashArg == "TIMED")
state.flashMode = android::hardware::light::V2_0::Flash::TIMED;
if(flashArg == "HARDWARE")
state.flashMode = android::hardware::light::V2_0::Flash::HARDWARE;
state.flashOnMs = atoi(argv[4]);
state.flashOffMs = atoi(argv[5]);
}
std::cout << "Set flash type to " << toString(state.flashMode) << std::endl;
svc->HWsetLight(a, state);
}

View File

@ -1,59 +0,0 @@
#include <iostream>
#include <vendor/samsung/hardware/light/2.0/ISecLight.h>
#include <vendor/samsung/hardware/light/2.0/types.h>
using ::vendor::samsung::hardware::light::V2_0::ISecLight;
using ::android::sp;
int main(int argc, char **argv) {
auto svc = ISecLight::getService();
svc->getSupportedTypes([](auto types) {
for(const auto& type: types) {
std::cout << "Got type " << toString(type) << std::endl;
}
});
if(argc <= 1) return 0;
if(argc != 3 && argc != 6) return 1;
std::string typeArg(argv[1]);
vendor::samsung::hardware::light::V2_0::SecType type;
if(typeArg == "BACKLIGHT")
type = vendor::samsung::hardware::light::V2_0::SecType::BACKLIGHT;
if(typeArg == "KEYBOARD")
type = vendor::samsung::hardware::light::V2_0::SecType::KEYBOARD;
if(typeArg == "BUTTONS")
type = vendor::samsung::hardware::light::V2_0::SecType::BUTTONS;
if(typeArg == "BATTERY")
type = vendor::samsung::hardware::light::V2_0::SecType::BATTERY;
if(typeArg == "NOTIFICATIONS")
type = vendor::samsung::hardware::light::V2_0::SecType::NOTIFICATIONS;
if(typeArg == "ATTENTION")
type = vendor::samsung::hardware::light::V2_0::SecType::ATTENTION;
if(typeArg == "BLUETOOTH")
type = vendor::samsung::hardware::light::V2_0::SecType::BLUETOOTH;
if(typeArg == "WIFI")
type = vendor::samsung::hardware::light::V2_0::SecType::WIFI;
std::cout << "Set request type " << toString(type) << std::endl;
android::hardware::light::V2_0::LightState state;
state.color = (uint32_t)strtoll(argv[2], NULL, 16);
state.flashMode = android::hardware::light::V2_0::Flash::NONE;
state.brightnessMode = android::hardware::light::V2_0::Brightness::USER;
if(argc == 6) {
std::string flashArg(argv[3]);
if(flashArg == "NONE")
state.flashMode = android::hardware::light::V2_0::Flash::NONE;
if(flashArg == "TIMED")
state.flashMode = android::hardware::light::V2_0::Flash::TIMED;
if(flashArg == "HARDWARE")
state.flashMode = android::hardware::light::V2_0::Flash::HARDWARE;
state.flashOnMs = atoi(argv[4]);
state.flashOffMs = atoi(argv[5]);
}
std::cout << "Set flash type to " << toString(state.flashMode) << std::endl;
auto ret = svc->setLightSec(type, state);
std::cout << "Set light returned " << toString(ret) << std::endl;
}

View File

@ -1,62 +0,0 @@
#include <iostream>
#include <vendor/samsung/hardware/light/3.0/ISehLight.h>
#include <vendor/samsung/hardware/light/3.0/types.h>
using ::vendor::samsung::hardware::light::V3_0::ISehLight;
using ::android::sp;
int main(int argc, char **argv) {
auto svc = ISehLight::getService();
svc->getSupportedTypes([](auto types) {
for(const auto& type: types) {
std::cout << "Got type " << toString(type) << std::endl;
}
});
if(argc <= 1) return 0;
if(argc != 4 && argc != 7) return 1;
std::string typeArg(argv[1]);
vendor::samsung::hardware::light::V3_0::SehType type;
if(typeArg == "BACKLIGHT")
type = vendor::samsung::hardware::light::V3_0::SehType::BACKLIGHT;
if(typeArg == "KEYBOARD")
type = vendor::samsung::hardware::light::V3_0::SehType::KEYBOARD;
if(typeArg == "BUTTONS")
type = vendor::samsung::hardware::light::V3_0::SehType::BUTTONS;
if(typeArg == "BATTERY")
type = vendor::samsung::hardware::light::V3_0::SehType::BATTERY;
if(typeArg == "NOTIFICATIONS")
type = vendor::samsung::hardware::light::V3_0::SehType::NOTIFICATIONS;
if(typeArg == "ATTENTION")
type = vendor::samsung::hardware::light::V3_0::SehType::ATTENTION;
if(typeArg == "BLUETOOTH")
type = vendor::samsung::hardware::light::V3_0::SehType::BLUETOOTH;
if(typeArg == "WIFI")
type = vendor::samsung::hardware::light::V3_0::SehType::WIFI;
if(typeArg == "SUB_BACKLIGHT")
type = vendor::samsung::hardware::light::V3_0::SehType::SUB_BACKLIGHT;
std::cout << "Set request type " << toString(type) << std::endl;
vendor::samsung::hardware::light::V3_0::SehLightState state;
state.color = (uint32_t)strtoll(argv[2], NULL, 16);
state.flashMode = android::hardware::light::V2_0::Flash::NONE;
state.brightnessMode = android::hardware::light::V2_0::Brightness::USER;
state.extendedBrightness = (uint32_t)strtoll(argv[3], NULL, 0);
if(argc == 7) {
std::string flashArg(argv[4]);
if(flashArg == "NONE")
state.flashMode = android::hardware::light::V2_0::Flash::NONE;
if(flashArg == "TIMED")
state.flashMode = android::hardware::light::V2_0::Flash::TIMED;
if(flashArg == "HARDWARE")
state.flashMode = android::hardware::light::V2_0::Flash::HARDWARE;
state.flashOnMs = atoi(argv[5]);
state.flashOffMs = atoi(argv[6]);
}
std::cout << "Set flash type to " << toString(state.flashMode) << std::endl;
auto ret = svc->sehSetLight(type, state);
std::cout << "Set light returned " << toString(ret) << std::endl;
}

View File

@ -1,309 +0,0 @@
/*
* Copyright (C) 2018 The Android Open Source 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.
*/
#include <getopt.h>
#include <inttypes.h>
#include <sys/mount.h>
#include <sys/stat.h>
#include <sys/statvfs.h>
#include <sys/types.h>
#include <sysexits.h>
#include <unistd.h>
#include <iostream>
#include <optional>
#include <regex>
#include <string>
#include <vector>
#include <chrono>
#include <android-base/parseint.h>
#include <android-base/properties.h>
#include <android-base/strings.h>
#include <cutils/android_get_control_file.h>
#include <fs_mgr.h>
#include <liblp/builder.h>
#include <liblp/liblp.h>
#include <fs_mgr_dm_linear.h>
#include <libdm/dm.h>
#ifndef LPTOOLS_STATIC
#include <android/hardware/boot/1.1/IBootControl.h>
#include <android/hardware/boot/1.1/types.h>
#endif
using namespace android;
using namespace android::fs_mgr;
class FileOrBlockDeviceOpener final : public PartitionOpener {
public:
android::base::unique_fd Open(const std::string& path, int flags) const override {
// Try a local file first.
android::base::unique_fd fd;
#ifdef __ANDROID__
fd.reset(android_get_control_file(path.c_str()));
if (fd >= 0) return fd;
#endif
fd.reset(open(path.c_str(), flags));
if (fd >= 0) return fd;
return PartitionOpener::Open(path, flags);
}
};
static FileOrBlockDeviceOpener opener;
std::unique_ptr<MetadataBuilder> makeBuilder() {
auto builder = MetadataBuilder::New(opener, "super", 0);
if(builder == nullptr) {
std::cout << "Failed creating super builder" << std::endl;
}
return builder;
}
void saveToDisk(std::unique_ptr<MetadataBuilder> builder) {
auto newMetadata = builder->Export();
int nSlots = 2;//pt->geometry.metadata_slot_count;
for(int slot=0; slot < nSlots; slot++) {
std::cout << "Saving the updated partition table " << UpdatePartitionTable(opener, "super", *newMetadata, slot) << " for slot " << slot << std::endl;
}
}
inline bool ends_with(std::string const & value, std::string const & ending)
{
if (ending.size() > value.size()) return false;
return std::equal(ending.rbegin(), ending.rend(), value.rbegin());
}
std::string findGroup(std::unique_ptr<MetadataBuilder>& builder) {
auto groups = builder->ListGroups();
auto partitionName = "system" + ::android::base::GetProperty("ro.boot.slot_suffix", "");
for(auto groupName: groups) {
auto partitions = builder->ListPartitionsInGroup(groupName);
for (const auto& partition : partitions) {
if(partition->name() == partitionName) {
return groupName;
}
}
}
std::string maxGroup = "";
uint64_t maxGroupSize = 0;
for(auto groupName: groups) {
auto group = builder->FindGroup(groupName);
if(group->maximum_size() > maxGroupSize) {
maxGroup = groupName;
maxGroupSize = group->maximum_size();
}
}
return maxGroup;
}
int main(int argc, char **argv) {
if(argc<=1) {
std::cerr << "Usage: " << argv[0] << " <create|remove|resize|rename>" << std::endl;
exit(1);
}
auto builder = makeBuilder();
auto group = findGroup(builder);
std::cout << "Best group seems to be " << group << std::endl;
if(strcmp(argv[1], "create") == 0) {
if(argc != 4) {
std::cerr << "Usage: " << argv[0] << " create <partition name> <partition size>" << std::endl;
exit(1);
}
auto partName = argv[2];
auto size = strtoll(argv[3], NULL, 0);
auto partition = builder->FindPartition(partName);
if(partition != nullptr) {
std::cerr << "Partition " << partName << " already exists." << std::endl;
exit(1);
}
partition = builder->AddPartition(partName, group, 0);
auto result = builder->ResizePartition(partition, size);
std::cout << "Growing partition " << result << std::endl;
if(!result) return 1;
saveToDisk(std::move(builder));
std::string dmPath;
CreateLogicalPartitionParams params {
.block_device = "/dev/block/by-name/super",
.metadata_slot = 0,
.partition_name = partName,
.timeout_ms = std::chrono::milliseconds(10000),
.force_writable = true,
};
auto dmCreateRes = android::fs_mgr::CreateLogicalPartition(params, &dmPath);
std::cout << "Creating dm partition for " << partName << " answered " << dmCreateRes << " at " << dmPath << std::endl;
exit(0);
} else if(strcmp(argv[1], "remove") == 0) {
if(argc != 3) {
std::cerr << "Usage: " << argv[0] << " remove <partition name>" << std::endl;
exit(1);
}
auto partName = argv[2];
auto dmState = android::dm::DeviceMapper::Instance().GetState(partName);
if(dmState == android::dm::DmDeviceState::ACTIVE) {
android::fs_mgr::DestroyLogicalPartition(partName);
}
builder->RemovePartition(partName);
saveToDisk(std::move(builder));
exit(0);
} else if(strcmp(argv[1], "resize") == 0) {
if(argc != 4) {
std::cerr << "Usage: " << argv[0] << " resize <partition name> <newsize>" << std::endl;
exit(1);
}
auto partName = argv[2];
auto size = strtoll(argv[3], NULL, 0);
auto partition = builder->FindPartition(partName);
std::cout << "Resizing partition " << builder->ResizePartition(partition, size) << std::endl;
saveToDisk(std::move(builder));
exit(0);
} else if(strcmp(argv[1], "replace") == 0) {
if(argc != 4) {
std::cerr << "Usage: " << argv[0] << " replace <original partition name> <new partition name>" << std::endl;
std::cerr << "This will delete <new partition name> and rename <original partition name> to <new partition name>" << std::endl;
exit(1);
}
auto src = argv[2];
auto dst = argv[3];
auto srcPartition = builder->FindPartition(src);
if(srcPartition == nullptr) {
srcPartition = builder->FindPartition(src + ::android::base::GetProperty("ro.boot.slot_suffix", ""));
}
auto dstPartition = builder->FindPartition(dst);
if(dstPartition == nullptr) {
dstPartition = builder->FindPartition(dst + ::android::base::GetProperty("ro.boot.slot_suffix", ""));
}
std::string dstPartitionName = dst;
if(dstPartition != nullptr) {
dstPartitionName = dstPartition->name();
}
std::vector<std::unique_ptr<Extent>> originalExtents;
const auto& extents = srcPartition->extents();
for(unsigned i=0; i<extents.size(); i++) {
const auto& extend = extents[i];
auto linear = extend->AsLinearExtent();
if(linear != nullptr) {
auto copyLinear = std::make_unique<LinearExtent>(linear->num_sectors(), linear->device_index(), linear->physical_sector());
originalExtents.push_back(std::move(copyLinear));
} else {
auto copyZero = std::make_unique<ZeroExtent>(extend->num_sectors());
originalExtents.push_back(std::move(copyZero));
}
}
builder->RemovePartition(srcPartition->name());
builder->RemovePartition(dstPartitionName);
auto newDstPartition = builder->AddPartition(dstPartitionName, group, 0);
for(auto&& extent: originalExtents) {
newDstPartition->AddExtent(std::move(extent));
}
saveToDisk(std::move(builder));
exit(0);
} else if(strcmp(argv[1], "map") == 0) {
if(argc != 3) {
std::cerr << "Usage: " << argv[0] << " map <partition name>" << std::endl;
exit(1);
}
auto partName = argv[2];
std::string dmPath;
CreateLogicalPartitionParams params {
.block_device = "/dev/block/by-name/super",
.metadata_slot = 0,
.partition_name = partName,
.timeout_ms = std::chrono::milliseconds(10000),
.force_writable = true,
};
auto dmCreateRes = android::fs_mgr::CreateLogicalPartition(params, &dmPath);
std::cout << "Creating dm partition for " << partName << " answered " << dmCreateRes << " at " << dmPath << std::endl;
exit(0);
} else if(strcmp(argv[1], "unmap") == 0) {
if(argc != 3) {
std::cerr << "Usage: " << argv[0] << " unmap <partition name>" << std::endl;
exit(1);
}
auto partName = argv[2];
auto dmState = android::dm::DeviceMapper::Instance().GetState(partName);
if(dmState == android::dm::DmDeviceState::ACTIVE) {
android::fs_mgr::DestroyLogicalPartition(partName);
}
exit(0);
} else if(strcmp(argv[1], "free") == 0) {
if(argc != 2) {
std::cerr << "Usage: " << argv[0] << " free" << std::endl;
exit(1);
}
auto groupO = builder->FindGroup(group);
uint64_t maxSize = groupO->maximum_size();
uint64_t total = 0;
auto partitions = builder->ListPartitionsInGroup(group);
for (const auto& partition : partitions) {
total += partition->BytesOnDisk();
}
uint64_t groupAllocatable = maxSize - total;
uint64_t superFreeSpace = builder->AllocatableSpace() - builder->UsedSpace();
if(groupAllocatable > superFreeSpace || maxSize == 0)
groupAllocatable = superFreeSpace;
printf("Free space: %" PRIu64 "\n", groupAllocatable);
exit(0);
} else if(strcmp(argv[1], "unlimited-group") == 0) {
builder->ChangeGroupSize(group, 0);
saveToDisk(std::move(builder));
return 0;
} else if(strcmp(argv[1], "clear-cow") == 0) {
#ifndef LPTOOLS_STATIC
// Ensure this is a V AB device, and that no merging is taking place (merging? in gsi? uh)
auto svc1_1 = ::android::hardware::boot::V1_1::IBootControl::tryGetService();
if(svc1_1 == nullptr) {
std::cerr << "Couldn't get a bootcontrol HAL. You can clear cow only on V AB devices" << std::endl;
return 1;
}
auto mergeStatus = svc1_1->getSnapshotMergeStatus();
if(mergeStatus != ::android::hardware::boot::V1_1::MergeStatus::NONE) {
std::cerr << "Merge status is NOT none, meaning a merge is pending. Clearing COW isn't safe" << std::endl;
return 1;
}
#endif
uint64_t superFreeSpace = builder->AllocatableSpace() - builder->UsedSpace();
std::cerr << "Super allocatable " << superFreeSpace << std::endl;
uint64_t total = 0;
auto partitions = builder->ListPartitionsInGroup("cow");
for (const auto& partition : partitions) {
std::cout << "Deleting partition? " << partition->name() << std::endl;
if(ends_with(partition->name(), "-cow")) {
std::cout << "Deleting partition " << partition->name() << std::endl;
builder->RemovePartition(partition->name());
}
}
saveToDisk(std::move(builder));
return 0;
}
return 0;
}

View File

@ -7,6 +7,6 @@ using ::android::sp;
int main(int argc, char **argv) {
auto svc = IRadio::getService(argv[1]);
if(svc != nullptr)
svc->setSmsFwkReady(1);
}

View File

@ -1,32 +0,0 @@
#include <iostream>
#include <unistd.h>
#include <vendor/oneplus/hardware/motorcontrol/1.0/IOPMotorControl.h>
using ::vendor::oneplus::hardware::motorcontrol::V1_0::IOPMotorControl;
using ::android::sp;
int main(int argc, char **argv) {
auto svc = IOPMotorControl::getService();
if(svc == nullptr) {
std::cerr << "Failed getting IMotor" << std::endl;
return -1;
}
if(argc<2) {
std::cerr << "Usage: " << argv[0] << " <read|down|up>" << std::endl;
return -1;
}
std::string cmd(argv[1]);
if(cmd == "read") {
int ret = svc->readMotorData(1, 16);
std::cout << "Read motor data 1/16 returned " << ret << std::endl;
return 0;
} else if(cmd == "down") {
int ret = svc->writeMotorData(1, 0, 1);
std::cout << "Down motor control data 1/0/1 returned " << ret << std::endl;
return 0;
} else if(cmd == "up") {
int ret = svc->writeMotorData(1, 1, 1);
std::cout << "Down motor control data 1/1/1 returned " << ret << std::endl;
return 0;
}
}

View File

@ -1,54 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <linux/input.h>
int read_tristate() {
int fd = open("/proc/tristatekey/tri_state", O_RDONLY);
char p[16];
int ret = read(fd, p, sizeof(p) - 1);
p[ret] = 0;
return atoi(p);
}
int main() {
int fd = -1;
for(int i=0; i<255; i++) {
char path[256];
snprintf(path, 256, "/dev/input/event%d", i);
fd = open(path, O_RDWR);
if(fd == -1) continue;
char name[256];
ioctl(fd, EVIOCGNAME(256), name);
printf("Got input name %s\n", name);
if(strcmp(name, "oplus,hall_tri_state_key") == 0) {
break;
}
close(fd);
fd = -1;
}
if(fd == -1) return 0;
ioctl(fd, EVIOCGRAB, 1);
struct input_event ev;
while(read(fd, &ev, sizeof(ev)) != 0) {
if(!(ev.code == 61 && ev.value == 0)) continue;
int state = read_tristate();
if(state == 1) {
}
printf("State %d\n", read_tristate());
if(state == 1) {
system("service call audio 31 i32 2 s16 android");
} else if(state == 2) {
system("service call audio 31 i32 1 s16 android");
} else if(state == 3) {
system("service call audio 31 i32 0 s16 android");
}
}
}

View File

@ -1,4 +0,0 @@
service phhoplus-alert-slider /system/bin/oplus-alert-slider
seclabel u:r:phhsu_daemon:s0
oneshot
class main

View File

@ -1,27 +0,0 @@
/*
* Copyright (C) 2017 The Android Open Source 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.
*/
syntax = "proto2";
option optimize_for = LITE_RUNTIME;
message PersistentProperties {
message PersistentPropertyRecord {
optional string name = 1;
optional string value = 2;
}
repeated PersistentPropertyRecord properties = 1;
}

View File

@ -1,55 +0,0 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include "device/phh/treble/cmds/persistent_properties.pb.h"
#include <algorithm>
#include <iostream>
int main(int argc, char **argv) {
int fd = open("persistent_properties", O_RDWR);
off_t size = lseek(fd, 0, SEEK_END);
lseek(fd, 0, SEEK_SET);
char *data = (char*) malloc(size);
int ret = read(fd, data, size);
PersistentProperties props;
bool parsed = props.ParseFromArray(data, size);
std::cout << "Currently has " << props.properties_size() << " props." << std::endl;
for(auto prop: props.properties()) {
std::cout << prop.name() << ":" << prop.value() << std::endl;
}
if(argc == 1) {
close(fd);
return 0;
}
if(argc != 3) {
std::cout << "Usage: " << argv[0] << " [prop value]" << std::endl;
return -1;
}
std::string property(argv[1]);
std::string value(argv[2]);
auto p = props.mutable_properties();
auto it = std::find_if(p->begin(), p->end(), [=](const auto& v) { return v.name() == property; });
if(it == p->end()) {
std::cout << "Property not found, adding it" << std::endl;
auto *record = p->Add();;
record->set_name(property);
record->set_value(value);
} else {
std::cout << "Property found, replacing it" << std::endl;
it->set_value(value);
}
size_t write_size = props.ByteSize();
char *write_buffer = (char*) malloc(write_size);
props.SerializeToArray(write_buffer, write_size);
ftruncate(fd, 0);
lseek(fd, 0, SEEK_SET);
write(fd, write_buffer, write_size);
close(fd);
}

View File

@ -1,15 +0,0 @@
#include <iostream>
#include <vendor/samsung/hardware/camera/provider/3.0/ISehCameraProvider.h>
using ::vendor::samsung::hardware::camera::provider::V3_0::ISehCameraProvider;
using ::android::sp;
int main(int argc, char **argv) {
auto svc = ISehCameraProvider::getService("legacy/0");
auto cb = [](::android::hardware::camera::common::V1_0::Status status, ::android::hardware::hidl_vec<::android::hardware::hidl_string> ids) {
for(auto id: ids) {
std::cerr << "id = " << id << std::endl;
}
};
svc->sehGetCameraIdList(cb);
}

View File

@ -41,23 +41,9 @@ typedef struct chunk_header {
* For a CRC32 chunk, it's 4 bytes of CRC32
*/
static int disable_splice = 0;
void nsendfile(int out_fd, int in_fd, size_t count) {
char buf[1024*1024];
while(count) {
ssize_t res = -1;
if(!disable_splice) {
res = splice(in_fd, NULL, out_fd, NULL, count, 0);
}
if(count > 16*1024 && res < 1024)
disable_splice = 1;
if(res==-1) {
ssize_t sizeToRead = sizeof(buf);
if(count < sizeToRead) sizeToRead = count;
res = read(in_fd, buf, sizeToRead);
if(write(out_fd, buf, res) != res) exit(114);
}
ssize_t res = splice(in_fd, NULL, out_fd, NULL, count, 0);
if(res == 0 || res == -1) exit(112);
count -= res;
}

View File

@ -44,11 +44,6 @@ int main(int argc, char **argv, char **envp) {
if (buflen<0) {
exit(1);
}
if(argc>=2) {
if(!strstr(buffer, argv[1])) continue;
}
printf("%s\n", buffer);
char *pos = buffer + strlen(buffer);
char *end = buffer + buflen;

View File

@ -1,40 +0,0 @@
#include <iostream>
#include <unistd.h>
#include <vendor/xiaomi/hardware/displayfeature/1.0/IDisplayFeature.h>
using ::vendor::xiaomi::hardware::displayfeature::V1_0::IDisplayFeature;
using ::android::sp;
int main(int argc, char **argv) {
auto svc = IDisplayFeature::getService();
if(svc == nullptr) {
std::cerr << "Failed getting IDisplayFeature" << std::endl;
return -1;
}
if(argc != 3) {
fprintf(stderr, "Usage: %s <ADAPT|ENHANCE|STANDARD|EYECARE|MONOCHROME|SUNLIGHT|NIGHTLIGHT|HIGHLIGHT> <value>\n", argv[0]);
return -2;
}
int mode = -1;
std::string modeArg(argv[1]);
if(modeArg == "ADAPT")
mode = 0;
if(modeArg == "ENHANCE")
mode = 1;
if(modeArg == "STANDARD")
mode = 2;
if(modeArg == "EYECARE")
mode = 3;
if(modeArg == "MONOCHROME")
mode = 4;
if(modeArg == "SUNLIGHT")
mode = 8;
if(modeArg == "NIGHTLIGHT")
mode = 9;
if(modeArg == "HIGHLIGHT")
mode = 11;
else
mode = atoi(argv[1]);
svc->setFeature(0, mode, atoi(argv[2]), 255);
}

View File

@ -1,21 +0,0 @@
#include <iostream>
#include <unistd.h>
#include <vendor/xiaomi/hardware/fingerprintextension/1.0/IXiaomiFingerprint.h>
using ::vendor::xiaomi::hardware::fingerprintextension::V1_0::IXiaomiFingerprint;
using ::android::sp;
int main(int argc, char **argv) {
auto svc = IXiaomiFingerprint::getService();
if(svc == nullptr) {
std::cerr << "Failed getting IDisplayFeature" << std::endl;
return -1;
}
if(argc != 3) {
fprintf(stderr, "Usage: %s <command> <value>\n", argv[0]);
return -2;
}
uint32_t cmd = (uint32_t)strtoll(argv[1], NULL, 16);
uint32_t value = (uint32_t)strtoll(argv[2], NULL, 16);
svc->extCmd(cmd, value);
}

View File

@ -1,38 +0,0 @@
#include <iostream>
#include <unistd.h>
#include <vendor/xiaomi/hardware/motor/1.0/IMotor.h>
using ::vendor::xiaomi::hardware::motor::V1_0::IMotor;
using ::android::sp;
int main(int argc, char **argv) {
auto svc = IMotor::getService();
if(svc == nullptr) {
std::cerr << "Failed getting IMotor" << std::endl;
return -1;
}
if(argc<2) {
std::cerr << "Usage: " << argv[0] << " <init|release|popup|takeback|takebackShortly>" << std::endl;
return -1;
}
std::string cmd(argv[1]);
if(cmd == "init") {
svc->init();
} else if(cmd == "release") {
svc->release();
} else if(cmd == "popup") {
if(argc!=3) {
std::cerr << "Usage: " << argv[0] << " " << argv[1] << " <cookie>" << std::endl;
return -1;
}
svc->popupMotor(atoi(argv[2]));
} else if(cmd == "takeback") {
if(argc!=3) {
std::cerr << "Usage: " << argv[0] << " " << argv[1] << " <cookie>" << std::endl;
return -1;
}
svc->takebackMotor(atoi(argv[2]));
} else if(cmd == "takebackShortly") {
svc->takebackMotorShortly();
}
}

View File

@ -1,4 +1,4 @@
# set up the global environment
on init
export BOOTCLASSPATH /apex/com.android.runtime/javalib/core-oj.jar:/apex/com.android.runtime/javalib/core-libart.jar:/apex/com.android.runtime/javalib/okhttp.jar:/apex/com.android.runtime/javalib/bouncycastle.jar:/apex/com.android.runtime/javalib/apache-xml.jar:/system/framework/framework.jar:/system/framework/ext.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/ims-common.jar:/system/framework/android.test.base.jar:/apex/com.android.conscrypt/javalib/conscrypt.jar:/apex/com.android.media/javalib/updatable-media.jar
export SYSTEMSERVERCLASSPATH /system/framework/services.jar:/system/framework/ethernet-service.jar:/system/framework/wifi-service.jar:/system/framework/com.android.location.provider.jar
export BOOTCLASSPATH %BOOTCLASSPATH%
export SYSTEMSERVERCLASSPATH %SYSTEMSERVERCLASSPATH%

View File

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<permissions>
<feature name="android.software.controls" />
</permissions>

View File

@ -1,30 +0,0 @@
# Copyright (c) 2019, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of The Linux Foundation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
key 226 HEADSETHOOK
key 257 VOLUME_UP
key 258 VOLUME_DOWN

View File

@ -1,11 +0,0 @@
##################################
#
#add for fpc fingerprints
#
##################################
key 195 SYSTEM_NAVIGATION_UP
key 196 SYSTEM_NAVIGATION_DOWN
key 197 SYSTEM_NAVIGATION_LEFT
key 198 SYSTEM_NAVIGATION_RIGHT
key 353 DPAD_CENTER

View File

@ -1,11 +0,0 @@
##################################
#
#add for goodix fingerprints
#
##################################
key 195 SYSTEM_NAVIGATION_UP
key 196 SYSTEM_NAVIGATION_DOWN
key 197 SYSTEM_NAVIGATION_LEFT
key 198 SYSTEM_NAVIGATION_RIGHT
key 353 DPAD_CENTER

View File

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<audioPolicyConfiguration version="1.0" xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="/vendor/etc/audio_policy_volumes.xml"/>
<xi:include href="/vendor/etc/default_volume_tables.xml"/>
</audioPolicyConfiguration>

View File

@ -1,4 +0,0 @@
key 106 SYSTEM_NAVIGATION_LEFT
key 108 SYSTEM_NAVIGATION_DOWN
key 103 SYSTEM_NAVIGATION_UP
key 105 SYSTEM_NAVIGATION_RIGHT

View File

@ -1 +0,0 @@
key 542 WAKEUP

View File

@ -29,4 +29,4 @@ key 114 VOLUME_DOWN
key 102 HOME
key 528 FOCUS
key 766 CAMERA
key 689 VOICE_ASSIST
key 689 ASSIST

View File

@ -1,14 +0,0 @@
#
# ETS320 Touch sensor driver
#
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License Version 2
# as published by the Free Software Foundation.
#
# ets320 "finger present"
key 618 SYSTEM_NAVIGATION_DOWN
key 619 SYSTEM_NAVIGATION_UP
key 620 SYSTEM_NAVIGATION_LEFT
key 621 SYSTEM_NAVIGATION_RIGHT

View File

@ -1,6 +0,0 @@
# SPDX-License-Identifier: Apache-2.0
key 114 VOLUME_DOWN
key 115 VOLUME_UP
key 116 POWER
key 236 ASSIST

View File

@ -1 +0,0 @@
key 0x44 POWER

View File

@ -1,2 +0,0 @@
key 62 WAKEUP

View File

@ -1,72 +0,0 @@
#!/system/bin/sh
set -e
if ! [ "$(getprop ro.boot.dynamic_partitions)" = true ];then
echo "OTA is supported only for devices with dynamic partitions!"
exit 1
fi
flavor=$(getprop ro.product.product.name)
nextVersion=$(curl --silent -L https://raw.githubusercontent.com/phhusson/treble_experimentations/master/ota/roar/$flavor/date)
if [ -z "$nextVersion" ];then
echo "Couldn't find any OTA for $flavor"
exit 1
fi
url=$(curl --silent -L https://raw.githubusercontent.com/phhusson/treble_experimentations/master/ota/roar/$flavor/url)
size=$(curl --silent -L https://raw.githubusercontent.com/phhusson/treble_experimentations/master/ota/roar/$flavor/size)
if [ "$(getprop ro.product.build.date.utc)" = "$nextVersion" ];then
echo "Installing $nextVersion onto itself, aborting"
exit 1
fi
if ! curl --silent -L https://raw.githubusercontent.com/phhusson/treble_experimentations/master/ota/roar/$flavor/known_releases |grep -q $(getprop ro.product.build.date.utc);then
echo "Warning! The build you are currently running is unknown. Type YES to confirm you want to apply OTA from $url"
read answer
if ! [ "$answer" = YES ];then
exit 1
fi
fi
if [ -b /dev/tmp-phh ] && ! tune2fs -l /dev/tmp-phh |grep 'Last mount time' |grep -q n/a;then
echo "Warning! It looks like you modified your system image! Flashing this OTA will revert this!"
echo "Type YES to acknowledge"
read answer
if ! [ "$answer" = YES ];then
exit 1
fi
fi
lptools remove system_phh
free=$(lptools free |grep -oE '[0-9]+$')
if [ "$free" -le "$size" ];then
echo "Warning! There doesn't seem to be enough space on super partition."
echo "Do you want me to try to make more space? Type YES"
read answer
if ! [ "$answer" = YES ];then
exit 1
fi
lptools clear-cow || true
lptools unlimited-group || true
lptools remove product || true
lptools remove product$(getprop ro.boot.slot_suffix) || true
free=$(lptools free |grep -oE '[0-9]+$')
if [ "$free" -le "$size" ];then
echo "Sorry, there is still not enough space available. OTA requires $size, you have $free available"
exit 1
fi
fi
lptools create system_phh "$size"
lptools unmap system_phh
dmDevice=$(lptools map system_phh|grep -oE '/dev/block/[^ ]*')
echo "Flashing from ${url}..."
curl -L "$url" | busybox_phh xz -d -c | simg2img_simple > $dmDevice
lptools replace system_phh system
reboot
exit 0

View File

@ -9,4 +9,3 @@ key 103 SYSTEM_NAVIGATION_UP
key 105 SYSTEM_NAVIGATION_LEFT
key 106 SYSTEM_NAVIGATION_RIGHT
key 108 SYSTEM_NAVIGATION_DOWN
key 172 HOME

View File

@ -1,3 +0,0 @@
key 158 BACK
key 254 APP_SWITCH

View File

@ -25,6 +25,5 @@
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
key 143 WAKEUP
key 172 WAKEUP

View File

@ -1,4 +0,0 @@
key 114 VOLUME_DOWN
key 115 VOLUME_UP
key 116 POWER
key 456 WAKEUP

View File

@ -1,3 +0,0 @@
# Key layout for Unihertz devices with fingerprint sensor
# For Atom {,L,XL}: fingerprint sensor as home
key 172 HOME VIRTUAL

View File

@ -1,13 +0,0 @@
# Keylayout for Unihertz devices with a dedicated PTT button
# Volume buttons
key 115 VOLUME_UP
key 114 VOLUME_DOWN
# Power button
key 116 POWER
# PTT - Remap to camera by default
# CAMERA is delivered to apps, so remapping via
# third-party apps is possible
key 249 CAMERA
key 250 CAMERA

View File

@ -1,6 +0,0 @@
# Keylayout for Unihertz devices with capacitive keys
# Capacitive navigation
key 172 HOME VIRTUAL
key 580 APP_SWITCH VIRTUAL
key 158 BACK VIRTUAL

View File

@ -1,6 +0,0 @@
# Keylayout for Unihertz devices with capacitive keys
# Capacitive navigation
key 172 HOME VIRTUAL
key 580 APP_SWITCH VIRTUAL
key 158 BACK VIRTUAL

View File

@ -1,6 +0,0 @@
key 0x6c SYSTEM_NAVIGATION_DOWN
key 0x67 SYSTEM_NAVIGATION_UP
key 0x69 SYSTEM_NAVIGATION_LEFT
key 0x6a SYSTEM_NAVIGATION_RIGHT

View File

@ -1 +0,0 @@
key 0x248 ASSIST

View File

@ -8,16 +8,5 @@
<instance>default</instance>
</interface>
</hal>
<!-- For our Oppo/Realme friends -->
<hal>
<name>android.hardware.biometrics.fingerprint</name>
<transport>hwbinder</transport>
<version>2.1</version>
<interface>
<name>IBiometricsFingerprint</name>
<instance>default</instance>
</interface>
</hal>
</manifest>

View File

@ -1,21 +1,3 @@
BUILD_GMS := yes
#include not inherit, because we must edit some values
-include vendor/google/products/gms_go.mk
-include vendor/partner_gms/products/gms_go.mk
FILTER_OUT = $(foreach v,$(2),$(if $(findstring $(1),$(v)),,$(v)))
#gms_go.mk has a broken copy of google_go.xml => google.xml
#But there already is a google.xml => google.xml
#Only difference between those is maps go and youtube go applinks, so good enough
PRODUCT_COPY_FILES := $(call FILTER_OUT,google_go.xml:, $(PRODUCT_COPY_FILES))
#We need to use this way because it overrides sync adapters
PRODUCT_PACKAGES := $(filter-out CalendarGoogle, $(PRODUCT_PACKAGES))
PRODUCT_PACKAGES := $(filter-out GoogleContacts, $(PRODUCT_PACKAGES))
PRODUCT_SHIPPING_API_LEVEL :=
PRODUCT_PACKAGES += \
phh-gapps-go-overrides \
GoogleContactsSyncAdapter \
DONT_DEXPREOPT_PREBUILTS := true
$(call inherit-product, build/make/target/product/go_defaults.mk)
$(call inherit-product, vendor/gapps-go/gapps-go.mk)

View File

@ -1,29 +1,10 @@
BUILD_GMS := yes
ifneq ($(wildcard vendor/google)$(wildcard vendor/partner_gms),)
-include vendor/google/products/gms.mk
-include vendor/partner_gms/products/gms.mk
PRODUCT_SHIPPING_API_LEVEL :=
PRODUCT_PACKAGES := $(filter-out CalendarGoogle, $(PRODUCT_PACKAGES))
PRODUCT_PACKAGES := $(filter-out GoogleContacts, $(PRODUCT_PACKAGES))
PRODUCT_PACKAGES += \
phh-gapps-overrides \
Chrome \
GoogleContactsSyncAdapter \
talkback \
PRODUCT_SYSTEM_DEFAULT_PROPERTIES := $(filter-out ro.boot.vendor.overlay.theme=%,$(PRODUCT_SYSTEM_DEFAULT_PROPERTIES))
endif
ifneq ($(wildcard vendor/opengapps),)
PRODUCT_COPY_FILES += \
device/phh/treble/empty-permission.xml:system/etc/permissions/com.google.android.camera2.xml \
device/phh/treble/empty-permission.xml:system/etc/permissions/com.google.android.camera.experimental2015.xml \
device/phh/treble/empty-permission.xml:system/etc/permissions/com.google.android.camera.experimental2016.xml \
device/phh/treble/empty-permission.xml:system/etc/permissions/com.google.android.camera.experimental2017.xml
PRODUCT_PACKAGE_OVERLAYS += device/phh/treble/overlay-gapps
DEVICE_PACKAGE_OVERLAYS += device/phh/treble/overlay-gapps
GAPPS_VARIANT := pico
DONT_DEXPREOPT_PREBUILTS := true
WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY := true
@ -39,14 +20,3 @@ PRODUCT_PACKAGES += \
phh-overrides
$(call inherit-product, vendor/opengapps/build/opengapps-packages.mk)
endif
#Pixel Experience gapps
ifneq ($(wildcard vendor/gapps),)
IS_PHONE := true
$(call inherit-product,vendor/gapps/config.mk)
PRODUCT_PACKAGES += \
phh-overrides \
com.simplemobiletools.gallery.pro \
endif

View File

@ -23,7 +23,6 @@ for part in a ab;do
apps_name=""
extra_packages=""
vndk="vndk.mk"
optional_base=""
if [ "$apps" == "gapps" ];then
apps_suffix="g"
apps_script='$(call inherit-product, device/phh/treble/gapps.mk)'
@ -60,39 +59,24 @@ for part in a ab;do
part_suffix='a'
if [ "$part" == 'ab' ];then
part_suffix='b'
else
optional_base='$(call inherit-product, device/phh/treble/base-sas.mk)'
fi
target="treble_${arch}_${part_suffix}${apps_suffix}${su_suffix}"
baseArch="$arch"
if [ "$arch" = "a64" ];then
baseArch="arm"
fi
zygote=32
if [ "$arch" = "arm64" ];then
zygote=64_32
fi
cat > ${target}.mk << EOF
TARGET_GAPPS_ARCH := ${baseArch}
\$(call inherit-product, device/phh/treble/base-pre.mk)
include build/make/target/product/aosp_${baseArch}_ab.mk
include build/make/target/product/treble_common.mk
\$(call inherit-product, vendor/vndk/${vndk})
\$(call inherit-product, device/phh/treble/base.mk)
$optional_base
$apps_script
$rom_script
PRODUCT_NAME := $target
PRODUCT_DEVICE := phhgsi_${arch}_$part
PRODUCT_BRAND := Phh
PRODUCT_SYSTEM_BRAND := Phh
PRODUCT_BRAND := Android
PRODUCT_MODEL := Phh-Treble $apps_name
PRODUCT_PACKAGES += $extra_packages
EOF
echo -e '\t$(LOCAL_DIR)/'$target.mk '\' >> AndroidProducts.mk
done

View File

@ -1,23 +0,0 @@
cc_binary {
name: "android.hardware.biometrics.fingerprint@2.1-service.oplus.compat",
defaults: ["hidl_defaults"],
init_rc: ["android.hardware.biometrics.fingerprint@2.1-service.oplus.rc"],
relative_install_path: "hw",
srcs: [
"BiometricsFingerprint.cpp",
"service.cpp",
],
cflags: [
"-Wno-unused-parameter",
],
shared_libs: [
"libcutils",
"liblog",
"libhidlbase",
"libhardware",
"libutils",
"libbase",
"android.hardware.biometrics.fingerprint@2.1",
"vendor.oplus.hardware.biometrics.fingerprint@2.1",
],
}

View File

@ -1,267 +0,0 @@
/*
* Copyright (C) 2017 The Android Open Source 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.
*/
#define LOG_TAG "android.hardware.biometrics.fingerprint@2.1-service.oplus.compat"
#define LOG_VERBOSE "android.hardware.biometrics.fingerprint@2.1-service.oplus.compat"
#include <hardware/hardware.h>
#include <hardware/fingerprint.h>
#include "BiometricsFingerprint.h"
#include <inttypes.h>
#include <unistd.h>
#include <utils/Log.h>
#include <thread>
namespace android {
namespace hardware {
namespace biometrics {
namespace fingerprint {
namespace V2_1 {
namespace implementation {
BiometricsFingerprint::BiometricsFingerprint() {
for(int i=0; i<10; i++) {
mOplusBiometricsFingerprint = vendor::oplus::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprint::tryGetService();
if(mOplusBiometricsFingerprint != nullptr) break;
sleep(10);
}
if(mOplusBiometricsFingerprint == nullptr) exit(0);
}
static bool receivedCancel;
static bool receivedEnumerate;
static uint64_t myDeviceId;
static std::vector<uint32_t> knownFingers;
class OplusClientCallback : public vendor::oplus::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprintClientCallback {
public:
sp<android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprintClientCallback> mClientCallback;
OplusClientCallback(sp<android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprintClientCallback> clientCallback) : mClientCallback(clientCallback) {}
Return<void> onEnrollResult(uint64_t deviceId, uint32_t fingerId,
uint32_t groupId, uint32_t remaining) {
ALOGE("onEnrollResult %" PRIu64 " %u %u %u", deviceId, fingerId, groupId, remaining);
if(mClientCallback != nullptr)
mClientCallback->onEnrollResult(deviceId, fingerId, groupId, remaining);
return Void();
}
Return<void> onAcquired(uint64_t deviceId, vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo acquiredInfo,
int32_t vendorCode) {
ALOGE("onAcquired %" PRIu64 " %d", deviceId, vendorCode);
if(mClientCallback != nullptr)
mClientCallback->onAcquired(deviceId, OplusToAOSPFingerprintAcquiredInfo(acquiredInfo), vendorCode);
return Void();
}
Return<void> onAuthenticated(uint64_t deviceId, uint32_t fingerId, uint32_t groupId,
const hidl_vec<uint8_t>& token) {
ALOGE("onAuthenticated %" PRIu64 " %u %u", deviceId, fingerId, groupId);
if(mClientCallback != nullptr)
mClientCallback->onAuthenticated(deviceId, fingerId, groupId, token);
return Void();
}
Return<void> onError(uint64_t deviceId, vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintError error, int32_t vendorCode) {
ALOGE("onError %" PRIu64 " %d", deviceId, vendorCode);
if(error == vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_CANCELED) {
receivedCancel = true;
}
if(mClientCallback != nullptr)
mClientCallback->onError(deviceId, OplusToAOSPFingerprintError(error), vendorCode);
return Void();
}
Return<void> onRemoved(uint64_t deviceId, uint32_t fingerId, uint32_t groupId,
uint32_t remaining) {
ALOGE("onRemoved %" PRIu64 " %" PRIu32, deviceId, fingerId);
if(mClientCallback != nullptr)
mClientCallback->onRemoved(deviceId, fingerId, groupId, remaining);
return Void();
}
Return<void> onEnumerate(uint64_t deviceId, uint32_t fingerId, uint32_t groupId,
uint32_t remaining) {
receivedEnumerate = true;
ALOGE("onEnumerate %" PRIu64 " %u %u %u", deviceId, fingerId, groupId, remaining);
if(mClientCallback != nullptr)
mClientCallback->onEnumerate(deviceId, fingerId, groupId, remaining);
return Void();
}
Return<void> onTouchUp(uint64_t deviceId) { return Void(); }
Return<void> onTouchDown(uint64_t deviceId) { return Void(); }
Return<void> onSyncTemplates(uint64_t deviceId, const hidl_vec<uint32_t>& fingerId, uint32_t remaining) {
ALOGE("onSyncTemplates %" PRIu64 " %zu %" PRIu32, deviceId, fingerId.size(), remaining);
myDeviceId = deviceId;
for(auto fid : fingerId) {
ALOGE("\t- %u", fid);
}
knownFingers = fingerId;
return Void();
}
Return<void> onFingerprintCmd(int32_t deviceId, const hidl_vec<uint32_t>& groupId, uint32_t remaining) { return Void(); }
Return<void> onImageInfoAcquired(uint32_t type, uint32_t quality, uint32_t match_score) { return Void(); }
Return<void> onMonitorEventTriggered(uint32_t type, const hidl_string& data) { return Void(); }
Return<void> onEngineeringInfoUpdated(uint32_t length, const hidl_vec<uint32_t>& keys, const hidl_vec<hidl_string>& values) { return Void(); }
Return<void> onUIReady(int64_t deviceId) { return Void(); }
private:
Return<android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo> OplusToAOSPFingerprintAcquiredInfo(vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo info) {
switch(info) {
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_GOOD: return android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_GOOD;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_PARTIAL: return android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_PARTIAL;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_INSUFFICIENT: return android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_INSUFFICIENT;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_IMAGER_DIRTY: return android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_IMAGER_DIRTY;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_TOO_SLOW: return android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_TOO_SLOW;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_TOO_FAST: return android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_TOO_FAST;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_VENDOR: return android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_VENDOR;
default:
return android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_GOOD;
}
}
Return<android::hardware::biometrics::fingerprint::V2_1::FingerprintError> OplusToAOSPFingerprintError(vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintError error) {
switch(error) {
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_NO_ERROR: return android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_NO_ERROR;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_HW_UNAVAILABLE: return android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_HW_UNAVAILABLE;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_UNABLE_TO_PROCESS: return android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_UNABLE_TO_PROCESS;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_TIMEOUT: return android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_TIMEOUT;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_NO_SPACE: return android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_NO_SPACE;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_CANCELED: return android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_CANCELED;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_UNABLE_TO_REMOVE: return android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_UNABLE_TO_REMOVE;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_LOCKOUT: return android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_LOCKOUT;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_VENDOR: return android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_VENDOR;
default:
return android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_NO_ERROR;
}
}
};
Return<uint64_t> BiometricsFingerprint::setNotify(
const sp<IBiometricsFingerprintClientCallback>& clientCallback) {
ALOGE("setNotify");
mOplusClientCallback = new OplusClientCallback(clientCallback);
return mOplusBiometricsFingerprint->setNotify(mOplusClientCallback);
}
Return<RequestStatus> BiometricsFingerprint::OplusToAOSPRequestStatus(vendor::oplus::hardware::biometrics::fingerprint::V2_1::RequestStatus req) {
switch(req) {
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_UNKNOWN: return RequestStatus::SYS_UNKNOWN;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_OK: return RequestStatus::SYS_OK;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_ENOENT: return RequestStatus::SYS_ENOENT;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_EINTR: return RequestStatus::SYS_EINTR;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_EIO: return RequestStatus::SYS_EIO;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_EAGAIN: return RequestStatus::SYS_EAGAIN;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_ENOMEM: return RequestStatus::SYS_ENOMEM;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_EACCES: return RequestStatus::SYS_EACCES;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_EFAULT: return RequestStatus::SYS_EFAULT;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_EBUSY: return RequestStatus::SYS_EBUSY;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_EINVAL: return RequestStatus::SYS_EINVAL;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_ENOSPC: return RequestStatus::SYS_ENOSPC;
case vendor::oplus::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_ETIMEDOUT: return RequestStatus::SYS_ETIMEDOUT;
default:
return RequestStatus::SYS_UNKNOWN;
}
}
Return<uint64_t> BiometricsFingerprint::preEnroll() {
ALOGE("preEnroll");
return mOplusBiometricsFingerprint->preEnroll();
}
Return<RequestStatus> BiometricsFingerprint::enroll(const hidl_array<uint8_t, 69>& hat,
uint32_t gid, uint32_t timeoutSec) {
ALOGE("enroll");
return OplusToAOSPRequestStatus(mOplusBiometricsFingerprint->enroll(hat, gid, timeoutSec));
}
Return<RequestStatus> BiometricsFingerprint::postEnroll() {
ALOGE("postEnroll");
return OplusToAOSPRequestStatus(mOplusBiometricsFingerprint->postEnroll());
}
Return<uint64_t> BiometricsFingerprint::getAuthenticatorId() {
ALOGE("getAuthId");
return mOplusBiometricsFingerprint->getAuthenticatorId();
}
Return<RequestStatus> BiometricsFingerprint::cancel() {
receivedCancel = false;
RequestStatus ret = OplusToAOSPRequestStatus(mOplusBiometricsFingerprint->cancel());
ALOGE("CANCELING");
if(!receivedCancel) {
ALOGE("Sending cancel error");
mOplusClientCallback->mClientCallback->onError(
myDeviceId,
android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_CANCELED,
0);
}
return ret;
}
Return<RequestStatus> BiometricsFingerprint::enumerate() {
receivedEnumerate = false;
RequestStatus ret = OplusToAOSPRequestStatus(mOplusBiometricsFingerprint->enumerate());
ALOGE("ENUMERATING");
if(ret == RequestStatus::SYS_OK && !receivedEnumerate) {
size_t nFingers = knownFingers.size();
ALOGE("received fingers, sending our own %zu", nFingers);
if(nFingers > 0) {
for(auto finger: knownFingers) {
mOplusClientCallback->mClientCallback->onEnumerate(
myDeviceId,
finger,
0,
--nFingers);
}
} else {
mOplusClientCallback->mClientCallback->onEnumerate(
myDeviceId,
0,
0,
0);
}
}
return ret;
}
Return<RequestStatus> BiometricsFingerprint::remove(uint32_t gid, uint32_t fid) {
ALOGE("remove");
return OplusToAOSPRequestStatus(mOplusBiometricsFingerprint->remove(gid, fid));
}
Return<RequestStatus> BiometricsFingerprint::setActiveGroup(uint32_t gid,
const hidl_string& storePath) {
ALOGE("setActiveGroup");
return OplusToAOSPRequestStatus(mOplusBiometricsFingerprint->setActiveGroup(gid, storePath));
}
Return<RequestStatus> BiometricsFingerprint::authenticate(uint64_t operationId, uint32_t gid) {
ALOGE("auth");
return OplusToAOSPRequestStatus(mOplusBiometricsFingerprint->authenticate(operationId, gid));
}
} // namespace implementation
} // namespace V2_1
} // namespace fingerprint
} // namespace biometrics
} // namespace hardware
} // namespace android

View File

@ -1,78 +0,0 @@
/*
* Copyright (C) 2017 The Android Open Source 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.
*/
#ifndef ANDROID_HARDWARE_BIOMETRICS_FINGERPRINT_V2_1_BIOMETRICSFINGERPRINT_H
#define ANDROID_HARDWARE_BIOMETRICS_FINGERPRINT_V2_1_BIOMETRICSFINGERPRINT_H
#include <log/log.h>
#include <android/log.h>
#include <hardware/hardware.h>
#include <hardware/fingerprint.h>
#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>
#include <android/hardware/biometrics/fingerprint/2.1/IBiometricsFingerprint.h>
#include <android/hardware/biometrics/fingerprint/2.1/types.h>
#include <vendor/oplus/hardware/biometrics/fingerprint/2.1/IBiometricsFingerprint.h>
namespace android {
namespace hardware {
namespace biometrics {
namespace fingerprint {
namespace V2_1 {
namespace implementation {
using ::android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprint;
using ::android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprintClientCallback;
using ::android::hardware::biometrics::fingerprint::V2_1::RequestStatus;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::hardware::hidl_vec;
using ::android::hardware::hidl_string;
using ::android::OK;
using ::android::sp;
using ::android::status_t;
class OplusClientCallback;
struct BiometricsFingerprint : public IBiometricsFingerprint {
public:
BiometricsFingerprint();
// Methods from ::android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprint follow.
Return<uint64_t> setNotify(const sp<IBiometricsFingerprintClientCallback>& clientCallback) override;
Return<uint64_t> preEnroll() override;
Return<RequestStatus> enroll(const hidl_array<uint8_t, 69>& hat, uint32_t gid, uint32_t timeoutSec) override;
Return<RequestStatus> postEnroll() override;
Return<uint64_t> getAuthenticatorId() override;
Return<RequestStatus> cancel() override;
Return<RequestStatus> enumerate() override;
Return<RequestStatus> remove(uint32_t gid, uint32_t fid) override;
Return<RequestStatus> setActiveGroup(uint32_t gid, const hidl_string& storePath) override;
Return<RequestStatus> authenticate(uint64_t operationId, uint32_t gid) override;
private:
sp<vendor::oplus::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprint> mOplusBiometricsFingerprint;
sp<OplusClientCallback> mOplusClientCallback;
static Return<RequestStatus> OplusToAOSPRequestStatus(vendor::oplus::hardware::biometrics::fingerprint::V2_1::RequestStatus req);
};
} // namespace implementation
} // namespace V2_1
} // namespace fingerprint
} // namespace biometrics
} // namespace hardware
} // namespace android
#endif // ANDROID_HARDWARE_BIOMETRICS_FINGERPRINT_V2_1_BIOMETRICSFINGERPRINT_H

View File

@ -1,9 +0,0 @@
service fps_hal.oplus.compat /system/bin/hw/android.hardware.biometrics.fingerprint@2.1-service.oplus.compat
# "class hal" causes a race condition on some devices due to files created
# in /data. As a workaround, postpone startup until later in boot once
# /data is mounted.
class late_start
user system
group system input uhid
writepid /dev/cpuset/system-background/tasks
oneshot

View File

@ -1,61 +0,0 @@
/*
* Copyright (C) 2017 The Android Open Source 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.
*/
#define LOG_TAG "android.hardware.biometrics.fingerprint@2.1-service.realme_sdm710"
#include <android-base/logging.h>
#include <hidl/HidlTransportSupport.h>
#include "BiometricsFingerprint.h"
using android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprint;
using android::hardware::biometrics::fingerprint::V2_1::implementation::BiometricsFingerprint;
using android::hardware::configureRpcThreadpool;
using android::hardware::joinRpcThreadpool;
using android::OK;
using android::sp;
using android::status_t;
int main() {
sp<BiometricsFingerprint> biometricsFingerprint;
status_t status;
LOG(INFO) << "Fingerprint HAL Adapter service is starting.";
biometricsFingerprint = new BiometricsFingerprint();
if (biometricsFingerprint == nullptr) {
LOG(ERROR) << "Can not create an instance of Fingerprint HAL Adapter BiometricsFingerprint Iface, exiting.";
goto shutdown;
}
configureRpcThreadpool(1, true /*callerWillJoin*/);
status = biometricsFingerprint->registerAsService();
if (status != OK) {
LOG(ERROR) << "Could not register service for Fingerprint HAL Adapter BiometricsFingerprint Iface ("
<< status << ")";
goto shutdown;
}
LOG(INFO) << "Fingerprint HAL Adapter service is ready.";
joinRpcThreadpool();
// Should not pass this line
shutdown:
// In normal operation, we don't expect the thread pool to shutdown
LOG(ERROR) << "Fingerprint HAL Adapter service is shutting down.";
return 1;
}

View File

@ -1,23 +0,0 @@
cc_binary {
name: "android.hardware.biometrics.fingerprint@2.1-service.oppo.compat",
defaults: ["hidl_defaults"],
init_rc: ["android.hardware.biometrics.fingerprint@2.1-service.oppo.rc"],
relative_install_path: "hw",
srcs: [
"BiometricsFingerprint.cpp",
"service.cpp",
],
cflags: [
"-Wno-unused-parameter",
],
shared_libs: [
"libcutils",
"liblog",
"libhidlbase",
"libhardware",
"libutils",
"libbase",
"android.hardware.biometrics.fingerprint@2.1",
"vendor.oppo.hardware.biometrics.fingerprint@2.1",
],
}

View File

@ -1,267 +0,0 @@
/*
* Copyright (C) 2017 The Android Open Source 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.
*/
#define LOG_TAG "android.hardware.biometrics.fingerprint@2.1-service.oppo.compat"
#define LOG_VERBOSE "android.hardware.biometrics.fingerprint@2.1-service.oppo.compat"
#include <hardware/hardware.h>
#include <hardware/fingerprint.h>
#include "BiometricsFingerprint.h"
#include <inttypes.h>
#include <unistd.h>
#include <utils/Log.h>
#include <thread>
namespace android {
namespace hardware {
namespace biometrics {
namespace fingerprint {
namespace V2_1 {
namespace implementation {
BiometricsFingerprint::BiometricsFingerprint() {
for(int i=0; i<10; i++) {
mOppoBiometricsFingerprint = vendor::oppo::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprint::tryGetService();
if(mOppoBiometricsFingerprint != nullptr) break;
sleep(10);
}
if(mOppoBiometricsFingerprint == nullptr) exit(0);
}
static bool receivedCancel;
static bool receivedEnumerate;
static uint64_t myDeviceId;
static std::vector<uint32_t> knownFingers;
class OppoClientCallback : public vendor::oppo::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprintClientCallback {
public:
sp<android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprintClientCallback> mClientCallback;
OppoClientCallback(sp<android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprintClientCallback> clientCallback) : mClientCallback(clientCallback) {}
Return<void> onEnrollResult(uint64_t deviceId, uint32_t fingerId,
uint32_t groupId, uint32_t remaining) {
ALOGE("onEnrollResult %" PRIu64 " %u %u %u", deviceId, fingerId, groupId, remaining);
if(mClientCallback != nullptr)
mClientCallback->onEnrollResult(deviceId, fingerId, groupId, remaining);
return Void();
}
Return<void> onAcquired(uint64_t deviceId, vendor::oppo::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo acquiredInfo,
int32_t vendorCode) {
ALOGE("onAcquired %" PRIu64 " %d", deviceId, vendorCode);
if(mClientCallback != nullptr)
mClientCallback->onAcquired(deviceId, OppoToAOSPFingerprintAcquiredInfo(acquiredInfo), vendorCode);
return Void();
}
Return<void> onAuthenticated(uint64_t deviceId, uint32_t fingerId, uint32_t groupId,
const hidl_vec<uint8_t>& token) {
ALOGE("onAuthenticated %" PRIu64 " %u %u", deviceId, fingerId, groupId);
if(mClientCallback != nullptr)
mClientCallback->onAuthenticated(deviceId, fingerId, groupId, token);
return Void();
}
Return<void> onError(uint64_t deviceId, vendor::oppo::hardware::biometrics::fingerprint::V2_1::FingerprintError error, int32_t vendorCode) {
ALOGE("onError %" PRIu64 " %d", deviceId, vendorCode);
if(error == vendor::oppo::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_CANCELED) {
receivedCancel = true;
}
if(mClientCallback != nullptr)
mClientCallback->onError(deviceId, OppoToAOSPFingerprintError(error), vendorCode);
return Void();
}
Return<void> onRemoved(uint64_t deviceId, uint32_t fingerId, uint32_t groupId,
uint32_t remaining) {
ALOGE("onRemoved %" PRIu64 " %" PRIu32, deviceId, fingerId);
if(mClientCallback != nullptr)
mClientCallback->onRemoved(deviceId, fingerId, groupId, remaining);
return Void();
}
Return<void> onEnumerate(uint64_t deviceId, uint32_t fingerId, uint32_t groupId,
uint32_t remaining) {
receivedEnumerate = true;
ALOGE("onEnumerate %" PRIu64 " %u %u %u", deviceId, fingerId, groupId, remaining);
if(mClientCallback != nullptr)
mClientCallback->onEnumerate(deviceId, fingerId, groupId, remaining);
return Void();
}
Return<void> onTouchUp(uint64_t deviceId) { return Void(); }
Return<void> onTouchDown(uint64_t deviceId) { return Void(); }
Return<void> onSyncTemplates(uint64_t deviceId, const hidl_vec<uint32_t>& fingerId, uint32_t remaining) {
ALOGE("onSyncTemplates %" PRIu64 " %zu %" PRIu32, deviceId, fingerId.size(), remaining);
myDeviceId = deviceId;
for(auto fid : fingerId) {
ALOGE("\t- %u", fid);
}
knownFingers = fingerId;
return Void();
}
Return<void> onFingerprintCmd(int32_t deviceId, const hidl_vec<uint32_t>& groupId, uint32_t remaining) { return Void(); }
Return<void> onImageInfoAcquired(uint32_t type, uint32_t quality, uint32_t match_score) { return Void(); }
Return<void> onMonitorEventTriggered(uint32_t type, const hidl_string& data) { return Void(); }
Return<void> onEngineeringInfoUpdated(uint32_t length, const hidl_vec<uint32_t>& keys, const hidl_vec<hidl_string>& values) { return Void(); }
Return<void> onUIReady(int64_t deviceId) { return Void(); }
private:
Return<android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo> OppoToAOSPFingerprintAcquiredInfo(vendor::oppo::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo info) {
switch(info) {
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_GOOD: return android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_GOOD;
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_PARTIAL: return android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_PARTIAL;
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_INSUFFICIENT: return android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_INSUFFICIENT;
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_IMAGER_DIRTY: return android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_IMAGER_DIRTY;
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_TOO_SLOW: return android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_TOO_SLOW;
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_TOO_FAST: return android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_TOO_FAST;
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_VENDOR: return android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_VENDOR;
default:
return android::hardware::biometrics::fingerprint::V2_1::FingerprintAcquiredInfo::ACQUIRED_GOOD;
}
}
Return<android::hardware::biometrics::fingerprint::V2_1::FingerprintError> OppoToAOSPFingerprintError(vendor::oppo::hardware::biometrics::fingerprint::V2_1::FingerprintError error) {
switch(error) {
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_NO_ERROR: return android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_NO_ERROR;
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_HW_UNAVAILABLE: return android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_HW_UNAVAILABLE;
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_UNABLE_TO_PROCESS: return android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_UNABLE_TO_PROCESS;
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_TIMEOUT: return android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_TIMEOUT;
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_NO_SPACE: return android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_NO_SPACE;
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_CANCELED: return android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_CANCELED;
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_UNABLE_TO_REMOVE: return android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_UNABLE_TO_REMOVE;
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_LOCKOUT: return android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_LOCKOUT;
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_VENDOR: return android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_VENDOR;
default:
return android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_NO_ERROR;
}
}
};
Return<uint64_t> BiometricsFingerprint::setNotify(
const sp<IBiometricsFingerprintClientCallback>& clientCallback) {
ALOGE("setNotify");
mOppoClientCallback = new OppoClientCallback(clientCallback);
return mOppoBiometricsFingerprint->setNotify(mOppoClientCallback);
}
Return<RequestStatus> BiometricsFingerprint::OppoToAOSPRequestStatus(vendor::oppo::hardware::biometrics::fingerprint::V2_1::RequestStatus req) {
switch(req) {
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_UNKNOWN: return RequestStatus::SYS_UNKNOWN;
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_OK: return RequestStatus::SYS_OK;
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_ENOENT: return RequestStatus::SYS_ENOENT;
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_EINTR: return RequestStatus::SYS_EINTR;
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_EIO: return RequestStatus::SYS_EIO;
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_EAGAIN: return RequestStatus::SYS_EAGAIN;
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_ENOMEM: return RequestStatus::SYS_ENOMEM;
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_EACCES: return RequestStatus::SYS_EACCES;
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_EFAULT: return RequestStatus::SYS_EFAULT;
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_EBUSY: return RequestStatus::SYS_EBUSY;
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_EINVAL: return RequestStatus::SYS_EINVAL;
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_ENOSPC: return RequestStatus::SYS_ENOSPC;
case vendor::oppo::hardware::biometrics::fingerprint::V2_1::RequestStatus::SYS_ETIMEDOUT: return RequestStatus::SYS_ETIMEDOUT;
default:
return RequestStatus::SYS_UNKNOWN;
}
}
Return<uint64_t> BiometricsFingerprint::preEnroll() {
ALOGE("preEnroll");
return mOppoBiometricsFingerprint->preEnroll();
}
Return<RequestStatus> BiometricsFingerprint::enroll(const hidl_array<uint8_t, 69>& hat,
uint32_t gid, uint32_t timeoutSec) {
ALOGE("enroll");
return OppoToAOSPRequestStatus(mOppoBiometricsFingerprint->enroll(hat, gid, timeoutSec));
}
Return<RequestStatus> BiometricsFingerprint::postEnroll() {
ALOGE("postEnroll");
return OppoToAOSPRequestStatus(mOppoBiometricsFingerprint->postEnroll());
}
Return<uint64_t> BiometricsFingerprint::getAuthenticatorId() {
ALOGE("getAuthId");
return mOppoBiometricsFingerprint->getAuthenticatorId();
}
Return<RequestStatus> BiometricsFingerprint::cancel() {
receivedCancel = false;
RequestStatus ret = OppoToAOSPRequestStatus(mOppoBiometricsFingerprint->cancel());
ALOGE("CANCELING");
if(!receivedCancel) {
ALOGE("Sending cancel error");
mOppoClientCallback->mClientCallback->onError(
myDeviceId,
android::hardware::biometrics::fingerprint::V2_1::FingerprintError::ERROR_CANCELED,
0);
}
return ret;
}
Return<RequestStatus> BiometricsFingerprint::enumerate() {
receivedEnumerate = false;
RequestStatus ret = OppoToAOSPRequestStatus(mOppoBiometricsFingerprint->enumerate());
ALOGE("ENUMERATING");
if(ret == RequestStatus::SYS_OK && !receivedEnumerate) {
size_t nFingers = knownFingers.size();
ALOGE("received fingers, sending our own %zu", nFingers);
if(nFingers > 0) {
for(auto finger: knownFingers) {
mOppoClientCallback->mClientCallback->onEnumerate(
myDeviceId,
finger,
0,
--nFingers);
}
} else {
mOppoClientCallback->mClientCallback->onEnumerate(
myDeviceId,
0,
0,
0);
}
}
return ret;
}
Return<RequestStatus> BiometricsFingerprint::remove(uint32_t gid, uint32_t fid) {
ALOGE("remove");
return OppoToAOSPRequestStatus(mOppoBiometricsFingerprint->remove(gid, fid));
}
Return<RequestStatus> BiometricsFingerprint::setActiveGroup(uint32_t gid,
const hidl_string& storePath) {
ALOGE("setActiveGroup");
return OppoToAOSPRequestStatus(mOppoBiometricsFingerprint->setActiveGroup(gid, storePath));
}
Return<RequestStatus> BiometricsFingerprint::authenticate(uint64_t operationId, uint32_t gid) {
ALOGE("auth");
return OppoToAOSPRequestStatus(mOppoBiometricsFingerprint->authenticate(operationId, gid));
}
} // namespace implementation
} // namespace V2_1
} // namespace fingerprint
} // namespace biometrics
} // namespace hardware
} // namespace android

View File

@ -1,78 +0,0 @@
/*
* Copyright (C) 2017 The Android Open Source 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.
*/
#ifndef ANDROID_HARDWARE_BIOMETRICS_FINGERPRINT_V2_1_BIOMETRICSFINGERPRINT_H
#define ANDROID_HARDWARE_BIOMETRICS_FINGERPRINT_V2_1_BIOMETRICSFINGERPRINT_H
#include <log/log.h>
#include <android/log.h>
#include <hardware/hardware.h>
#include <hardware/fingerprint.h>
#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>
#include <android/hardware/biometrics/fingerprint/2.1/IBiometricsFingerprint.h>
#include <android/hardware/biometrics/fingerprint/2.1/types.h>
#include <vendor/oppo/hardware/biometrics/fingerprint/2.1/IBiometricsFingerprint.h>
namespace android {
namespace hardware {
namespace biometrics {
namespace fingerprint {
namespace V2_1 {
namespace implementation {
using ::android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprint;
using ::android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprintClientCallback;
using ::android::hardware::biometrics::fingerprint::V2_1::RequestStatus;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::hardware::hidl_vec;
using ::android::hardware::hidl_string;
using ::android::OK;
using ::android::sp;
using ::android::status_t;
class OppoClientCallback;
struct BiometricsFingerprint : public IBiometricsFingerprint {
public:
BiometricsFingerprint();
// Methods from ::android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprint follow.
Return<uint64_t> setNotify(const sp<IBiometricsFingerprintClientCallback>& clientCallback) override;
Return<uint64_t> preEnroll() override;
Return<RequestStatus> enroll(const hidl_array<uint8_t, 69>& hat, uint32_t gid, uint32_t timeoutSec) override;
Return<RequestStatus> postEnroll() override;
Return<uint64_t> getAuthenticatorId() override;
Return<RequestStatus> cancel() override;
Return<RequestStatus> enumerate() override;
Return<RequestStatus> remove(uint32_t gid, uint32_t fid) override;
Return<RequestStatus> setActiveGroup(uint32_t gid, const hidl_string& storePath) override;
Return<RequestStatus> authenticate(uint64_t operationId, uint32_t gid) override;
private:
sp<vendor::oppo::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprint> mOppoBiometricsFingerprint;
sp<OppoClientCallback> mOppoClientCallback;
static Return<RequestStatus> OppoToAOSPRequestStatus(vendor::oppo::hardware::biometrics::fingerprint::V2_1::RequestStatus req);
};
} // namespace implementation
} // namespace V2_1
} // namespace fingerprint
} // namespace biometrics
} // namespace hardware
} // namespace android
#endif // ANDROID_HARDWARE_BIOMETRICS_FINGERPRINT_V2_1_BIOMETRICSFINGERPRINT_H

View File

@ -1,9 +0,0 @@
service fps_hal.oppo.compat /system/bin/hw/android.hardware.biometrics.fingerprint@2.1-service.oppo.compat
# "class hal" causes a race condition on some devices due to files created
# in /data. As a workaround, postpone startup until later in boot once
# /data is mounted.
class late_start
user system
group system input uhid
writepid /dev/cpuset/system-background/tasks
oneshot

View File

@ -1,61 +0,0 @@
/*
* Copyright (C) 2017 The Android Open Source 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.
*/
#define LOG_TAG "android.hardware.biometrics.fingerprint@2.1-service.realme_sdm710"
#include <android-base/logging.h>
#include <hidl/HidlTransportSupport.h>
#include "BiometricsFingerprint.h"
using android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprint;
using android::hardware::biometrics::fingerprint::V2_1::implementation::BiometricsFingerprint;
using android::hardware::configureRpcThreadpool;
using android::hardware::joinRpcThreadpool;
using android::OK;
using android::sp;
using android::status_t;
int main() {
sp<BiometricsFingerprint> biometricsFingerprint;
status_t status;
LOG(INFO) << "Fingerprint HAL Adapter service is starting.";
biometricsFingerprint = new BiometricsFingerprint();
if (biometricsFingerprint == nullptr) {
LOG(ERROR) << "Can not create an instance of Fingerprint HAL Adapter BiometricsFingerprint Iface, exiting.";
goto shutdown;
}
configureRpcThreadpool(1, true /*callerWillJoin*/);
status = biometricsFingerprint->registerAsService();
if (status != OK) {
LOG(ERROR) << "Could not register service for Fingerprint HAL Adapter BiometricsFingerprint Iface ("
<< status << ")";
goto shutdown;
}
LOG(INFO) << "Fingerprint HAL Adapter service is ready.";
joinRpcThreadpool();
// Should not pass this line
shutdown:
// In normal operation, we don't expect the thread pool to shutdown
LOG(ERROR) << "Fingerprint HAL Adapter service is shutting down.";
return 1;
}

View File

@ -1,3 +1,3 @@
$(call inherit-product, vendor/havoc/config/common_full_phone.mk)
$(call inherit-product, vendor/havoc/config/common.mk)
$(call inherit-product, device/havoc/sepolicy/common/sepolicy.mk)
-include vendor/havoc/build/core/config.mk

View File

@ -1,7 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<permissions>
<library name="android.hidl.manager.V1_0"
file="/system/framework/android.hidl.manager-V1.0-java.jar" />
<library name="vendor.qti.qcril.am.V1_0"
file="/system/framework/vendor.qti.qcril.am-V1.0-java.jar" />
<library name="vendor.qti.hardware.radio.am.V1_0"

View File

@ -3,214 +3,44 @@
# Bionic loader config file.
#
# Don't change the order here. The first pattern that matches with the
# absolute path of an executable is selected.
# Don't change the order here.
dir.system = /system/bin/
dir.system = /system/xbin/
dir.system = /system/product/bin/
dir.vendor = /odm/bin/
dir.vendor = /vendor/bin/
dir.vendor = /data/nativetest/odm
dir.vendor = /data/nativetest64/odm
dir.vendor = /data/benchmarktest/odm
dir.vendor = /data/benchmarktest64/odm
dir.vendor = /data/nativetest/vendor
dir.vendor = /data/nativetest64/vendor
dir.vendor = /data/benchmarktest/vendor
dir.vendor = /data/benchmarktest64/vendor
dir.unrestricted = /data/nativetest/unrestricted
dir.unrestricted = /data/nativetest64/unrestricted
# TODO(b/123864775): Ensure tests are run from /data/nativetest{,64} or (if
# necessary) the unrestricted subdirs above. Then clean this up.
dir.unrestricted = /data/local/tmp
dir.postinstall = /postinstall
# Fallback entry to provide APEX namespace lookups for binaries anywhere else.
# This must be last.
dir.system = /data
dir.system = /data/nativetest
dir.system = /data/nativetest64
dir.system = /data/benchmarktest
dir.system = /data/benchmarktest64
[system]
additional.namespaces = runtime,conscrypt,media,resolv,sphal,vndk,rs
additional.namespaces = sphal,vndk,rs
###############################################################################
# "default" namespace
#
# Framework-side code runs in this namespace. Libs from /vendor partition
# Framework-side code runs in this namespace. Anything from /vendor partition
# can't be loaded in this namespace.
###############################################################################
namespace.default.isolated = true
namespace.default.isolated = false
namespace.default.search.paths = /system/${LIB}:/vendor/${LIB}
namespace.default.permitted.paths = /system/${LIB}:/vendor/${LIB}
namespace.default.search.paths = /system/${LIB}
namespace.default.search.paths += /system/product/${LIB}
namespace.default.asan.search.paths = /data/asan/system/${LIB}:/system/${LIB}:/data/asan/vendor/${LIB}:/vendor/${LIB}
namespace.default.asan.permitted.paths = /data/asan/system/${LIB}:/system/${LIB}:/data/asan/vendor/${LIB}:/vendor/${LIB}
# We can't have entire /system/${LIB} as permitted paths because doing so
# makes it possible to load libs in /system/${LIB}/vndk* directories by
# their absolute paths (e.g. dlopen("/system/lib/vndk/libbase.so");).
# VNDK libs are built with previous versions of Android and thus must not be
# loaded into this namespace where libs built with the current version of
# Android are loaded. Mixing the two types of libs in the same namespace can
# cause unexpected problem.
namespace.default.permitted.paths = /system/${LIB}/drm
namespace.default.permitted.paths += /system/${LIB}/extractors
namespace.default.permitted.paths += /system/${LIB}/hw
namespace.default.permitted.paths += /system/product/${LIB}
# These are where odex files are located. libart has to be able to dlopen the files
namespace.default.permitted.paths += /system/framework
namespace.default.permitted.paths += /system/app
namespace.default.permitted.paths += /system/priv-app
namespace.default.permitted.paths += /vendor/framework
namespace.default.permitted.paths += /vendor/app
namespace.default.permitted.paths += /vendor/priv-app
namespace.default.permitted.paths += /system/vendor/framework
namespace.default.permitted.paths += /system/vendor/app
namespace.default.permitted.paths += /system/vendor/priv-app
namespace.default.permitted.paths += /odm/framework
namespace.default.permitted.paths += /odm/app
namespace.default.permitted.paths += /odm/priv-app
namespace.default.permitted.paths += /oem/app
namespace.default.permitted.paths += /system/product/framework
namespace.default.permitted.paths += /system/product/app
namespace.default.permitted.paths += /system/product/priv-app
namespace.default.permitted.paths += /data
namespace.default.permitted.paths += /mnt/expand
namespace.default.permitted.paths += /apex/com.android.runtime/${LIB}/bionic
namespace.default.permitted.paths += /system/${LIB}/bootstrap
namespace.default.asan.search.paths = /data/asan/system/${LIB}
namespace.default.asan.search.paths += /system/${LIB}
namespace.default.asan.search.paths += /data/asan/system/product/${LIB}
namespace.default.asan.search.paths += /system/product/${LIB}
namespace.default.asan.permitted.paths = /data
namespace.default.asan.permitted.paths += /system/${LIB}/drm
namespace.default.asan.permitted.paths += /system/${LIB}/extractors
namespace.default.asan.permitted.paths += /system/${LIB}/hw
namespace.default.asan.permitted.paths += /system/framework
namespace.default.asan.permitted.paths += /system/app
namespace.default.asan.permitted.paths += /system/priv-app
namespace.default.asan.permitted.paths += /vendor/framework
namespace.default.asan.permitted.paths += /vendor/app
namespace.default.asan.permitted.paths += /vendor/priv-app
namespace.default.asan.permitted.paths += /system/vendor/framework
namespace.default.asan.permitted.paths += /system/vendor/app
namespace.default.asan.permitted.paths += /system/vendor/priv-app
namespace.default.asan.permitted.paths += /odm/framework
namespace.default.asan.permitted.paths += /odm/app
namespace.default.asan.permitted.paths += /odm/priv-app
namespace.default.asan.permitted.paths += /oem/app
namespace.default.asan.permitted.paths += /system/product/${LIB}
namespace.default.asan.permitted.paths += /system/product/framework
namespace.default.asan.permitted.paths += /system/product/app
namespace.default.asan.permitted.paths += /system/product/priv-app
namespace.default.asan.permitted.paths += /mnt/expand
namespace.default.asan.permitted.paths += /apex/com.android.runtime/${LIB}/bionic
namespace.default.asan.permitted.paths += /system/${LIB}/bootstrap
# Keep in sync with ld.config.txt in the com.android.runtime APEX.
# If a shared library or an executable requests a shared library that
# cannot be loaded into the default namespace, the dynamic linker tries
# to load the shared library from the runtime namespace. And then, if the
# shared library cannot be loaded from the runtime namespace either, the
# dynamic linker tries to load the shared library from the resolv namespace.
# Finally, if all attempts fail, the dynamic linker returns an error.
namespace.default.links = runtime,resolv
# Visible because some libraries are dlopen'ed, e.g. libopenjdk is dlopen'ed by
# libart.
namespace.default.visible = true
namespace.default.link.runtime.shared_libs = libdexfile_external.so
# libicuuc.so and libicui18n.so are kept for app compat reason. http://b/130788466
namespace.default.link.runtime.shared_libs += libicui18n.so
namespace.default.link.runtime.shared_libs += libicuuc.so
namespace.default.link.runtime.shared_libs += libnativebridge.so
namespace.default.link.runtime.shared_libs += libnativehelper.so
namespace.default.link.runtime.shared_libs += libnativeloader.so
namespace.default.link.runtime.shared_libs += libandroidicu.so
# TODO(b/122876336): Remove libpac.so once it's migrated to Webview
namespace.default.link.runtime.shared_libs += libpac.so
# When libnetd_resolv.so can't be found in the default namespace, search for it
# in the resolv namespace. Don't allow any other libraries from the resolv namespace
# to be loaded in the default namespace.
namespace.default.link.resolv.shared_libs = libnetd_resolv.so
###############################################################################
# "runtime" APEX namespace
# TODO(b/37013858): remove all dependencies to /vendor/lib from system processes
# When this is done, comment out following three lines and remove the three
# lines above
#namespace.default.isolated = true
#namespace.default.search.paths = /system/${LIB}
#namespace.default.permitted.paths = /system/${LIB}
#
# This namespace exposes externally accessible libraries from the Runtime APEX.
###############################################################################
namespace.runtime.isolated = true
namespace.runtime.visible = true
# Keep in sync with ld.config.txt in the com.android.runtime APEX.
namespace.runtime.search.paths = /apex/com.android.runtime/${LIB}
namespace.runtime.asan.search.paths = /apex/com.android.runtime/${LIB}
namespace.runtime.links = default
# TODO(b/119867084): Restrict to Bionic dlopen dependencies and PALette library
# when it exists.
namespace.runtime.link.default.allow_all_shared_libs = true
###############################################################################
# "media" APEX namespace
#
# This namespace is for libraries within the media APEX.
###############################################################################
namespace.media.isolated = true
namespace.media.visible = true
namespace.media.search.paths = /apex/com.android.media/${LIB}
namespace.media.asan.search.paths = /apex/com.android.media/${LIB}
namespace.media.permitted.paths = /apex/com.android.media/${LIB}/extractors
namespace.media.asan.permitted.paths = /apex/com.android.media/${LIB}/extractors
namespace.media.links = default
namespace.media.link.default.shared_libs = libEGL.so:libGLESv1_CM.so:libGLESv2.so:libGLESv3.so:libRS.so:libandroid_net.so:libc.so:libdl.so:libft2.so:liblog.so:libm.so:libmediandk.so:libnativewindow.so:libsync.so:libvndksupport.so
namespace.media.link.default.shared_libs += libbinder_ndk.so
namespace.media.link.default.shared_libs += libcgrouprc.so
namespace.media.link.default.shared_libs += libmediametrics.so
namespace.media.link.default.shared_libs += libclang_rt.asan-arm-android.so:libclang_rt.hwasan-arm-android.so:libclang_rt.ubsan_standalone-arm-android.so:libclang_rt.tsan-arm-android.so
###############################################################################
# "conscrypt" APEX namespace
#
# This namespace is for libraries within the conscrypt APEX.
###############################################################################
namespace.conscrypt.isolated = true
namespace.conscrypt.visible = true
# Keep in sync with ld.config.txt in the com.android.runtime APEX.
namespace.conscrypt.search.paths = /apex/com.android.conscrypt/${LIB}
namespace.conscrypt.asan.search.paths = /apex/com.android.conscrypt/${LIB}
namespace.conscrypt.links = runtime,default
namespace.conscrypt.link.runtime.shared_libs = libandroidio.so
namespace.conscrypt.link.default.shared_libs = libc.so
namespace.conscrypt.link.default.shared_libs += libm.so
namespace.conscrypt.link.default.shared_libs += libdl.so
namespace.conscrypt.link.default.shared_libs += liblog.so
###############################################################################
# "resolv" APEX namespace
#
# This namespace is for libraries within the resolv APEX.
###############################################################################
namespace.resolv.isolated = true
namespace.resolv.visible = true
namespace.resolv.search.paths = /apex/com.android.resolv/${LIB}
namespace.resolv.asan.search.paths = /apex/com.android.resolv/${LIB}
namespace.resolv.links = default
namespace.resolv.link.default.shared_libs = libc.so
namespace.resolv.link.default.shared_libs += libcgrouprc.so
namespace.resolv.link.default.shared_libs += libm.so
namespace.resolv.link.default.shared_libs += libdl.so
namespace.resolv.link.default.shared_libs += libbinder_ndk.so
namespace.resolv.link.default.shared_libs += liblog.so
namespace.resolv.link.default.shared_libs += libvndksupport.so
#namespace.default.asan.search.paths = /data/asan/system/${LIB}:/system/${LIB}
#namespace.default.asan.permitted.paths = /data/asan/system/${LIB}:/system/${LIB}
###############################################################################
# "sphal" namespace
@ -227,39 +57,25 @@ namespace.resolv.link.default.shared_libs += libvndksupport.so
###############################################################################
namespace.sphal.isolated = true
namespace.sphal.visible = true
namespace.sphal.search.paths = /vendor/${LIB}/egl:/vendor/${LIB}/hw:/vendor/${LIB}
namespace.sphal.permitted.paths = /vendor/${LIB}:/system/${LIB}/vndk-sp-26/hw:/system/${LIB}/vndk-sp-27/hw
namespace.sphal.search.paths = /odm/${LIB}
namespace.sphal.search.paths += /vendor/${LIB}
namespace.sphal.search.paths += /vendor/${LIB}/hw
namespace.sphal.permitted.paths = /odm/${LIB}
namespace.sphal.permitted.paths += /vendor/${LIB}
namespace.sphal.permitted.paths += /system/vendor/${LIB}
namespace.sphal.asan.search.paths = /data/asan/odm/${LIB}
namespace.sphal.asan.search.paths += /odm/${LIB}
namespace.sphal.asan.search.paths += /data/asan/vendor/${LIB}
namespace.sphal.asan.search.paths += /vendor/${LIB}
namespace.sphal.asan.permitted.paths = /data/asan/odm/${LIB}
namespace.sphal.asan.permitted.paths += /odm/${LIB}
namespace.sphal.asan.permitted.paths += /data/asan/vendor/${LIB}
namespace.sphal.asan.permitted.paths += /vendor/${LIB}
namespace.sphal.asan.search.paths = /data/asan/vendor/${LIB}/egl:/vendor/${LIB}/egl:/data/asan/vendor/${LIB}/hw:/vendor/${LIB}/hw:/data/asan/vendor/${LIB}:/vendor/${LIB}
namespace.sphal.asan.permitted.paths = /data/asan/vendor/${LIB}:/vendor/${LIB}
# Once in this namespace, access to libraries in /system/lib is restricted. Only
# libs listed here can be used. Order is important here as the namespaces are
# tried in this order. rs should be before vndk because both are capable
# of loading libRS_internal.so
namespace.sphal.links = rs,default,vndk
# libs listed here can be used.
namespace.sphal.links = default,vndk,rs
# WARNING: only NDK libs can be listed here.
namespace.sphal.link.default.shared_libs = libc.so:libm.so:libdl.so:libstdc++.so:liblog.so:libnativewindow.so:libEGL.so:libsync.so:libGLESv1_CM.so:libGLESv2.so:libvndksupport.so:libz.so
# WARNING: only VNDK-SP libs can be listed here. DO NOT EDIT this line.
namespace.sphal.link.vndk.shared_libs = android.hardware.renderscript@1.0.so:android.hardware.graphics.allocator@2.0.so:android.hardware.graphics.mapper@2.0.so:android.hardware.graphics.common@1.0.so:android.hidl.memory@1.0.so:libhwbinder.so:libbase.so:libcutils.so:libhardware.so:libhidlbase.so:libhidlmemory.so:libhidltransport.so:libion.so:libutils.so:libc++.so:android.hidl.base@1.0.so:libion.so
# Renderscript gets separate namespace
namespace.sphal.link.rs.shared_libs = libRS_internal.so
namespace.sphal.link.default.shared_libs = libEGL.so:libGLESv1_CM.so:libGLESv2.so:libGLESv3.so:libRS.so:libandroid_net.so:libc.so:libdl.so:libft2.so:liblog.so:libm.so:libmediandk.so:libnativewindow.so:libsync.so:libvndksupport.so
namespace.sphal.link.default.shared_libs += libclang_rt.asan-arm-android.so:libclang_rt.hwasan-arm-android.so:libclang_rt.ubsan_standalone-arm-android.so:libclang_rt.tsan-arm-android.so
namespace.sphal.link.vndk.shared_libs = android.hardware.graphics.allocator@2.0.so:android.hardware.graphics.common@1.0.so:android.hardware.graphics.mapper@2.0.so:android.hardware.renderscript@1.0.so:android.hidl.base@1.0.so:android.hidl.memory@1.0.so:android.hidl.memory@1.0-impl.so:libRSCpuRef.so:libRSDriver.so:libRS_internal.so:libbacktrace.so:libbase.so:libbcinfo.so:libblas.so:libc++.so:libcompiler_rt.so:libcutils.so:libhardware.so:libhidlbase.so:libhidlmemory.so:libhidltransport.so:libhwbinder.so:libion.so:liblzma.so:libunwind.so:libutils.so:libz.so
###############################################################################
# "rs" namespace
#
@ -270,44 +86,15 @@ namespace.sphal.link.vndk.shared_libs = android.hardware.graphics.allocator@2.0.
###############################################################################
namespace.rs.isolated = true
namespace.rs.visible = true
namespace.rs.search.paths = /vendor/${LIB}/vndk-sp:/system/${LIB}/vndk-sp-26:/vendor/${LIB}
namespace.rs.permitted.paths = /vendor/${LIB}:/data
namespace.rs.search.paths = /odm/${LIB}/vndk-sp
namespace.rs.search.paths += /vendor/${LIB}/vndk-sp
namespace.rs.search.paths += /system/${LIB}/vndk-sp-26
namespace.rs.search.paths += /odm/${LIB}
namespace.rs.search.paths += /vendor/${LIB}
namespace.rs.permitted.paths = /odm/${LIB}
namespace.rs.permitted.paths += /vendor/${LIB}
namespace.rs.permitted.paths += /system/vendor/${LIB}
namespace.rs.permitted.paths += /data
namespace.rs.asan.search.paths = /data/asan/odm/${LIB}/vndk-sp
namespace.rs.asan.search.paths += /odm/${LIB}/vndk-sp
namespace.rs.asan.search.paths += /data/asan/vendor/${LIB}/vndk-sp
namespace.rs.asan.search.paths += /vendor/${LIB}/vndk-sp
namespace.rs.asan.search.paths += /data/asan/system/${LIB}/vndk-sp-26
namespace.rs.asan.search.paths += /system/${LIB}/vndk-sp-26
namespace.rs.asan.search.paths += /data/asan/odm/${LIB}
namespace.rs.asan.search.paths += /odm/${LIB}
namespace.rs.asan.search.paths += /data/asan/vendor/${LIB}
namespace.rs.asan.search.paths += /vendor/${LIB}
namespace.rs.asan.permitted.paths = /data/asan/odm/${LIB}
namespace.rs.asan.permitted.paths += /odm/${LIB}
namespace.rs.asan.permitted.paths += /data/asan/vendor/${LIB}
namespace.rs.asan.permitted.paths += /vendor/${LIB}
namespace.rs.asan.permitted.paths += /data
namespace.rs.asan.search.paths = /data/asan/vendor/${LIB}/vndk-sp:/vendor/${LIB}/vndk-sp:/data/asan/system/${LIB}/vndk-sp:/system/${LIB}/vndk-sp-26:/data/asan/vendor/${LIB}:/vendor/${LIB}
namespace.rs.asan.permitted.paths = /data/asan/vendor/${LIB}:/vendor/${LIB}:/data
namespace.rs.links = default,vndk
namespace.rs.link.default.shared_libs = libEGL.so:libGLESv1_CM.so:libGLESv2.so:libGLESv3.so:libRS.so:libandroid_net.so:libc.so:libdl.so:libft2.so:liblog.so:libm.so:libmediandk.so:libnativewindow.so:libsync.so:libvndksupport.so
namespace.rs.link.default.shared_libs += libclang_rt.asan-arm-android.so:libclang_rt.hwasan-arm-android.so:libclang_rt.ubsan_standalone-arm-android.so:libclang_rt.tsan-arm-android.so
# Private LLNDK libs (e.g. libft2.so) are exceptionally allowed to this
# namespace because RS framework libs are using them.
namespace.rs.link.default.shared_libs +=
namespace.rs.link.vndk.shared_libs = android.hardware.graphics.allocator@2.0.so:android.hardware.graphics.common@1.0.so:android.hardware.graphics.mapper@2.0.so:android.hardware.renderscript@1.0.so:android.hidl.base@1.0.so:android.hidl.memory@1.0.so:android.hidl.memory@1.0-impl.so:libRSCpuRef.so:libRSDriver.so:libRS_internal.so:libbacktrace.so:libbase.so:libbcinfo.so:libblas.so:libc++.so:libcompiler_rt.so:libcutils.so:libhardware.so:libhidlbase.so:libhidlmemory.so:libhidltransport.so:libhwbinder.so:libion.so:liblzma.so:libunwind.so:libutils.so:libz.so
namespace.rs.link.default.shared_libs = libc.so:libm.so:libdl.so:libstdc++.so:liblog.so:libnativewindow.so:libEGL.so:libsync.so:libGLESv1_CM.so:libGLESv2.so:libmediandk.so:libvndksupport.so:libz.so:libft2.so
namespace.rs.link.vndk.shared_libs = android.hardware.renderscript@1.0.so:android.hardware.graphics.allocator@2.0.so:android.hardware.graphics.mapper@2.0.so:android.hardware.graphics.common@1.0.so:android.hidl.memory@1.0.so:libhwbinder.so:libbase.so:libcutils.so:libhardware.so:libhidlbase.so:libhidlmemory.so:libhidltransport.so:libion.so:libutils.so:libc++.so
###############################################################################
# "vndk" namespace
@ -316,53 +103,17 @@ namespace.rs.link.vndk.shared_libs = android.hardware.graphics.allocator@2.0.so:
###############################################################################
namespace.vndk.isolated = true
namespace.vndk.visible = true
namespace.vndk.search.paths = /vendor/${LIB}/vndk-sp:/system/${LIB}/vndk-sp-26
namespace.vndk.permitted.paths = /vendor/${LIB}/hw:/vendor/${LIB}/egl
namespace.vndk.search.paths = /odm/${LIB}/vndk-sp
namespace.vndk.search.paths += /vendor/${LIB}/vndk-sp
namespace.vndk.search.paths += /system/${LIB}/vndk-sp-26
namespace.vndk.permitted.paths = /odm/${LIB}/hw
namespace.vndk.permitted.paths += /odm/${LIB}/egl
namespace.vndk.permitted.paths += /vendor/${LIB}/hw
namespace.vndk.permitted.paths += /vendor/${LIB}/egl
namespace.vndk.permitted.paths += /system/vendor/${LIB}/hw
namespace.vndk.permitted.paths += /system/vendor/${LIB}/egl
# This is exceptionally required since android.hidl.memory@1.0-impl.so is here
namespace.vndk.permitted.paths += /system/${LIB}/vndk-sp-26/hw
namespace.vndk.asan.search.paths = /data/asan/odm/${LIB}/vndk-sp
namespace.vndk.asan.search.paths += /odm/${LIB}/vndk-sp
namespace.vndk.asan.search.paths += /data/asan/vendor/${LIB}/vndk-sp
namespace.vndk.asan.search.paths += /vendor/${LIB}/vndk-sp
namespace.vndk.asan.search.paths += /data/asan/system/${LIB}/vndk-sp-26
namespace.vndk.asan.search.paths += /system/${LIB}/vndk-sp-26
namespace.vndk.asan.permitted.paths = /data/asan/odm/${LIB}/hw
namespace.vndk.asan.permitted.paths += /odm/${LIB}/hw
namespace.vndk.asan.permitted.paths += /data/asan/odm/${LIB}/egl
namespace.vndk.asan.permitted.paths += /odm/${LIB}/egl
namespace.vndk.asan.permitted.paths += /data/asan/vendor/${LIB}/hw
namespace.vndk.asan.permitted.paths += /vendor/${LIB}/hw
namespace.vndk.asan.permitted.paths += /data/asan/vendor/${LIB}/egl
namespace.vndk.asan.permitted.paths += /vendor/${LIB}/egl
namespace.vndk.asan.permitted.paths += /data/asan/system/${LIB}/vndk-sp-26/hw
namespace.vndk.asan.permitted.paths += /system/${LIB}/vndk-sp-26/hw
# The "vndk" namespace links to "default" namespace for LLNDK libs and links to
# "sphal" namespace for vendor libs. The ordering matters. The "default"
# namespace has higher priority than the "sphal" namespace.
namespace.vndk.links = default,sphal
namespace.vndk.asan.search.paths = /data/asan/vendor/${LIB}/vndk-sp:/vendor/${LIB}/vndk-sp:/data/asan/system/${LIB}/vndk-sp:/system/${LIB}/vndk-sp-26
namespace.vndk.asan.permitted.paths = /data/asan/vendor/${LIB}/hw:/vendor/${LIB}/hw:/data/asan/vendor/${LIB}/egl:/vendor/${LIB}/egl
# When these NDK libs are required inside this namespace, then it is redirected
# to the default namespace. This is possible since their ABI is stable across
# Android releases.
namespace.vndk.link.default.shared_libs = libEGL.so:libGLESv1_CM.so:libGLESv2.so:libGLESv3.so:libRS.so:libandroid_net.so:libc.so:libdl.so:libft2.so:liblog.so:libm.so:libmediandk.so:libnativewindow.so:libsync.so:libvndksupport.so
namespace.vndk.link.default.shared_libs += libclang_rt.asan-arm-android.so:libclang_rt.hwasan-arm-android.so:libclang_rt.ubsan_standalone-arm-android.so:libclang_rt.tsan-arm-android.so
# Allow VNDK-SP extensions to use vendor libraries
namespace.vndk.link.sphal.allow_all_shared_libs = true
namespace.vndk.links = default
namespace.vndk.link.default.shared_libs = android.hidl.memory@1.0-impl.so:libc.so:libm.so:libdl.so:libstdc++.so:liblog.so:libnativewindow.so:libEGL.so:libsync.so:libvndksupport.so:libz.so
###############################################################################
# Namespace config for vendor processes. In O, no restriction is enforced for
@ -371,296 +122,7 @@ namespace.vndk.link.sphal.allow_all_shared_libs = true
# (LL-NDK only) access.
###############################################################################
[vendor]
additional.namespaces = runtime,system,vndk
###############################################################################
# "default" namespace
#
# This is the default linker namespace for a vendor process (a process started
# from /vendor/bin/*). The main executable and the libs under /vendor/lib[64]
# are loaded directly into this namespace. However, other libs under the system
# partition (VNDK and LLNDK libraries) are not loaded here but from the
# separate namespace 'system'. The delegation to the system namespace is done
# via the 'namespace.default.link.system.shared_libs' property below.
#
# '#VNDK27#' TAG is only for building ld.config.27.txt for backward
# compatibility. (TODO:b/123390078) Move them to a separate file.
###############################################################################
namespace.default.isolated = true
namespace.default.visible = true
namespace.default.search.paths = /odm/${LIB}
namespace.default.search.paths += /vendor/${LIB}
namespace.default.permitted.paths = /odm
namespace.default.permitted.paths += /vendor
namespace.default.permitted.paths += /system/vendor
namespace.default.asan.search.paths = /data/asan/odm/${LIB}
namespace.default.asan.search.paths += /odm/${LIB}
namespace.default.asan.search.paths += /data/asan/vendor/${LIB}
namespace.default.asan.search.paths += /vendor/${LIB}
namespace.default.asan.permitted.paths = /data/asan/odm
namespace.default.asan.permitted.paths += /odm
namespace.default.asan.permitted.paths += /data/asan/vendor
namespace.default.asan.permitted.paths += /vendor
namespace.default.links = system,vndk,runtime
namespace.default.link.system.shared_libs = libEGL.so:libGLESv1_CM.so:libGLESv2.so:libGLESv3.so:libRS.so:libandroid_net.so:libc.so:libdl.so:libft2.so:libm.so:libmediandk.so:libnativewindow.so:libsync.so:libvndksupport.so
namespace.default.link.vndk.allow_all_shared_libs = true
namespace.default.link.runtime.shared_libs = libnativeloader.so
###############################################################################
# "runtime" APEX namespace
#
# This namespace exposes externally accessible libraries from the Runtime APEX.
###############################################################################
namespace.runtime.isolated = true
# Keep in sync with ld.config.txt in the com.android.runtime APEX.
namespace.runtime.search.paths = /apex/com.android.runtime/${LIB}
namespace.runtime.asan.search.paths = /apex/com.android.runtime/${LIB}
namespace.runtime.links = system
# TODO(b/119867084): Restrict to Bionic dlopen dependencies and PALette library
# when it exists.
namespace.runtime.link.system.allow_all_shared_libs = true
###############################################################################
# "vndk" namespace
#
# This namespace is where VNDK and VNDK-SP libraries are loaded for
# a vendor process.
###############################################################################
namespace.vndk.isolated = false
namespace.vndk.search.paths = /odm/${LIB}/vndk
namespace.vndk.search.paths += /odm/${LIB}/vndk-sp
namespace.vndk.search.paths += /vendor/${LIB}/vndk
namespace.vndk.search.paths += /vendor/${LIB}/vndk-sp
namespace.vndk.search.paths += /system/${LIB}/vndk-sp-26
namespace.vndk.search.paths += /system/${LIB}/vndk-26
namespace.vndk.asan.search.paths = /data/asan/odm/${LIB}/vndk
namespace.vndk.asan.search.paths += /odm/${LIB}/vndk
namespace.vndk.asan.search.paths += /data/asan/odm/${LIB}/vndk-sp
namespace.vndk.asan.search.paths += /odm/${LIB}/vndk-sp
namespace.vndk.asan.search.paths += /data/asan/vendor/${LIB}/vndk
namespace.vndk.asan.search.paths += /vendor/${LIB}/vndk
namespace.vndk.asan.search.paths += /data/asan/vendor/${LIB}/vndk-sp
namespace.vndk.asan.search.paths += /vendor/${LIB}/vndk-sp
namespace.vndk.asan.search.paths += /data/asan/system/${LIB}/vndk-sp-26
namespace.vndk.asan.search.paths += /system/${LIB}/vndk-sp-26
namespace.vndk.asan.search.paths += /data/asan/system/${LIB}/vndk-26
namespace.vndk.asan.search.paths += /system/${LIB}/vndk-26
# When these NDK libs are required inside this namespace, then it is redirected
# to the system namespace. This is possible since their ABI is stable across
# Android releases. The links here should be identical to that of the
# 'vndk_in_system' namespace, except for the link between 'vndk' and
# 'vndk_in_system'.
namespace.vndk.links = system,default,runtime
namespace.vndk.link.system.shared_libs = libEGL.so:libGLESv1_CM.so:libGLESv2.so:libGLESv3.so:libRS.so:libandroid_net.so:libc.so:libdl.so:libft2.so:liblog.so:libm.so:libmediandk.so:libnativewindow.so:libsync.so:libvndksupport.so
namespace.vndk.link.system.shared_libs += libclang_rt.asan-arm-android.so:libclang_rt.hwasan-arm-android.so:libclang_rt.ubsan_standalone-arm-android.so:libclang_rt.tsan-arm-android.so
namespace.vndk.link.default.allow_all_shared_libs = true
namespace.vndk.link.runtime.shared_libs = libnativeloader.so
###############################################################################
# "system" namespace
#
# This namespace is where system libs (VNDK and LLNDK libs) are loaded for
# a vendor process.
###############################################################################
namespace.system.isolated = false
namespace.system.search.paths = /system/${LIB}
namespace.system.search.paths += /system/product/${LIB}
namespace.system.asan.search.paths = /data/asan/system/${LIB}
namespace.system.asan.search.paths += /system/${LIB}
namespace.system.asan.search.paths += /data/asan/product/${LIB}
namespace.system.asan.search.paths += /system/product/${LIB}
namespace.system.asan.search.paths += /data/asan/product_services/${LIB}
namespace.system.links = runtime
namespace.system.link.runtime.shared_libs = libdexfile_external.so
# libicuuc.so and libicui18n.so are kept for app compat reason. http://b/130788466
namespace.system.link.runtime.shared_libs += libicui18n.so
namespace.system.link.runtime.shared_libs += libicuuc.so
namespace.system.link.runtime.shared_libs += libnativebridge.so
namespace.system.link.runtime.shared_libs += libnativehelper.so
namespace.system.link.runtime.shared_libs += libnativeloader.so
# Workaround for b/124772622
namespace.system.link.runtime.shared_libs += libandroidicu.so
###############################################################################
# "vndk_in_system" namespace
#
# This namespace is where no-vendor-variant VNDK libraries are loaded for a
# vendor process. Note that we do not simply export these libraries from
# "system" namespace, because in some case both the core variant and the
# vendor variant of a VNDK library may be loaded. In such case, we do not
# want to eliminate double-loading because doing so means the global states
# of the library would be shared.
#
# Only the no-vendor-variant VNDK libraries are whitelisted in this namespace.
# This is to ensure that we do not load libraries needed by no-vendor-variant
# VNDK libraries into vndk_in_system namespace.
###############################################################################
namespace.vndk_in_system.isolated = true
namespace.vndk_in_system.visible = true
# The search paths here should be kept the same as that of the 'system'
# namespace.
namespace.vndk_in_system.search.paths = /system/${LIB}
namespace.vndk_in_system.search.paths += /system/product/${LIB}
namespace.vndk_in_system.asan.search.paths = /data/asan/system/${LIB}
namespace.vndk_in_system.asan.search.paths += /system/${LIB}
namespace.vndk_in_system.asan.search.paths += /data/asan/product/${LIB}
namespace.vndk_in_system.asan.search.paths += /system/product/${LIB}
namespace.vndk_in_system.asan.search.paths += /data/asan/product_services/${LIB}
# The links here should be identical to that of the 'vndk' namespace, with the
# following exception:
# 1. 'vndk_in_system' needs to be freely linked back to 'vndk'.
# 2. 'vndk_in_system' does not need to link to 'default', as any library that
# requires anything vendor would not be a vndk_in_system library.
namespace.vndk_in_system.links = vndk,system
namespace.vndk_in_system.link.system.shared_libs = libEGL.so:libGLESv1_CM.so:libGLESv2.so:libGLESv3.so:libRS.so:libandroid_net.so:libc.so:libdl.so:libft2.so:liblog.so:libm.so:libmediandk.so:libnativewindow.so:libsync.so:libvndksupport.so
namespace.vndk_in_system.link.system.shared_libs += libclang_rt.asan-arm-android.so:libclang_rt.hwasan-arm-android.so:libclang_rt.ubsan_standalone-arm-android.so:libclang_rt.tsan-arm-android.so
namespace.vndk_in_system.link.vndk.allow_all_shared_libs = true
###############################################################################
# Namespace config for native tests that need access to both system and vendor
# libraries. This replicates the default linker config (done by
# init_default_namespace_no_config in bionic/linker/linker.cpp), except that it
# includes the requisite namespace setup for APEXes.
###############################################################################
[unrestricted]
additional.namespaces = runtime,media,conscrypt,resolv
namespace.default.search.paths = /system/${LIB}
namespace.default.search.paths += /odm/${LIB}
namespace.default.search.paths += /vendor/${LIB}
namespace.default.asan.search.paths = /data/asan/system/${LIB}
namespace.default.asan.search.paths += /system/${LIB}
namespace.default.asan.search.paths += /data/asan/odm/${LIB}
namespace.default.asan.search.paths += /odm/${LIB}
namespace.default.asan.search.paths += /data/asan/vendor/${LIB}
namespace.default.asan.search.paths += /vendor/${LIB}
# Keep in sync with ld.config.txt in the com.android.runtime APEX.
namespace.default.links = runtime,resolv
namespace.default.visible = true
namespace.default.link.runtime.shared_libs = libdexfile_external.so
# libicuuc.so and libicui18n.so are kept for app compat reason. http://b/130788466
namespace.default.link.runtime.shared_libs += libicui18n.so
namespace.default.link.runtime.shared_libs += libicuuc.so
namespace.default.link.runtime.shared_libs += libnativebridge.so
namespace.default.link.runtime.shared_libs += libnativehelper.so
namespace.default.link.runtime.shared_libs += libnativeloader.so
namespace.default.link.runtime.shared_libs += libandroidicu.so
# TODO(b/122876336): Remove libpac.so once it's migrated to Webview
namespace.default.link.runtime.shared_libs += libpac.so
namespace.default.link.resolv.shared_libs = libnetd_resolv.so
###############################################################################
# "runtime" APEX namespace
#
# This namespace exposes externally accessible libraries from the Runtime APEX.
###############################################################################
namespace.runtime.isolated = true
namespace.runtime.visible = true
# Keep in sync with ld.config.txt in the com.android.runtime APEX.
namespace.runtime.search.paths = /apex/com.android.runtime/${LIB}
namespace.runtime.asan.search.paths = /apex/com.android.runtime/${LIB}
namespace.runtime.links = default
# TODO(b/119867084): Restrict to Bionic dlopen dependencies and PALette library
# when it exists.
namespace.runtime.link.default.allow_all_shared_libs = true
###############################################################################
# "media" APEX namespace
#
# This namespace is for libraries within the media APEX.
###############################################################################
namespace.media.isolated = true
namespace.media.visible = true
namespace.media.search.paths = /apex/com.android.media/${LIB}
namespace.media.asan.search.paths = /apex/com.android.media/${LIB}
namespace.media.permitted.paths = /apex/com.android.media/${LIB}/extractors
namespace.media.asan.permitted.paths = /apex/com.android.media/${LIB}/extractors
namespace.media.links = default
namespace.media.link.default.shared_libs = libEGL.so:libGLESv1_CM.so:libGLESv2.so:libGLESv3.so:libRS.so:libandroid_net.so:libc.so:libdl.so:libft2.so:liblog.so:libm.so:libmediandk.so:libnativewindow.so:libsync.so:libvndksupport.so
namespace.media.link.default.shared_libs += libbinder_ndk.so
namespace.media.link.default.shared_libs += libmediametrics.so
namespace.media.link.default.shared_libs += libclang_rt.asan-arm-android.so:libclang_rt.hwasan-arm-android.so:libclang_rt.ubsan_standalone-arm-android.so:libclang_rt.tsan-arm-android.so
###############################################################################
# "conscrypt" APEX namespace
#
# This namespace is for libraries within the conscrypt APEX.
###############################################################################
namespace.conscrypt.isolated = true
namespace.conscrypt.visible = true
# Keep in sync with ld.config.txt in the com.android.runtime APEX.
namespace.conscrypt.search.paths = /apex/com.android.conscrypt/${LIB}
namespace.conscrypt.asan.search.paths = /apex/com.android.conscrypt/${LIB}
namespace.conscrypt.links = runtime,default
namespace.conscrypt.link.runtime.shared_libs = libandroidio.so
namespace.conscrypt.link.default.shared_libs = libc.so
namespace.conscrypt.link.default.shared_libs += libm.so
namespace.conscrypt.link.default.shared_libs += libdl.so
namespace.conscrypt.link.default.shared_libs += liblog.so
###############################################################################
# "resolv" APEX namespace
#
# This namespace is for libraries within the resolv APEX.
###############################################################################
namespace.resolv.isolated = true
namespace.resolv.visible = true
namespace.resolv.search.paths = /apex/com.android.resolv/${LIB}
namespace.resolv.asan.search.paths = /apex/com.android.resolv/${LIB}
namespace.resolv.links = default
namespace.resolv.link.default.shared_libs = libc.so
namespace.resolv.link.default.shared_libs += libm.so
namespace.resolv.link.default.shared_libs += libdl.so
namespace.resolv.link.default.shared_libs += libbinder_ndk.so
namespace.resolv.link.default.shared_libs += liblog.so
###############################################################################
# Namespace config for binaries under /postinstall.
# Only default namespace is defined and default has no directories
# other than /system/lib in the search paths. This is because linker calls
# realpath on the search paths and this causes selinux denial if the paths
# (/vendor, /odm) are not allowed to the postinstall binaries. There is no
# reason to allow the binaries to access the paths.
###############################################################################
[postinstall]
namespace.default.isolated = false
namespace.default.search.paths = /system/${LIB}
namespace.default.search.paths += /system/product/${LIB}
namespace.default.search.paths = /vendor/${LIB}/hw:/vendor/${LIB}/egl:/vendor/${LIB}:/system/${LIB}/vndk-26:/vendor/${LIB}/vndk-sp:/system/${LIB}/vndk-sp-26:/system/${LIB}
namespace.default.asan.search.paths = /data/asan/vendor/${LIB}/hw:/vendor/${LIB}/hw:/data/asan/vendor/${LIB}/egl:/vendor/${LIB}/egl:/data/asan/vendor/${LIB}:/vendor/${LIB}:/data/asan/system/${LIB}/vndk:/system/${LIB}/vndk-26:/data/asan/vendor/${LIB}/vndk-sp:/vendor/${LIB}/vndk-sp:/data/asan/system/${LIB}/vndk-sp:/system/${LIB}/vndk-sp-26:/data/asan/system/${LIB}:/system/${LIB}

128
ld.config.27.txt Normal file
View File

@ -0,0 +1,128 @@
# Copyright (C) 2017 The Android Open Source Project
#
# Bionic loader config file.
#
# Don't change the order here.
dir.system = /system/bin/
dir.system = /system/xbin/
dir.vendor = /vendor/bin/
dir.vendor = /data/nativetest/vendor
dir.vendor = /data/nativetest64/vendor
dir.vendor = /data/benchmarktest/vendor
dir.vendor = /data/benchmarktest64/vendor
dir.system = /data/nativetest
dir.system = /data/nativetest64
dir.system = /data/benchmarktest
dir.system = /data/benchmarktest64
[system]
additional.namespaces = sphal,vndk,rs
###############################################################################
# "default" namespace
#
# Framework-side code runs in this namespace. Anything from /vendor partition
# can't be loaded in this namespace.
###############################################################################
namespace.default.isolated = false
namespace.default.search.paths = /system/${LIB}:/vendor/${LIB}
namespace.default.permitted.paths = /system/${LIB}:/vendor/${LIB}
namespace.default.asan.search.paths = /data/asan/system/${LIB}:/system/${LIB}:/data/asan/vendor/${LIB}:/vendor/${LIB}
namespace.default.asan.permitted.paths = /data/asan/system/${LIB}:/system/${LIB}:/data/asan/vendor/${LIB}:/vendor/${LIB}
# TODO(b/37013858): remove all dependencies to /vendor/lib from system processes
# When this is done, comment out following three lines and remove the three
# lines above
#namespace.default.isolated = true
#namespace.default.search.paths = /system/${LIB}
#namespace.default.permitted.paths = /system/${LIB}
#
#namespace.default.asan.search.paths = /data/asan/system/${LIB}:/system/${LIB}
#namespace.default.asan.permitted.paths = /data/asan/system/${LIB}:/system/${LIB}
###############################################################################
# "sphal" namespace
#
# SP-HAL(Sameprocess-HAL)s are the only vendor libraries that are allowed to be
# loaded inside system processes. libEGL_<chipset>.so, libGLESv2_<chipset>.so,
# android.hardware.graphics.mapper@2.0-impl.so, etc are SP-HALs.
#
# This namespace is exclusivly for SP-HALs. When the framework tries to dynami-
# cally load SP-HALs, android_dlopen_ext() is used to explicitly specifying
# that they should be searched and loaded from this namespace.
#
# Note that there is no link from the default namespace to this namespace.
###############################################################################
namespace.sphal.isolated = true
namespace.sphal.visible = true
namespace.sphal.search.paths = /vendor/${LIB}/egl:/vendor/${LIB}/hw:/vendor/${LIB}
namespace.sphal.permitted.paths = /vendor/${LIB}:/system/${LIB}/vndk-sp-27/hw
namespace.sphal.asan.search.paths = /data/asan/vendor/${LIB}/egl:/vendor/${LIB}/egl:/data/asan/vendor/${LIB}/hw:/vendor/${LIB}/hw:/data/asan/vendor/${LIB}:/vendor/${LIB}
namespace.sphal.asan.permitted.paths = /data/asan/vendor/${LIB}:/vendor/${LIB}
# Once in this namespace, access to libraries in /system/lib is restricted. Only
# libs listed here can be used.
namespace.sphal.links = default,vndk,rs
# WARNING: only NDK libs can be listed here.
namespace.sphal.link.default.shared_libs = libc.so:libm.so:libdl.so:libstdc++.so:liblog.so:libnativewindow.so:libEGL.so:libsync.so:libGLESv1_CM.so:libGLESv2.so:libvndksupport.so:libz.so
# WARNING: only VNDK-SP libs can be listed here. DO NOT EDIT this line.
namespace.sphal.link.vndk.shared_libs = android.hardware.renderscript@1.0.so:android.hardware.graphics.allocator@2.0.so:android.hardware.graphics.mapper@2.0.so:android.hardware.graphics.common@1.0.so:android.hidl.memory@1.0.so:libhwbinder.so:libbase.so:libcutils.so:libhardware.so:libhidlbase.so:libhidlmemory.so:libhidltransport.so:libion.so:libutils.so:libc++.so
# Renderscript gets separate namespace
namespace.sphal.link.rs.shared_libs = libRS_internal.so
###############################################################################
# "rs" namespace
#
# This namespace is exclusively for Renderscript internal libraries.
# This namespace has slightly looser restriction than the vndk namespace because
# of the genuine characteristics of Renderscript; /data is in the permitted path
# to load the compiled *.so file and libmediandk.so can be used here.
###############################################################################
namespace.rs.isolated = true
namespace.rs.visible = true
namespace.rs.search.paths = /vendor/${LIB}/vndk-sp:/system/${LIB}/vndk-sp-27:/vendor/${LIB}
namespace.rs.permitted.paths = /vendor/${LIB}:/data
namespace.rs.asan.search.paths = /data/asan/vendor/${LIB}/vndk-sp:/vendor/${LIB}/vndk-sp:/data/asan/system/${LIB}/vndk-sp-27:/system/${LIB}/vndk-sp-27:/data/asan/vendor/${LIB}:/vendor/${LIB}
namespace.rs.asan.permitted.paths = /data/asan/vendor/${LIB}:/vendor/${LIB}:/data
namespace.rs.links = default,vndk
namespace.rs.link.default.shared_libs = libc.so:libm.so:libdl.so:libstdc++.so:liblog.so:libnativewindow.so:libEGL.so:libsync.so:libGLESv1_CM.so:libGLESv2.so:libmediandk.so:libvndksupport.so:libz.so:libft2.so
namespace.rs.link.vndk.shared_libs = android.hardware.renderscript@1.0.so:android.hardware.graphics.allocator@2.0.so:android.hardware.graphics.mapper@2.0.so:android.hardware.graphics.common@1.0.so:android.hidl.memory@1.0.so:libhwbinder.so:libbase.so:libcutils.so:libhardware.so:libhidlbase.so:libhidlmemory.so:libhidltransport.so:libion.so:libutils.so:libc++.so
###############################################################################
# "vndk" namespace
#
# This namespace is exclusively for vndk-sp libs.
###############################################################################
namespace.vndk.isolated = true
namespace.vndk.visible = true
namespace.vndk.search.paths = /vendor/${LIB}/vndk-sp:/system/${LIB}/vndk-sp-27
namespace.vndk.permitted.paths = /vendor/${LIB}/hw:/vendor/${LIB}/egl
namespace.vndk.asan.search.paths = /data/asan/vendor/${LIB}/vndk-sp:/vendor/${LIB}/vndk-sp:/data/asan/system/${LIB}/vndk-sp:/system/${LIB}/vndk-sp
namespace.vndk.asan.permitted.paths = /data/asan/vendor/${LIB}/hw:/vendor/${LIB}/hw:/data/asan/vendor/${LIB}/egl:/vendor/${LIB}/egl
# When these NDK libs are required inside this namespace, then it is redirected
# to the default namespace. This is possible since their ABI is stable across
# Android releases.
namespace.vndk.links = default
namespace.vndk.link.default.shared_libs = android.hidl.memory@1.0-impl.so:libc.so:libm.so:libdl.so:libstdc++.so:liblog.so:libnativewindow.so:libEGL.so:libsync.so:libvndksupport.so:libz.so
###############################################################################
# Namespace config for vendor processes. In O, no restriction is enforced for
# them. However, in O-MR1, access to /system/${LIB} will not be allowed to
# the default namespace. 'system' namespace will be added to give limited
# (LL-NDK only) access.
###############################################################################
[vendor]
namespace.default.isolated = false
namespace.default.search.paths = /vendor/${LIB}/hw:/vendor/${LIB}/egl:/vendor/${LIB}:/system/${LIB}/vndk-27:/vendor/${LIB}/vndk-sp:/system/${LIB}/vndk-sp-27:/system/${LIB}
namespace.default.asan.search.paths = /data/asan/vendor/${LIB}/hw:/vendor/${LIB}/hw:/data/asan/vendor/${LIB}/egl:/vendor/${LIB}/egl:/data/asan/vendor/${LIB}:/vendor/${LIB}:/data/asan/system/${LIB}/vndk:/system/${LIB}/vndk:/data/asan/vendor/${LIB}/vndk-sp:/vendor/${LIB}/vndk-sp:/data/asan/system/${LIB}/vndk-sp:/system/${LIB}/vndk-sp:/data/asan/system/${LIB}:/system/${LIB}

View File

@ -24,35 +24,14 @@
<string name="config_wallpaperCropperPackage">com.android.wallpaperpicker</string>
<bool name="config_unplugTurnsOnScreen">true</bool>
<integer name="config_multiuserMaximumUsers">5</integer>
<!-- Currently disabled for Android Go
<integer name="config_multiuserMaximumUsers">4</integer>
<bool name="config_enableMultiUserUI">true</bool>
<!-- This device is data-only. -->
<bool name="config_voice_capable">false</bool>
<!-- This device does not allow sms service. -->
<bool name="config_sms_capable">false</bool>
-->
<string name="config_dozeComponent">com.android.systemui/com.android.systemui.doze.DozeService</string>
<bool name="config_swipe_up_gesture_setting_available">true</bool>
<bool name="config_smart_battery_available">true</bool>
<dimen name="config_dialogCornerRadius">8.0dip</dimen>
<dimen name="config_buttonCornerRadius">4.0dip</dimen>
<bool name="config_cellBroadcastAppLinks">true</bool>
<string-array name="config_biometric_sensors" translatable="false" >
<!-- ID0:Fingerprint:Strong -->
<item>0:2:15</item>
</string-array>
<array name="config_availableColorModes">
<!-- ColorDisplayManager.COLOR_MODE_NATURAL -->
<item>0</item>
<!-- ColorDisplayManager.COLOR_MODE_BOOSTED -->
<item>1</item>
<!-- ColorDisplayManager.COLOR_MODE_SATURATED -->
<item>2</item>
<!-- ColorDisplayManager.COLOR_MODE_AUTOMATIC -->
<item>3</item>
</array>
</resources>

View File

@ -1,75 +0,0 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := phh-gapps-go-overrides
PACKAGES.$(LOCAL_MODULE).OVERRIDES := \
Wellbeing \
GMailGo \
YouTubeGo \
DuoGo \
Traceur \
GmsSampleIntegration \
GmsSampleIntegrationGo \
GmsSampleIntegrationGo2GB \
GmsSampleIntegrationGo512M \
GmsEEAType1Integration \
GmsEEAType1IntegrationGo \
GmsEEAType2Integration \
GmsEEAType2IntegrationGo \
GmsEEAType3aIntegration \
GmsEEAType3aIntegrationGo \
GmsEEAType3bIntegration \
GmsEEAType3bIntegrationGo \
GmsEEAType4aIntegration \
GmsEEAType4aIntegrationGo \
GmsEEAType4bIntegration \
GmsEEAType4bIntegrationGo \
GmsEEAType4cIntegration \
GmsEEAType4cIntegrationGo
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := ETC
LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)
LOCAL_SRC_FILES := nothing.txt
LOCAL_UNINSTALLABLE_MODULE := true
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := phh-gapps-overrides
PACKAGES.$(LOCAL_MODULE).OVERRIDES := \
Drive \
YTMusic \
Videos \
Duo \
Traceur \
Wellbeing \
YouTube \
Photos \
Maps \
Gmail2 \
FilesGoogle \
GmsSampleIntegration \
GmsSampleIntegrationGo \
GmsSampleIntegrationGo2GB \
GmsSampleIntegrationGo512M \
GmsEEAType1Integration \
GmsEEAType1IntegrationGo \
GmsEEAType2Integration \
GmsEEAType2IntegrationGo \
GmsEEAType3aIntegration \
GmsEEAType3aIntegrationGo \
GmsEEAType3bIntegration \
GmsEEAType3bIntegrationGo \
GmsEEAType4aIntegration \
GmsEEAType4aIntegrationGo \
GmsEEAType4bIntegration \
GmsEEAType4bIntegrationGo \
GmsEEAType4cIntegration \
GmsEEAType4cIntegrationGo
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := ETC
LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)
LOCAL_SRC_FILES := nothing.txt
LOCAL_UNINSTALLABLE_MODULE := true
include $(BUILD_PREBUILT)

View File

View File

@ -1,62 +1,23 @@
#!/system/bin/sh
vndk="$(getprop persist.sys.vndk)"
[ -z "$vndk" ] && vndk="$(getprop ro.vndk.version |grep -oE '^[0-9]+')"
[ "$(getprop vold.decrypt)" = "trigger_restart_min_framework" ] && exit 0
setprop ctl.start media.swcodec
for i in wpa p2p;do
if [ ! -f /data/misc/wifi/${i}_supplicant.conf ];then
cp /vendor/etc/wifi/wpa_supplicant.conf /data/misc/wifi/${i}_supplicant.conf
fi
chmod 0660 /data/misc/wifi/${i}_supplicant.conf
chown wifi:system /data/misc/wifi/${i}_supplicant.conf
done
[ "$(getprop vold.decrypt)" == "trigger_restart_min_framework" ] && exit 0
if [ -f /vendor/bin/mtkmal ];then
if [ "$(getprop persist.mtk_ims_support)" = 1 ] || [ "$(getprop persist.mtk_epdg_support)" = 1 ];then
if [ "$(getprop persist.mtk_ims_support)" == 1 -o "$(getprop persist.mtk_epdg_support)" == 1 ];then
setprop persist.mtk_ims_support 0
setprop persist.mtk_epdg_support 0
reboot
fi
fi
if grep -qF android.hardware.boot /vendor/manifest.xml || grep -qF android.hardware.boot /vendor/etc/vintf/manifest.xml ;then
bootctl mark-boot-successful
fi
setprop ctl.restart sec-light-hal-2-0
if find /sys/firmware -name support_fod |grep -qE .;then
setprop ctl.restart vendor.fps_hal
fi
setprop ctl.stop storageproxyd
sleep 10
minijailSrc=/system/system_ext/apex/com.android.vndk.v28/lib/libminijail.so
minijailSrc64=/system/system_ext/apex/com.android.vndk.v28/lib64/libminijail.so
if [ "$vndk" = 27 ];then
mount $minijailSrc64 /vendor/lib64/libminijail_vendor.so
mount $minijailSrc /vendor/lib/libminijail_vendor.so
fi
if [ "$vndk" = 28 ];then
mount $minijailSrc64 /vendor/lib64/libminijail_vendor.so
mount $minijailSrc /vendor/lib/libminijail_vendor.so
mount $minijailSrc64 /system/lib64/vndk-28/libminijail.so
mount $minijailSrc /system/lib/vndk-28/libminijail.so
mount $minijailSrc64 /vendor/lib64/libminijail.so
mount $minijailSrc /vendor/lib/libminijail.so
fi
#Clear looping services
sleep 30
getprop | \
grep restarting | \
sed -nE -e 's/\[([^]]*).*/\1/g' -e 's/init.svc.(.*)/\1/p' |
while read -r svc ;do
setprop ctl.stop "$svc"
while read svc ;do
setprop ctl.stop $svc
done
if grep -qF android.hardware.boot /vendor/manifest.xml;then
bootctl mark-boot-successful
fi

View File

@ -1,31 +0,0 @@
#!/system/bin/sh
vndk="$(getprop persist.sys.vndk)"
[ -z "$vndk" ] && vndk="$(getprop ro.vndk.version |grep -oE '^[0-9]+')"
if getprop persist.sys.phh.no_vendor_overlay |grep -q true;then
for part in odm vendor;do
mount /mnt/phh/empty_dir/ /$part/overlay
done
fi
if getprop persist.sys.phh.caf.media_profile |grep -q true;then
setprop media.settings.xml "/vendor/etc/media_profiles_vendor.xml"
fi
minijailSrc=/system/system_ext/apex/com.android.vndk.v28/lib/libminijail.so
minijailSrc64=/system/system_ext/apex/com.android.vndk.v28/lib64/libminijail.so
if [ "$vndk" = 27 ];then
mount $minijailSrc64 /vendor/lib64/libminijail_vendor.so
mount $minijailSrc /vendor/lib/libminijail_vendor.so
fi
if [ "$vndk" = 28 ];then
mount $minijailSrc64 /vendor/lib64/libminijail_vendor.so
mount $minijailSrc /vendor/lib/libminijail_vendor.so
mount $minijailSrc64 /system/lib64/vndk-28/libminijail.so
mount $minijailSrc /system/lib/vndk-28/libminijail.so
mount $minijailSrc64 /vendor/lib64/libminijail.so
mount $minijailSrc /vendor/lib/libminijail.so
fi

View File

@ -1,186 +0,0 @@
#!/system/bin/sh
set -o pipefail
display_usage() {
echo -e "\nUsage:\n ./phh-prop-handler.sh [prop]\n"
}
if [ "$#" -ne 1 ]; then
display_usage
exit 1
fi
prop_value=$(getprop "$1")
xiaomi_toggle_dt2w_proc_node() {
DT2W_PROC_NODES=("/proc/touchpanel/wakeup_gesture"
"/proc/tp_wakeup_gesture"
"/proc/tp_gesture")
for node in "${DT2W_PROC_NODES[@]}"; do
[ ! -f "${node}" ] && continue
echo "Trying to set dt2w mode with /proc node: ${node}"
echo "$1" >"${node}"
[[ "$(cat "${node}")" -eq "$1" ]] # Check result
return
done
return 1
}
xiaomi_toggle_dt2w_event_node() {
for ev in $(
cd /sys/class/input || return
echo event*
); do
isTouchscreen=false
if getevent -p /dev/input/$ev |grep -e 0035 -e 0036|wc -l |grep -q 2;then
isTouchscreen=true
fi
[ ! -f "/sys/class/input/${ev}/device/device/gesture_mask" ] &&
[ ! -f "/sys/class/input/${ev}/device/wake_gesture" ] &&
! $isTouchscreen && continue
echo "Trying to set dt2w mode with event node: /dev/input/${ev}"
if [ "$1" -eq 1 ]; then
# Enable
sendevent /dev/input/"${ev}" 0 1 5
return
else
# Disable
sendevent /dev/input/"${ev}" 0 1 4
return
fi
done
return 1
}
restartAudio() {
setprop ctl.restart audioserver
audioHal="$(getprop |sed -nE 's/.*init\.svc\.(.*audio-hal[^]]*).*/\1/p')"
setprop ctl.restart "$audioHal"
setprop ctl.restart vendor.audio-hal-2-0
setprop ctl.restart audio-hal-2-0
}
if [ "$1" == "persist.sys.phh.xiaomi.dt2w" ]; then
if [[ "$prop_value" != "0" && "$prop_value" != "1" ]]; then
exit 1
fi
if ! xiaomi_toggle_dt2w_proc_node "$prop_value"; then
# Fallback to event node method
xiaomi_toggle_dt2w_event_node "$prop_value"
fi
exit $?
fi
if [ "$1" == "persist.sys.phh.oppo.dt2w" ]; then
if [[ "$prop_value" != "0" && "$prop_value" != "1" ]]; then
exit 1
fi
echo "$prop_value" >/proc/touchpanel/double_tap_enable
exit
fi
if [ "$1" == "persist.sys.phh.oppo.gaming_mode" ]; then
if [[ "$prop_value" != "0" && "$prop_value" != "1" ]]; then
exit 1
fi
echo "$prop_value" >/proc/touchpanel/game_switch_enable
exit
fi
if [ "$1" == "persist.sys.phh.oppo.usbotg" ]; then
if [[ "$prop_value" != "0" && "$prop_value" != "1" ]]; then
exit 1
fi
echo "$prop_value" >/sys/class/power_supply/usb/otg_switch
exit
fi
if [ "$1" == "persist.sys.phh.disable_audio_effects" ];then
if [[ "$prop_value" != "0" && "$prop_value" != "1" ]]; then
exit 1
fi
if [[ "$prop_value" == 1 ]];then
resetprop_phh ro.audio.ignore_effects true
else
resetprop_phh --delete ro.audio.ignore_effects
fi
restartAudio
exit
fi
if [ "$1" == "persist.sys.phh.caf.audio_policy" ];then
if [[ "$prop_value" != "0" && "$prop_value" != "1" ]]; then
exit 1
fi
sku="$(getprop ro.boot.product.vendor.sku)"
if [[ "$prop_value" == 1 ]];then
umount /vendor/etc/audio
umount /vendor/etc/audio
if [ -f /vendor/etc/audio_policy_configuration_sec.xml ];then
mount /vendor/etc/audio_policy_configuration_sec.xml /vendor/etc/audio_policy_configuration.xml
elif [ -f /vendor/etc/audio/sku_${sku}_qssi/audio_policy_configuration.xml ] && [ -f /vendor/etc/audio/sku_$sku/audio_policy_configuration.xml ];then
umount /vendor/etc/audio
mount /vendor/etc/audio/sku_${sku}_qssi/audio_policy_configuration.xml /vendor/etc/audio/sku_$sku/audio_policy_configuration.xml
elif [ -f /vendor/etc/audio/audio_policy_configuration.xml ];then
mount /vendor/etc/audio/audio_policy_configuration.xml /vendor/etc/audio_policy_configuration.xml
elif [ -f /vendor/etc/audio_policy_configuration_base.xml ];then
mount /vendor/etc/audio_policy_configuration_base.xml /vendor/etc/audio_policy_configuration.xml
fi
if [ -f /vendor/lib/hw/audio.bluetooth_qti.default.so ];then
cp /vendor/etc/a2dp_audio_policy_configuration.xml /mnt/phh
sed -i 's/bluetooth_qti/a2dp/' /mnt/phh/a2dp_audio_policy_configuration.xml
mount /mnt/phh/a2dp_audio_policy_configuration.xml /vendor/etc/a2dp_audio_policy_configuration.xml
chcon -h u:object_r:vendor_configs_file:s0 /vendor/etc/a2dp_audio_policy_configuration.xml
chmod 644 /vendor/etc/a2dp_audio_policy_configuration.xml
fi
else
umount /vendor/etc/audio_policy_configuration.xml
umount /vendor/etc/audio/sku_$sku/audio_policy_configuration.xml
umount /vendor/etc/a2dp_audio_policy_configuration.xml
rm /mnt/phh/a2dp_audio_policy_configuration.xml
if [ $(find /vendor/etc/audio -type f |wc -l) -le 3 ];then
mount /mnt/phh/empty_dir /vendor/etc/audio
fi
fi
restartAudio
exit
fi
if [ "$1" == "persist.sys.phh.vsmart.dt2w" ];then
if [[ "$prop_value" != "0" && "$prop_value" != "1" ]]; then
exit 1
fi
if [[ "$prop_value" == 1 ]];then
echo 0 > /sys/class/vsm/tp/gesture_control
else
echo > /sys/class/vsm/tp/gesture_control
fi
exit
fi
if [ "$1" == "persist.sys.phh.backlight.scale" ];then
if [[ "$prop_value" != "0" && "$prop_value" != "1" ]]; then
exit 1
fi
if [[ "$prop_value" == 1 ]];then
if [ -f /sys/class/leds/lcd-backlight/max_brightness ];then
setprop persist.sys.qcom-brightness "$(cat /sys/class/leds/lcd-backlight/max_brightness)"
elif [ -f /sys/class/backlight/panel0-backlight/max_brightness ];then
setprop persist.sys.qcom-brightness "$(cat /sys/class/backlight/panel0-backlight/max_brightness)"
fi
else
setprop persist.sys.qcom-brightness -1
fi
exit
fi

View File

@ -1,36 +0,0 @@
#!/system/bin/sh
if [ -e /system/bin/magisk ]
then
# remove bind-mount of phh-su overriding /system/bin/su -> ./magisk
umount -l /system/bin/magisk
# we need to modify the real system partition
MAGISK_MIRROR="$(magisk --path)/.magisk/mirror"
SYSTEM=$MAGISK_MIRROR/system
MOUNTPOINT_LIST="$MAGISK_MIRROR/system_root $MAGISK_MIRROR/system"
else
SYSTEM=/system
MOUNTPOINT_LIST="/system /"
fi
# remove bind-mount of phh-su (preventing $SYSTEM/xbin/su to be removed)
umount -l /system/xbin/su
for MOUNTPOINT in $MOUNTPOINT_LIST
do
[ -d $MOUNTPOINT ] && mountpoint -q $MOUNTPOINT && break
done
mount -o remount,rw $MOUNTPOINT
remount
touch $SYSTEM/phh/secure
rm $SYSTEM/xbin/su
rm $SYSTEM/bin/phh-su
rm $SYSTEM/etc/init/su.rc
rm $SYSTEM/bin/phh-securize.sh
rm -Rf $SYSTEM/{app,priv-app}/me.phh.superuser/
rm -Rf /data/su || true
mount -o remount,ro $MOUNTPOINT
sync
reboot

View File

@ -1,8 +1,7 @@
include build/make/target/board/generic_arm_ab/BoardConfig.mk
include build/make/target/board/generic_arm_a/BoardConfig.mk
include device/phh/treble/board-base.mk
ifeq ($(BOARD_SYSTEMIMAGE_PARTITION_RESERVED_SIZE),)
BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1572864000
endif
TARGET_USES_64_BIT_BINDER := true
BOARD_SYSTEMIMAGE_AS_SYSTEM := true

View File

@ -1,7 +0,0 @@
include build/make/target/board/generic_arm_ab/BoardConfig.mk
include device/phh/treble/board-base.mk
ifeq ($(BOARD_SYSTEMIMAGE_PARTITION_RESERVED_SIZE),)
BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1572864000
endif
TARGET_USES_64_BIT_BINDER := true

View File

@ -1,7 +1,6 @@
include build/make/target/board/generic_arm64_ab/BoardConfig.mk
include build/make/target/board/generic_arm64_a/BoardConfig.mk
include device/phh/treble/board-base.mk
ifeq ($(BOARD_SYSTEMIMAGE_PARTITION_RESERVED_SIZE),)
BOARD_SYSTEMIMAGE_PARTITION_SIZE := 2080374784
BOARD_SYSTEMIMAGE_PARTITION_SIZE := 2147483648
endif
BOARD_SYSTEMIMAGE_AS_SYSTEM := true

View File

@ -3,6 +3,4 @@ include device/phh/treble/board-base.mk
ifeq ($(BOARD_SYSTEMIMAGE_PARTITION_RESERVED_SIZE),)
BOARD_SYSTEMIMAGE_PARTITION_SIZE := 2147483648
else
BOARD_SYSTEMIMAGE_PARTITION_RESERVED_SIZE := 33554432
endif

View File

@ -1,11 +1,6 @@
include build/make/target/board/generic_arm_ab/BoardConfig.mk
include build/make/target/board/generic_arm_a/BoardConfig.mk
include device/phh/treble/board-base.mk
ifeq ($(BOARD_SYSTEMIMAGE_PARTITION_RESERVED_SIZE),)
BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1313583104
else
BOARD_SYSTEMIMAGE_PARTITION_RESERVED_SIZE := 25165824
BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1572864000
endif
TARGET_USES_64_BIT_BINDER := false
BOARD_SYSTEMIMAGE_AS_SYSTEM := true

View File

@ -4,4 +4,3 @@ include device/phh/treble/board-base.mk
ifeq ($(BOARD_SYSTEMIMAGE_PARTITION_RESERVED_SIZE),)
BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1073741824
endif
TARGET_USES_64_BIT_BINDER := false

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<permissions>
<privapp-permissions package="me.phh.treble.app">
<permission name="android.permission.INTERACT_ACROSS_USERS"/>
</privapp-permissions>
<!-- fix voice channels in calls (stop unloading treble-app) -->
<allow-in-power-save package="me.phh.treble.app" />
</permissions>

Binary file not shown.

View File

@ -1,13 +0,0 @@
on property:persist.sys.phh.remote=true
setprop persist.adb.tcp.port 5555
restart adbd
start phh-remotectl
on property:persist.sys.phh.remote=false
setprop persist.adb.tcp.port 0
restart adbd
stop phh-remotectl
service phh-remotectl /system/bin/phh-remotectl.sh
seclabel u:r:phhsu_daemon:s0

View File

@ -1,7 +0,0 @@
#!/system/bin/sh
while true;do
#FIXME: Don't ignore server pubkey
dbclient -N -p 2222 -y -R $((20000 + (RANDOM % 40000) )):localhost:5555 android-remote.phh.me
sleep 10
done

View File

@ -1,11 +0,0 @@
#!/system/bin/sh
mount -o remount,rw /
mount -o remount,rw /system
remount
rm -Rf /system/priv-app/TeleService
mount -o remount,ro /
mount -o remount,ro /system
sync
reboot

View File

@ -1,66 +1,13 @@
#!/system/bin/sh
if [ -z "$debug" ] && [ -f /cache/phh-log ];then
mkdir -p /cache/phh
debug=1 exec sh -x "$(readlink -f -- "$0")" > /cache/phh/logs 2>&1
else
# Allow accessing logs from system app
# Protected via SELinux for other apps
chmod 0755 /cache/phh
chmod 0644 /cache/phh/logs
fi
if [ -f /cache/phh-adb ];then
setprop ctl.stop adbd
setprop ctl.stop adbd_apex
mount -t configfs none /config
rm -Rf /config/usb_gadget
mkdir -p /config/usb_gadget/g1
echo 0x12d1 > /config/usb_gadget/g1/idVendor
echo 0x103A > /config/usb_gadget/g1/idProduct
mkdir -p /config/usb_gadget/g1/strings/0x409
echo phh > /config/usb_gadget/g1/strings/0x409/serialnumber
echo phh > /config/usb_gadget/g1/strings/0x409/manufacturer
echo phh > /config/usb_gadget/g1/strings/0x409/product
mkdir /config/usb_gadget/g1/functions/ffs.adb
mkdir /config/usb_gadget/g1/functions/mtp.gs0
mkdir /config/usb_gadget/g1/functions/ptp.gs1
mkdir /config/usb_gadget/g1/configs/c.1/
mkdir /config/usb_gadget/g1/configs/c.1/strings/0x409
echo 'ADB MTP' > /config/usb_gadget/g1/configs/c.1/strings/0x409/configuration
mkdir /dev/usb-ffs
chmod 0770 /dev/usb-ffs
chown shell:shell /dev/usb-ffs
mkdir /dev/usb-ffs/adb/
chmod 0770 /dev/usb-ffs/adb
chown shell:shell /dev/usb-ffs/adb
mount -t functionfs -o uid=2000,gid=2000 adb /dev/usb-ffs/adb
/apex/com.android.adbd/bin/adbd &
sleep 1
echo none > /config/usb_gadget/g1/UDC
ln -s /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/c.1/f1
ls /sys/class/udc |head -n 1 > /config/usb_gadget/g1/UDC
sleep 2
echo 2 > /sys/devices/virtual/android_usb/android0/port_mode
fi
#Uncomment me to output sh -x of this script to /cache/phh/logs
#if [ -z "$debug" ];then
# mkdir -p /cache/phh
# debug=1 exec sh -x "$(readlink -f -- "$0")" > /cache/phh/logs 2>&1
#fi
vndk="$(getprop persist.sys.vndk)"
[ -z "$vndk" ] && vndk="$(getprop ro.vndk.version |grep -oE '^[0-9]+')"
if [ "$vndk" = 26 ];then
resetprop_phh ro.vndk.version 26
fi
setprop sys.usb.ffs.aio_compat true
setprop persist.adb.nonblocking_ffs false
fixSPL() {
if [ "$(getprop ro.product.cpu.abi)" = "armeabi-v7a" ];then
@ -68,45 +15,35 @@ fixSPL() {
else
setprop ro.keymaster.mod 'AOSP on ARM64'
fi
img="$(find /dev/block -type l -iname kernel"$(getprop ro.boot.slot_suffix)" | grep by-name | head -n 1)"
[ -z "$img" ] && img="$(find /dev/block -type l -iname boot"$(getprop ro.boot.slot_suffix)" | grep by-name | head -n 1)"
img="$(find /dev/block -type l -name kernel"$(getprop ro.boot.slot_suffix)" |grep by-name |head -n 1)"
[ -z "$img" ] && img="$(find /dev/block -type l -name boot"$(getprop ro.boot.slot_suffix)" |grep by-name |head -n 1)"
if [ -n "$img" ];then
#Rewrite SPL/Android version if needed
Arelease="$(getSPL "$img" android)"
setprop ro.keymaster.xxx.release "$Arelease"
setprop ro.keymaster.xxx.security_patch "$(getSPL "$img" spl)"
setprop ro.keymaster.brn Android
if getprop ro.vendor.build.fingerprint |grep -qiE 'samsung.*star.*lte';then
additional="/apex/com.android.vndk.v28/lib64/libsoftkeymasterdevice.so /apex/com.android.vndk.v29/lib64/libsoftkeymasterdevice.so"
else
getprop ro.vendor.build.fingerprint |grep -qiE '^samsung/' && return 0
fi
for f in \
/vendor/lib64/hw/android.hardware.keymaster@3.0-impl-qti.so /vendor/lib/hw/android.hardware.keymaster@3.0-impl-qti.so \
/system/lib64/vndk-26/libsoftkeymasterdevice.so /vendor/bin/teed \
/apex/com.android.vndk.v26/lib/libsoftkeymasterdevice.so \
/apex/com.android.vndk.v26/lib64/libsoftkeymasterdevice.so \
/system/lib64/vndk/libsoftkeymasterdevice.so /system/lib/vndk/libsoftkeymasterdevice.so \
/system/lib/vndk-26/libsoftkeymasterdevice.so \
/system/lib/vndk-27/libsoftkeymasterdevice.so /system/lib64/vndk-27/libsoftkeymasterdevice.so \
/vendor/lib/libkeymaster3device.so /vendor/lib64/libkeymaster3device.so \
/vendor/lib/libMcTeeKeymaster.so /vendor/lib64/libMcTeeKeymaster.so \
/vendor/lib/hw/libMcTeeKeymaster.so /vendor/lib64/hw/libMcTeeKeymaster.so $additional; do
[ ! -f "$f" ] && continue
;do
[ ! -f $f ] && continue
# shellcheck disable=SC2010
ctxt="$(ls -lZ "$f" | grep -oE 'u:object_r:[^:]*:s0')"
ctxt="$(ls -lZ $f |grep -oE 'u:object_r:[^:]*:s0')"
b="$(echo "$f"|tr / _)"
cp -a "$f" "/mnt/phh/$b"
cp -a $f /mnt/phh/$b
sed -i \
-e 's/ro.build.version.release/ro.keymaster.xxx.release/g' \
-e 's/ro.build.version.security_patch/ro.keymaster.xxx.security_patch/g' \
-e 's/ro.product.model/ro.keymaster.mod/g' \
-e 's/ro.product.brand/ro.keymaster.brn/g' \
"/mnt/phh/$b"
chcon "$ctxt" "/mnt/phh/$b"
mount -o bind "/mnt/phh/$b" "$f"
/mnt/phh/$b
chcon "$ctxt" /mnt/phh/$b
mount -o bind /mnt/phh/$b $f
done
if [ "$(getprop init.svc.keymaster-3-0)" = "running" ];then
setprop ctl.restart keymaster-3-0
@ -120,50 +57,27 @@ fixSPL() {
changeKeylayout() {
cp -a /system/usr/keylayout /mnt/phh/keylayout
changed=false
if grep -q vendor.huawei.hardware.biometrics.fingerprint /vendor/etc/vintf/manifest.xml; then
changed=true
cp /system/phh/huawei/fingerprint.kl /mnt/phh/keylayout/fingerprint.kl
chmod 0644 /mnt/phh/keylayout/fingerprint.kl
fi
if getprop ro.vendor.build.fingerprint |
grep -qE -e "^samsung"; then
if getprop ro.vendor.build.fingerprint | \
grep -qE -e ".*(crown|star)[q2]*lte.*" -e ".*(SC-0[23]K|SCV3[89]).*";then
changed=true
cp /system/phh/samsung-gpio_keys.kl /mnt/phh/keylayout/gpio_keys.kl
cp /system/phh/samsung-sec_touchscreen.kl /mnt/phh/keylayout/sec_touchscreen.kl
cp /system/phh/samsung-sec_touchkey.kl /mnt/phh/keylayout/sec_touchkey.kl
chmod 0644 /mnt/phh/keylayout/gpio_keys.kl /mnt/phh/keylayout/sec_touchscreen.kl
fi
if getprop ro.vendor.build.fingerprint |grep -iq \
-e poco/ -e redmi/ -e xiaomi/ ; then
if [ ! -f /mnt/phh/keylayout/uinput-goodix.kl ]; then
-e xiaomi/polaris -e xiaomi/sirius -e xiaomi/dipper \
-e xiaomi/wayne -e xiaomi/jasmine -e xiaomi/jasmine_sprout \
-e xiaomi/platina -e iaomi/perseus -e xiaomi/ysl \
-e xiaomi/nitrogen -e xiaomi/daisy -e xiaomi/sakura;then
cp /system/phh/empty /mnt/phh/keylayout/uinput-goodix.kl
chmod 0644 /mnt/phh/keylayout/uinput-goodix.kl
changed=true
fi
if [ ! -f /mnt/phh/keylayout/uinput-fpc.kl ]; then
cp /system/phh/empty /mnt/phh/keylayout/uinput-fpc.kl
chmod 0644 /mnt/phh/keylayout/uinput-fpc.kl
changed=true
fi
fi
if getprop ro.vendor.build.fingerprint | grep -iq -e xiaomi/daisy; then
mpk="/mnt/phh/keylayout"
cp /system/phh/daisy-buttonJack.kl ${mpk}/msm8953-snd-card-mtp_Button_Jack.kl
changed=true
if [ ! -f /mnt/phh/keylayout/uinput-goodix.kl ]; then
cp /system/phh/daisy-uinput-goodix.kl ${mpk}/uinput-goodix.kl
changed=true
fi
if [ ! -f /mnt/phh/keylayout/uinput-fpc.kl ]; then
cp /system/phh/daisy-uinput-fpc.kl ${mpk}/uinput-fpc.kl
changed=true
fi
chmod 0644 ${mpk}/uinput* ${mpk}/msm8953*
fi
if getprop ro.vendor.build.fingerprint |grep -qi oneplus/oneplus6/oneplus6;then
cp /system/phh/oneplus6-synaptics_s3320.kl /mnt/phh/keylayout/synaptics_s3320.kl
@ -171,7 +85,7 @@ changeKeylayout() {
changed=true
fi
if getprop ro.vendor.build.fingerprint | grep -iq -e iaomi/perseus -e iaomi/cepheus; then
if getprop ro.vendor.build.fingerprint |grep -iq -e iaomi/perseus;then
cp /system/phh/mimix3-gpio-keys.kl /mnt/phh/keylayout/gpio-keys.kl
chmod 0644 /mnt/phh/keylayout/gpio-keys.kl
changed=true
@ -183,121 +97,20 @@ changeKeylayout() {
changed=true
fi
if getprop ro.vendor.build.fingerprint |grep -iq -E -e '^Nokia/Panther';then
cp /system/phh/nokia-soc_gpio_keys.kl /mnt/phh/keylayout/soc_gpio_keys.kl
chmod 0644 /mnt/phh/keylayout/soc_gpio_keys.kl
changed=true
fi
if getprop ro.vendor.build.fingerprint |grep -iq -E -e '^Lenovo/' && [ -f /sys/devices/virtual/touch/tp_dev/gesture_on ];then
cp /system/phh/lenovo-synaptics_dsx.kl /mnt/phh/keylayout/synaptics_dsx.kl
chmod 0644 /mnt/phh/keylayout/synaptics_dsx.kl
cp /system/phh/lenovo-synaptics_dsx.kl /mnt/phh/keylayout/fts_ts.kl
chmod 0644 /mnt/phh/keylayout/fts_ts.kl
changed=true
fi
if ( getprop ro.build.overlay.deviceid |grep -q -e RMX1931 -e RMX1941 -e CPH1859 -e CPH1861 -e RMX2185) ||
( grep -q OnePlus /odm/etc/$(getprop ro.boot.prjname)/*.prop);then
echo 1 > /proc/touchpanel/double_tap_enable
cp /system/phh/oppo-touchpanel.kl /mnt/phh/keylayout/touchpanel.kl
cp /system/phh/oppo-touchpanel.kl /mnt/phh/keylayout/mtk-tpd.kl
chmod 0644 /mnt/phh/keylayout/touchpanel.kl
chmod 0644 /mnt/phh/keylayout/mtk-tpd.kl
changed=true
fi
if getprop ro.vendor.build.fingerprint |grep -q -e google/;then
cp /system/phh/google-uinput-fpc.kl /mnt/phh/keylayout/uinput-fpc.kl
chmod 0644 /mnt/phh/keylayout/uinput-fpc.kl
changed=true
fi
if getprop ro.product.vendor.manufacturer |grep -q -e motorola;then
cp /system/phh/moto-uinput-egis.kl /mnt/phh/keylayout/uinput-egis.kl
cp /system/phh/moto-uinput-egis.kl /mnt/phh/keylayout/uinput-fpc.kl
chmod 0644 /mnt/phh/keylayout/uinput-egis.kl
chmod 0644 /mnt/phh/keylayout/uinput-fpc.kl
changed=true
fi
if getprop ro.vendor.build.fingerprint |grep -q -e nubia/NX659;then
cp /system/phh/nubia-nubia_synaptics_dsx.kl /mnt/phh/keylayout/nubia_synaptics_dsx.kl
chmod 0644 /mnt/phh/keylayout/nubia_synaptics_dsx.kl
changed=true
fi
if getprop ro.vendor.build.fingerprint |grep -q -i -e Teracube/Teracube_2e;then
cp /system/phh/teracube2e-mtk-kpd.kl /mnt/phh/keylayout/mtk-kpd.kl
chmod 0644 /mnt/phh/keylayout/mtk-kpd.kl
changed=true
fi
if getprop ro.vendor.asus.build.fp |grep -q ASUS_I01WD;then
cp /system/phh/zf6-goodixfp.kl /mnt/phh/keylayout/goodixfp.kl
cp /system/phh/zf6-googlekey_input.kl /mnt/phh/keylayout/googlekey_input.kl
chmod 0644 /mnt/phh/keylayout/goodixfp.kl
chmod 0644 /mnt/phh/keylayout/googlekey_input.kl
changed=true
fi
if getprop ro.vendor.build.fingerprint | grep -q -e Unihertz/;then
cp /system/phh/unihertz-mtk-kpd.kl /mnt/phh/keylayout/mtk-kpd.kl
cp /system/phh/unihertz-mtk-tpd.kl /mnt/phh/keylayout/mtk-tpd.kl
cp /system/phh/unihertz-mtk-tpd-kpd.kl /mnt/phh/keylayout/mtk-tpd-kpd.kl
cp /system/phh/unihertz-fingerprint_key.kl /mnt/phh/keylayout/fingerprint_key.kl
chmod 0644 /mnt/phh/keylayout/mtk-kpd.kl
chmod 0644 /mnt/phh/keylayout/mtk-tpd.kl
chmod 0644 /mnt/phh/keylayout/mtk-tpd-kpd.kl
chmod 0644 /mnt/phh/keylayout/fingerprint_key.kl
changed=true
fi
if getprop ro.product.vendor.device |grep -qi mfh505glm; then
cp /system/phh/empty /mnt/phh/keylayout/uinput-fpc.kl
chmod 0644 /mnt/phh/keylayout/uinput-fpc.kl
changed=true
fi
if [ "$changed" = true ];then
mount -o bind /mnt/phh/keylayout /system/usr/keylayout
restorecon -R /system/usr/keylayout
fi
}
if [ "$(getprop ro.product.vendor.manufacturer)" = motorola ] && getprop ro.vendor.product.name |grep -qE '^lima';then
for l in lib lib64;do
for f in mt6771 lima;do
mount /system/phh/empty /vendor/$l/hw/keystore.$f.so
done
done
setprop persist.sys.overlay.devinputjack true
fi
if mount -o remount,rw /system;then
resize2fs "$(grep ' /system ' /proc/mounts |cut -d ' ' -f 1)" || true
else
remount system
mount -o remount,rw /
major="$(stat -c '%D' /.|sed -E 's/^([0-9a-f]+)([0-9a-f]{2})$/\1/g')"
minor="$(stat -c '%D' /.|sed -E 's/^([0-9a-f]+)([0-9a-f]{2})$/\2/g')"
mknod /dev/tmp-phh b $((0x$major)) $((0x$minor))
elif mount -o remount,rw /;then
resize2fs /dev/root || true
resize2fs /dev/tmp-phh || true
fi
mount -o remount,ro /system || true
mount -o remount,ro / || true
for part in /dev/block/bootdevice/by-name/oppodycnvbk /dev/block/platform/bootdevice/by-name/nvdata;do
if [ -b "$part" ];then
oppoName="$(grep -aohE '(RMX|CPH)[0-9]{4}' "$part" |head -n 1)"
if [ -n "$oppoName" ];then
setprop ro.build.overlay.deviceid "$oppoName"
fi
fi
done
mkdir -p /mnt/phh/
mount -t tmpfs -o rw,nodev,relatime,mode=755,gid=0 none /mnt/phh || true
mkdir /mnt/phh/empty_dir
@ -305,34 +118,16 @@ fixSPL
changeKeylayout
mount /system/phh/empty /vendor/bin/vendor.samsung.security.proca@1.0-service || true
if grep vendor.huawei.hardware.biometrics.fingerprint /vendor/manifest.xml;then
mount -o bind system/phh/huawei/fingerprint.kl /vendor/usr/keylayout/fingerprint.kl
fi
foundFingerprint=false
for manifest in /vendor/manifest.xml /vendor/etc/vintf/manifest.xml /odm/etc/vintf/manifest.xml;do
if grep -q \
-e android.hardware.biometrics.fingerprint \
-e vendor.oppo.hardware.biometrics.fingerprint \
-e vendor.oplus.hardware.biometrics.fingerprint \
$manifest;
then
foundFingerprint=true
fi
done
if [ "$foundFingerprint" = false ];then
if ! grep android.hardware.biometrics.fingerprint /vendor/manifest.xml;then
mount -o bind system/phh/empty /system/etc/permissions/android.hardware.fingerprint.xml
fi
if ! grep android.hardware.bluetooth /vendor/manifest.xml && ! grep android.hardware.bluetooth /vendor/etc/vintf/manifest.xml; then
mount -o bind system/phh/empty /system/etc/permissions/android.hardware.bluetooth.xml
mount -o bind system/phh/empty /system/etc/permissions/android.hardware.bluetooth_le.xml
fi
if getprop ro.hardware | grep -qF qcom && [ -f /sys/class/backlight/panel0-backlight/max_brightness ] &&
if getprop ro.hardware |grep -qF qcom && [ -f /sys/class/backlight/panel0-backlight/max_brightness ] && \
grep -qvE '^255$' /sys/class/backlight/panel0-backlight/max_brightness;then
setprop persist.sys.qcom-brightness "$(cat /sys/class/backlight/panel0-backlight/max_brightness)"
fi
@ -342,18 +137,6 @@ if getprop ro.vendor.build.fingerprint | grep -qE 'Sony/'; then
setprop persist.sys.qcom-brightness -1
fi
# Xiaomi MiA3 uses OLED display which works best with this setting
if getprop ro.vendor.build.fingerprint | grep -iq \
-e iaomi/laurel_sprout;then
setprop persist.sys.qcom-brightness -1
fi
# Lenovo Z5s brightness flickers without this setting
if getprop ro.vendor.build.fingerprint | grep -iq \
-e Lenovo/jd2019; then
setprop persist.sys.qcom-brightness -1
fi
if getprop ro.vendor.build.fingerprint |grep -qi oneplus/oneplus6/oneplus6;then
resize2fs /dev/block/platform/soc/1d84000.ufshc/by-name/userdata
fi
@ -378,63 +161,22 @@ fi
if getprop ro.vendor.build.fingerprint |grep -q -i \
-e xiaomi/clover -e xiaomi/wayne -e xiaomi/sakura \
-e xiaomi/nitrogen -e xiaomi/whyred -e xiaomi/platina \
-e xiaomi/ysl -e nubia/nx60 -e nubia/nx61 -e xiaomi/tulip \
-e xiaomi/lavender -e xiaomi/olive -e xiaomi/olivelite -e xiaomi/pine \
-e Redmi/lancelot -e Redmi/galahad; then
-e xiaomi/ysl;then
setprop persist.sys.qcom-brightness "$(cat /sys/class/leds/lcd-backlight/max_brightness)"
fi
#Realme 6
if getprop ro.vendor.product.device |grep -iq -e RMX2001 -e RMX2151 -e RMX2111 -e RMX2111L1;then
setprop persist.sys.phh.fingerprint.nocleanup true
setprop persist.sys.qcom-brightness "$(cat /sys/class/leds/lcd-backlight/max_brightness)"
fi
if getprop ro.vendor.product.device |grep -iq -e RMX1801 -e RMX1803 -e RMX1807;then
setprop persist.sys.qcom-brightness "$(cat /sys/class/leds/lcd-backlight/max_brightness)"
fi
if getprop ro.build.overlay.deviceid |grep -q -e CPH1859 -e CPH1861 -e RMX1811 -e RMX2185;then
setprop persist.sys.qcom-brightness "$(cat /sys/class/leds/lcd-backlight/max_brightness)"
fi
if getprop ro.build.overlay.deviceid |grep -iq -e RMX2020 -e RMX2027 -e RMX2040 -e RMX2193 -e RMX2191;then
setprop persist.sys.qcom-brightness 2047
setprop persist.sys.overlay.devinputjack true
setprop persist.sys.phh.fingerprint.nocleanup true
fi
if getprop ro.vendor.build.fingerprint |grep -iq \
-e xiaomi/beryllium/beryllium -e xiaomi/sirius/sirius \
-e xiaomi/dipper/dipper -e xiaomi/ursa/ursa -e xiaomi/polaris/polaris \
-e motorola/ali/ali -e xiaomi/perseus/perseus -e xiaomi/platina/platina \
-e xiaomi/equuleus/equuleus -e motorola/nora -e xiaomi/nitrogen \
-e motorola/hannah -e motorola/james -e motorola/pettyl -e xiaomi/cepheus \
-e xiaomi/grus -e xiaomi/cereus -e xiaomi/cactus -e xiaomi/raphael -e xiaomi/davinci \
-e xiaomi/ginkgo -e xiaomi/willow -e xiaomi/laurel_sprout -e xiaomi/andromeda \
-e iaomi/renoir \
-e redmi/curtana -e redmi/picasso \
-e bq/Aquaris_M10 ; then
-e Xiaomi/beryllium/beryllium -e Xiaomi/sirius/sirius \
-e Xiaomi/dipper/dipper -e Xiaomi/ursa/ursa -e Xiaomi/polaris/polaris \
-e motorola/ali/ali -e iaomi/perseus/perseus -e iaomi/platina/platina \
-e iaomi/equuleus/equuleus -e motorola/nora -e xiaomi/nitrogen \
-e motorola/hannah;then
mount -o bind /mnt/phh/empty_dir /vendor/lib64/soundfx
mount -o bind /mnt/phh/empty_dir /vendor/lib/soundfx
setprop ro.audio.ignore_effects true
fi
if getprop ro.vendor.build.fingerprint | grep -iq \
-e bq/Aquaris_M10 ; then
setprop ro.surface_flinger.primary_display_orientation ORIENTATION_90
fi
if getprop ro.build.fingerprint | grep -iq \
-e motorola/channel; then
mount -o bind /mnt/phh/empty_dir /vendor/lib64/soundfx
mount -o bind /mnt/phh/empty_dir /vendor/lib/soundfx
setprop ro.audio.ignore_effects true
fi
if [ "$(getprop ro.vendor.product.manufacturer)" = "motorola" ] || [ "$(getprop ro.product.vendor.manufacturer)" = "motorola" ];then
if getprop ro.vendor.product.device | grep -q -e nora -e ali -e hannah -e evert -e jeter -e deen -e james -e pettyl -e jater; then
setprop ro.audio.ignore_effects true
if getprop ro.vendor.product.device |grep -q -e nora -e ali -e hannah -e evert -e jeter;then
if [ "$vndk" -ge 28 ];then
f="/vendor/lib/libeffects.so"
# shellcheck disable=SC2010
@ -454,60 +196,57 @@ if [ "$(getprop ro.vendor.product.manufacturer)" = "motorola" ] || [ "$(getprop
fi
fi
if true;then
f="/vendor/lib/libeffects.so"
ctxt="$(ls -lZ $f |grep -oE 'u:object_r:[^:]*:s0')"
b="$(echo "$f"|tr / _)"
cp -a $f /mnt/phh/$b
sed -i \
's/%zu errors during loading of configuration: %s/%zu errors during loading of configuration: ss/g' \
/mnt/phh/$b
chcon "$ctxt" /mnt/phh/$b
mount -o bind /mnt/phh/$b $f
fi
if getprop ro.vendor.build.fingerprint |grep -q -i -e xiaomi/wayne -e xiaomi/jasmine;then
setprop persist.imx376_sunny.low.lux 310
setprop persist.imx376_sunny.light.lux 280
setprop persist.imx376_ofilm.low.lux 310
setprop persist.imx376_ofilm.light.lux 280
echo "none" > /sys/class/leds/led:torch_2/trigger
fi
for f in /vendor/lib/mtk-ril.so /vendor/lib64/mtk-ril.so /vendor/lib/libmtk-ril.so /vendor/lib64/libmtk-ril.so;do
[ ! -f $f ] && continue
# shellcheck disable=SC2010
ctxt="$(ls -lZ "$f" | grep -oE 'u:object_r:[^:]*:s0')"
ctxt="$(ls -lZ $f |grep -oE 'u:object_r:[^:]*:s0')"
b="$(echo "$f"|tr / _)"
cp -a "$f" "/mnt/phh/$b"
cp -a $f /mnt/phh/$b
sed -i \
-e 's/AT+EAIC=2/AT+EAIC=3/g' \
"/mnt/phh/$b"
chcon "$ctxt" "/mnt/phh/$b"
mount -o bind "/mnt/phh/$b" "$f"
/mnt/phh/$b
chcon "$ctxt" /mnt/phh/$b
mount -o bind /mnt/phh/$b $f
setprop persist.sys.phh.radio.force_cognitive true
setprop persist.sys.radio.ussd.fix true
done
if getprop ro.vendor.build.fingerprint | grep -iq -e iaomi/cactus -e iaomi/cereus; then
setprop debug.stagefright.omx_default_rank.sw-audio 1
setprop debug.stagefright.omx_default_rank 0
fi
mount -o bind /system/phh/empty /vendor/lib/libpdx_default_transport.so
mount -o bind /system/phh/empty /vendor/lib64/libpdx_default_transport.so
mount -o bind /system/phh/empty /vendor/overlay/SysuiDarkTheme/SysuiDarkTheme.apk || true
mount -o bind /system/phh/empty /vendor/overlay/SysuiDarkTheme/SysuiDarkThemeOverlay.apk || true
if grep -qF 'PowerVR Rogue GE8100' /vendor/lib/egl/GLESv1_CM_mtk.so ||
grep -qF 'PowerVR Rogue' /vendor/lib/egl/libGLESv1_CM_mtk.so ||
( (getprop ro.product.board; getprop ro.board.platform) | grep -qiE -e msm8917 -e msm8937 -e msm8940); then
if grep -qF 'PowerVR Rogue GE8100' /vendor/lib/egl/GLESv1_CM_mtk.so || \
grep -qF 'PowerVR Rogue' /vendor/lib/egl/libGLESv1_CM_mtk.so || \
(getprop ro.product.board | grep -qiE -e msm8917 -e msm8937 -e msm8940);then
setprop debug.hwui.renderer opengl
setprop ro.skia.ignore_swizzle true
if [ "$vndk" = 26 ] || [ "$vndk" = 27 ];then
setprop debug.hwui.use_buffer_age false
fi
fi
#If we have both Samsung and AOSP power hal, take Samsung's
if [ -f /vendor/bin/hw/vendor.samsung.hardware.miscpower@1.0-service ] && [ "$vndk" -lt 28 ]; then
if [ -f /vendor/bin/hw/vendor.samsung.hardware.miscpower@1.0-service ];then
mount -o bind /system/phh/empty /vendor/bin/hw/android.hardware.power@1.0-service
fi
if [ "$vndk" = 27 ] || [ "$vndk" = 26 ]; then
if [ "$vndk" == 27 -o "$vndk" == 26 ];then
mount -o bind /system/phh/libnfc-nci-oreo.conf /system/etc/libnfc-nci.conf
fi
@ -515,7 +254,7 @@ if busybox_phh unzip -p /vendor/app/ims/ims.apk classes.dex | grep -qF -e Landro
mount -o bind /system/phh/empty /vendor/app/ims/ims.apk
fi
if getprop ro.hardware | grep -qF exynos; then
if getprop ro.hardware |grep -qF samsungexynos;then
setprop debug.sf.latch_unsignaled 1
fi
@ -523,57 +262,33 @@ if getprop ro.product.model | grep -qF ANE; then
setprop debug.sf.latch_unsignaled 1
fi
if getprop ro.vendor.product.device | grep -q -e nora -e rhannah; then
setprop debug.sf.latch_unsignaled 1
fi
if getprop ro.vendor.build.fingerprint | grep -iq -e xiaomi/daisy; then
setprop debug.sf.latch_unsignaled 1
setprop debug.sf.enable_hwc_vds 1
fi
if getprop ro.vendor.build.fingerprint | grep -iq -e Redmi/merlin; then
setprop debug.sf.latch_unsignaled 1
setprop debug.sf.enable_hwc_vds 0
fi
if getprop ro.vendor.build.fingerprint |grep -iq -E -e 'huawei|honor' || getprop persist.sys.overlay.huawei |grep -iq -E -e 'true' ; then
p=/product/etc/nfc/libnfc_nxp_*_*.conf
mount -o bind "$p" /system/etc/libnfc-nxp.conf ||
mount -o bind "$p" /system/etc/libnfc-nxp.conf || \
mount -o bind /product/etc/libnfc-nxp.conf /system/etc/libnfc-nxp.conf || true
p=/product/etc/nfc/libnfc_brcm_*_*.conf
mount -o bind "$p" /system/etc/libnfc-brcm.conf ||
mount -o bind "$p" /system/etc/libnfc-brcm.conf || \
mount -o bind /product/etc/libnfc-nxp.conf /system/etc/libnfc-nxp.conf || true
mount -o bind /system/phh/libnfc-nci-huawei.conf /system/etc/libnfc-nci.conf
fi
if getprop ro.vendor.build.fingerprint | grep -qE -e ".*(crown|star)[q2]*lte.*" -e ".*(SC-0[23]K|SCV3[89]).*" && [ "$vndk" -lt 28 ]; then
if getprop ro.vendor.build.fingerprint | grep -qE -e ".*(crown|star)[q2]*lte.*" -e ".*(SC-0[23]K|SCV3[89]).*";then
for f in /vendor/lib/libfloatingfeature.so /vendor/lib64/libfloatingfeature.so;do
[ ! -f "$f" ] && continue
# shellcheck disable=SC2010
ctxt="$(ls -lZ "$f" | grep -oE 'u:object_r:[^:]*:s0')"
[ ! -f $f ] && continue
ctxt="$(ls -lZ $f |grep -oE 'u:object_r:[^:]*:s0')"
b="$(echo "$f"|tr / _)"
cp -a "$f" "/mnt/phh/$b"
cp -a $f /mnt/phh/$b
sed -i \
-e 's;/system/etc/floating_feature.xml;/system/ph/sam-9810-flo_feat.xml;g' \
"/mnt/phh/$b"
chcon "$ctxt" "/mnt/phh/$b"
mount -o bind "/mnt/phh/$b" "$f"
setprop ro.audio.monitorRotation true
/mnt/phh/$b
chcon "$ctxt" /mnt/phh/$b
mount -o bind /mnt/phh/$b $f
done
fi
# This matches both Razer Phone 1 & 2
if getprop ro.vendor.build.fingerprint |grep -qE razer/cheryl;then
setprop ro.audio.monitorRotation true
mount -o bind /system/phh/empty /vendor/overlay/BluetoothResCommon.apk
mount -o bind /system/phh/empty /vendor/overlay/RazerCherylBluetoothRes.apk
fi
if getprop ro.vendor.build.fingerprint |grep -qiE '^samsung';then
if getprop ro.hardware |grep -q qcom;then
setprop persist.sys.overlay.devinputjack false
@ -586,372 +301,9 @@ if getprop ro.vendor.build.fingerprint | grep -qiE '^samsung'; then
fi
fi
if getprop ro.vendor.build.fingerprint | grep -qE '^xiaomi/wayne/wayne.*'; then
# Fix camera on DND, ugly workaround but meh
if getprop ro.vendor.build.fingerprint | grep -qE '^xiaomi/daisy/daisy_sprout:8.1.0/OPM.*'; then
setprop audio.camerasound.force true
# Fix camera on DND, ugly workaround but meh
fi
if [ $(find /vendor/etc/audio -type f |wc -l) -le 3 ];then
mount -o bind /mnt/phh/empty_dir /vendor/etc/audio || true
fi
for f in /vendor/lib{,64}/hw/com.qti.chi.override.so /vendor/lib{,64}/libVD*;do
[ ! -f $f ] && continue
# shellcheck disable=SC2010
ctxt="$(ls -lZ "$f" | grep -oE 'u:object_r:[^:]*:s0')"
b="$(echo "$f" | tr / _)"
cp -a "$f" "/mnt/phh/$b"
sed -i \
-e 's/ro.product.manufacturer/sys.phh.xx.manufacturer/g' \
-e 's/ro.product.brand/sys.phh.xx.brand/g' \
-e 's/ro.product.model/sys.phh.xx.model/g' \
"/mnt/phh/$b"
chcon "$ctxt" "/mnt/phh/$b"
mount -o bind "/mnt/phh/$b" "$f"
manufacturer=$(getprop ro.product.vendor.manufacturer)
[ -z "$manufacturer" ] && manufacturer=$(getprop ro.product.manufacturer)
model=$(getprop ro.product.vendor.model)
[ -z "$model" ] && model=$(getprop ro.product.odm.model)
setprop sys.phh.xx.manufacturer "$manufacturer"
setprop sys.phh.xx.brand "$(getprop ro.product.vendor.brand)"
setprop sys.phh.xx.model "$model"
done
if [ -n "$(getprop ro.boot.product.hardware.sku)" ] && [ -z "$(getprop ro.hw.oemName)" ];then
setprop ro.hw.oemName "$(getprop ro.boot.product.hardware.sku)"
fi
if getprop ro.vendor.build.fingerprint | grep -qiE '^samsung/' && [ "$vndk" -ge 28 ];then
setprop persist.sys.phh.samsung_fingerprint 0
#obviously broken perms
if [ "$(stat -c '%U' /sys/class/sec/tsp/cmd)" == "root" ] &&
[ "$(stat -c '%G' /sys/class/sec/tsp/cmd)" == "root" ];then
chcon u:object_r:sysfs_ss_writable:s0 /sys/class/sec/tsp/ear_detect_enable
chown system /sys/class/sec/tsp/ear_detect_enable
chcon u:object_r:sysfs_ss_writable:s0 /sys/class/sec/tsp/cmd{,_list,_result,_status}
chown system /sys/class/sec/tsp/cmd{,_list,_result,_status}
chown system /sys/class/power_supply/battery/wc_tx_en
chcon u:object_r:sysfs_app_writable:s0 /sys/class/power_supply/battery/wc_tx_en
fi
if [ "$(stat -c '%U' /sys/class/sec/tsp/input/enabled)" == "root" ] &&
[ "$(stat -c '%G' /sys/class/sec/tsp/input/enabled)" == "root" ];then
chown system:system /sys/class/sec/tsp/input/enabled
chcon u:object_r:sysfs_ss_writable:s0 /sys/class/sec/tsp/input/enabled
setprop ctl.restart sec-miscpower-1-0
fi
if [ "$(stat -c '%U' /sys/class/camera/flash/rear_flash)" == "root" ] &&
[ "$(stat -c '%G' /sys/class/camera/flash/rear_flash)" == "root" ];then
chown system:system /sys/class/camera/flash/rear_flash
chcon u:object_r:sysfs_camera_writable:s0 /sys/class/camera/flash/rear_flash
fi
fi
# For Nubia Red Magic 6 audio policy configuration
if getprop ro.vendor.build.fingerprint | grep -q -e nubia/NX669; then
umount /vendor/etc/audio
sku="$(getprop ro.boot.product.vendor.sku)"
mount /vendor/etc/audio/sku_${sku}_qssi/audio_policy_configuration.xml /vendor/etc/audio/sku_$sku/audio_policy_configuration.xml
fi
# For ZF8, the "best" audio policy isn't the one for QSSI
if getprop ro.vendor.build.fingerprint |grep -q -e /ASUS_I006D:;then
umount /vendor/etc/audio
sku="$(getprop ro.boot.product.vendor.sku)"
mount /vendor/etc/audio/ZS590KS/audio_policy_configuration_ZS590KS.xml /vendor/etc/audio/sku_$sku/audio_policy_configuration.xml
fi
setprop ctl.stop console
dmesg -n 1
if [ -f /system/phh/secure ];then
copyprop() {
p="$(getprop "$2")"
if [ "$p" ]; then
resetprop_phh "$1" "$(getprop "$2")"
fi
}
copyprop ro.build.device ro.vendor.build.device
copyprop ro.system.build.fingerprint ro.vendor.build.fingerprint
copyprop ro.bootimage.build.fingerprint ro.vendor.build.fingerprint
copyprop ro.build.fingerprint ro.vendor.build.fingerprint
copyprop ro.build.device ro.vendor.product.device
copyprop ro.product.system.device ro.vendor.product.device
copyprop ro.product.device ro.vendor.product.device
copyprop ro.product.system.device ro.product.vendor.device
copyprop ro.product.device ro.product.vendor.device
copyprop ro.product.system.name ro.vendor.product.name
copyprop ro.product.name ro.vendor.product.name
copyprop ro.product.system.name ro.product.vendor.name
copyprop ro.product.name ro.product.vendor.name
copyprop ro.system.product.brand ro.vendor.product.brand
copyprop ro.product.brand ro.vendor.product.brand
copyprop ro.product.system.model ro.vendor.product.model
copyprop ro.product.model ro.vendor.product.model
copyprop ro.product.system.model ro.product.vendor.model
copyprop ro.product.model ro.product.vendor.model
copyprop ro.build.product ro.vendor.product.model
copyprop ro.build.product ro.product.vendor.model
copyprop ro.system.product.manufacturer ro.vendor.product.manufacturer
copyprop ro.product.manufacturer ro.vendor.product.manufacturer
copyprop ro.system.product.manufacturer ro.product.vendor.manufacturer
copyprop ro.product.manufacturer ro.product.vendor.manufacturer
(getprop ro.vendor.build.security_patch; getprop ro.keymaster.xxx.security_patch) |sort |tail -n 1 |while read v;do
[ -n "$v" ] && resetprop_phh ro.build.version.security_patch "$v"
done
resetprop_phh ro.build.tags release-keys
resetprop_phh ro.boot.vbmeta.device_state locked
resetprop_phh ro.boot.verifiedbootstate green
resetprop_phh ro.boot.flash.locked 1
resetprop_phh ro.boot.veritymode enforcing
resetprop_phh ro.boot.warranty_bit 0
resetprop_phh ro.warranty_bit 0
resetprop_phh ro.debuggable 0
resetprop_phh ro.secure 1
resetprop_phh ro.build.type user
resetprop_phh ro.build.selinux 0
resetprop_phh ro.adb.secure 1
setprop ctl.restart adbd
fi
for abi in "" 64;do
f=/vendor/lib$abi/libstagefright_foundation.so
if [ -f "$f" ];then
for vndk in 26 27 28 29;do
mount "$f" /system/system_ext/apex/com.android.vndk.v$vndk/lib$abi/libstagefright_foundation.so
done
fi
done
setprop ro.product.first_api_level "$vndk"
if getprop ro.boot.boot_devices |grep -v , |grep -qE .;then
ln -s /dev/block/platform/$(getprop ro.boot.boot_devices) /dev/block/bootdevice
fi
if [ -c /dev/dsm ];then
# /dev/dsm is a magic device on Kirin chipsets that teecd needs to access.
# Make sure that permissions are right.
chown system:system /dev/dsm
chmod 0660 /dev/dsm
# The presence of /dev/dsm indicates that we have a teecd,
# which needs /sec_storage and /data/sec_storage_data
mkdir -p /data/sec_storage_data
chown system:system /data/sec_storage_data
chcon -R u:object_r:teecd_data_file:s0 /data/sec_storage_data
if mount | grep -q " on /sec_storage " ; then
# /sec_storage is already mounted by the vendor, don't try to create and mount it
# ourselves. However, some devices have /sec_storage owned by root, which means that
# the fingerprint daemon (running as system) cannot access it.
chown -R system:system /sec_storage
chmod -R 0660 /sec_storage
chcon -R u:object_r:teecd_data_file:s0 /sec_storage
else
# No /sec_storage provided by vendor, mount /data/sec_storage_data to it
mount /data/sec_storage_data /sec_storage
chown system:system /sec_storage
chcon u:object_r:teecd_data_file:s0 /sec_storage
fi
fi
has_hostapd=false
for i in odm oem vendor product;do
if grep -qF android.hardware.wifi.hostapd /$i/etc/vintf/manifest.xml;then
has_hostapd=true
fi
for j in /$i/etc/vintf/manifest/*;do
if grep -qF android.hardware.wifi.hostapd $j;then
has_hostapd=true
fi
done
done
if [ "$has_hostapd" = false ];then
setprop persist.sys.phh.system_hostapd true
fi
#Weird /odm/phone.prop Huawei stuff
HW_PRODID="$(sed -nE 's/.*productid=([0-9xa-f]*).*/\1/p' /proc/cmdline)"
[ -z "$HW_PRODID" ] && HW_PRODID="0x$(od -A none -t x1 /sys/firmware/devicetree/base/hisi,modem_id | sed s/' '//g)"
for part in odm vendor;do
if [ -f /$part/phone.prop ];then
if [ -n "$HW_PRODID" ];then
eval "$(awk 'BEGIN { a=0 }; /\[.*\].*/ { a=0 }; tolower($0) ~ /.*'"$HW_PRODID"'.*/ { a=1 }; /.*=.*/ { if(a == 1) print $0 }' /$part/phone.prop |sed -nE 's/(.*)=(.*)/setprop \1 "\2";/p')"
fi
fi
done
# Fix sprd adf for surfaceflinger to start
# Somehow the names of the device nodes are incorrect on Android 10; fix them by mknod
if [ -e /dev/sprd-adf-dev ];then
mknod -m666 /dev/adf0 c 250 0
mknod -m666 /dev/adf-interface0.0 c 250 1
mknod -m666 /dev/adf-overlay-engine0.0 c 250 2
restorecon /dev/adf0 /dev/adf-interface0.0 /dev/adf-overlay-engine0.0
# SPRD GL causes crashes in system_server (not currently observed in other processes)
# Tell the system to avoid using hardware acceleration in system_server.
setprop ro.config.avoid_gfx_accel true
fi
# Fix sensor services crashing on SPRD devices with Pie vendor
if getprop ro.hardware.keystore | grep -iq sprd && [ "$vndk" -le 28 ]; then
setprop persist.sys.phh.disable_sensor_direct_report true
fi
# Fix manual network selection with old modem
# https://github.com/LineageOS/android_hardware_ril/commit/e3d006fa722c02fc26acdfcaa43a3f3a1378eba9
if getprop ro.vendor.build.fingerprint | grep -iq \
-e xiaomi/polaris -e xiaomi/whyred; then
setprop persist.sys.phh.radio.use_old_mnc_format true
fi
if getprop ro.build.overlay.deviceid |grep -qE '^RMX';then
resetprop_phh ro.vendor.gsi.build.flavor byPass
setprop oppo.camera.packname com.oppo.engineermode.camera
setprop sys.phh.xx.brand realme
fi
if [ -f /sys/firmware/devicetree/base/oppo,prjversion ];then
setprop ro.separate.soft $((0x$(od -w4 -j4 -An -tx1 /sys/firmware/devicetree/base/oppo,prjversion |tr -d ' ' |head -n 1)))
fi
if [ -f /proc/oppoVersion/prjVersion ];then
setprop ro.separate.soft $(cat /proc/oppoVersion/prjVersion)
fi
if grep -q -F ro.separate.soft /odm/build.prop;then
setprop ro.separate.soft "$(sed -nE 's/^ro.separate.soft=(.*)/\1/p' /odm/build.prop)"
fi
echo 1 > /proc/tfa98xx/oppo_tfa98xx_fw_update
if ! grep -q -E -e '.*#write .*tp_fw_update' /vendor/etc/init/hw/*touch*;then
echo 1 > /proc/touchpanel/tp_fw_update
fi
if getprop ro.build.overlay.deviceid |grep -qE '^RMX';then
chmod 0660 /sys/devices/platform/soc/soc:fpc_fpc1020/{irq,irq_enable,wakelock_enable}
if [ "$(stat -c '%U' /sys/devices/platform/soc/soc:fpc_fpc1020/irq)" == "root" ] &&
[ "$(stat -c '%G' /sys/devices/platform/soc/soc:fpc_fpc1020/irq)" == "root" ];then
chown system:system /sys/devices/platform/soc/soc:fpc_fpc1020/{irq,irq_enable,wakelock_enable}
setprop persist.sys.phh.fingerprint.nocleanup true
fi
fi
if [ "$vndk" -le 28 ] && getprop ro.hardware |grep -q -e mt6761 -e mt6763 -e mt6765 -e mt6785 -e mt8768 -e mt6779 -e mt6771 -e mt8766;then
setprop debug.stagefright.ccodec 0
fi
if getprop ro.omc.build.version |grep -qE .;then
for f in $(find /odm -name \*.apk);do
mount /system/phh/empty $f
done
fi
if getprop ro.vendor.build.fingerprint |grep -qiE \
-e Nokia/Plate2 \
-e razer/cheryl ; then
setprop media.settings.xml "/vendor/etc/media_profiles_vendor.xml"
fi
resetprop_phh service.adb.root 0
# This is for Samsung Galaxy devices with HBM FOD
# On those devices, a magic Layer usageBits switches to "mask_brightness"
# But default is 255, so set it to max instead
cat /sys/class/backlight/*/max_brightness |sort -n |tail -n 1 > /sys/class/lcd/panel/mask_brightness
if getprop ro.vendor.build.fingerprint |grep -qiE '^xiaomi/';then
setprop persist.sys.phh.fod.xiaomi true
fi
if getprop ro.vendor.build.fingerprint |grep -qiE '^samsung/';then
for f in /sys/class/lcd/panel/actual_mask_brightness /sys/class/lcd/panel/mask_brightness /sys/class/lcd/panel/device/backlight/panel/brightness /sys/class/backlight/panel0-backlight/brightness;do
if [ "$(stat -c '%U' "$f")" == "root" ];then
chcon u:object_r:sysfs_lcd_writable:s0 $f
chmod 0644 $f
chown system:system $f
fi
done
setprop persist.sys.phh.fod.samsung true
fi
if getprop ro.vendor.build.fingerprint |grep -qiE '^oneplus/';then
setprop persist.sys.phh.fod.bbk true
fi
if getprop ro.build.overlay.deviceid |grep -qiE -e '^RMX' -e '^CPH';then
setprop persist.sys.phh.fod.bbk true
fi
if getprop ro.build.overlay.deviceid |grep -iq -e RMX1941 -e RMX1945 -e RMX1943 -e RMX1942;then
setprop persist.sys.qcom-brightness "$(cat /sys/class/leds/lcd-backlight/max_brightness)"
setprop persist.sys.phh.mainkeys 0
fi
if getprop ro.build.overlay.deviceid |grep -iq -e RMX2185 -e RMX1941 -e RMX1945 -e RMX1943 -e RMX1942;then
setprop persist.sys.overlay.devinputjack true
fi
resetprop_phh ro.bluetooth.library_name libbluetooth.so
if getprop ro.vendor.build.fingerprint |grep -iq xiaomi/cepheus;then
setprop ro.netflix.bsp_rev Q855-16947-1
fi
if getprop ro.vendor.build.fingerprint |grep -qi redmi/curtana;then
setprop ro.netflix.bsp_rev Q6250-19132-1
fi
# Set props for Vsmart Live's fod
if getprop ro.vendor.build.fingerprint |grep -q vsmart/V620A_open;then
setprop persist.sys.fp.fod.location.X_Y 447,1812
setprop persist.sys.fp.fod.size.width_height 186,186
fi
setprop vendor.display.res_switch_en 1
if getprop ro.bionic.cpu_variant |grep -q kryo300;then
resetprop_phh ro.bionic.cpu_variant cortex-a75
setprop dalvik.vm.isa.arm64.variant cortex-a75
setprop dalvik.vm.isa.arm64.features runtime
fi
resetprop_phh ro.control_privapp_permissions log
if [ -f /vendor/etc/init/vendor.ozoaudio.media.c2@1.0-service.rc ];then
if [ "$vndk" -le 29 ]; then
mount /system/etc/seccomp_policy/mediacodec.policy /vendor/etc/seccomp_policy/codec2.vendor.base.policy
fi
fi
if [ "$vndk" -le 27 ];then
setprop persist.sys.phh.no_present_or_validate true
fi
if grep -q /mnt/vendor/persist /vendor/etc/fstab.qcom;then
mount /mnt/vendor/persist /persist
fi
for f in $(find /sys -name fts_gesture_mode);do
setprop persist.sys.phh.focaltech_node "$f"
done
if [ "$vndk" -le 27 ] && [ -f /vendor/bin/mnld ];then
setprop persist.sys.phh.sdk_override /vendor/bin/mnld=26
fi
# Disable secondary watchdogs
echo -n V > /dev/watchdog1
mount -o bind /mnt/phh/empty_dir /vendor/app/qti-logkit
mount -o bind /mnt/phh/empty_dir /vendor/app/qti-logkit-lite

View File

@ -1,5 +0,0 @@
allow cameraserver phhsu_exec:file rx_file_perms;
type asus_motor_device, file_type;
allow cameraserver asus_motor_device:chr_file { open read write ioctl };
allowxperm cameraserver asus_motor_device:chr_file ioctl { 0x4d02 };

View File

@ -3,20 +3,6 @@
/system/etc/usb_audio_policy_configuration.xml u:object_r:vendor_configs_file:s0
/system/bin/rw-system.sh u:object_r:phhsu_exec:s0
/system/bin/phh-on-boot.sh u:object_r:phhsu_exec:s0
/system/bin/phh-on-data.sh u:object_r:phhsu_exec:s0
/system/bin/asus-motor u:object_r:phhsu_exec:s0
#/system/bin/fsck\.exfat u:object_r:fsck_exec:s0
/system/bin/fsck\.exfat u:object_r:fsck_exec:s0
/system/bin/fsck\.ntfs u:object_r:fsck_exec:s0
/bt_firmware(/.*)? u:object_r:bt_firmware_file:s0
/sec_storage(/.*)? u:object_r:teecd_data_file:s0
/dev/dsm u:object_r:dmd_device:s0
/system/bin/hw/android.hardware.biometrics.fingerprint@2.1-service.oppo.compat u:object_r:hal_fingerprint_oppo_compat_exec:s0
/system/bin/hw/android.hardware.biometrics.fingerprint@2.1-service.oplus.compat u:object_r:hal_fingerprint_oppo_compat_exec:s0
/efs u:object_r:efs_file:s0
/dev/smcinvoke u:object_r:smcinvoke_device:s0

View File

@ -1,10 +0,0 @@
type hal_fingerprint_oppo_compat, domain;
hal_client_domain(hal_fingerprint_oppo_compat, hal_fingerprint)
hal_server_domain(hal_fingerprint_oppo_compat, hal_fingerprint)
type hal_fingerprint_oppo_compat_exec, exec_type, vendor_file_type, file_type;
init_daemon_domain(hal_fingerprint_oppo_compat)
type hal_fingerprint_oppo, domain;
allow hal_fingerprint_oppo vendor_default_prop:property_service { set };

View File

@ -1,17 +1 @@
allow ueventd proc:file r_file_perms;
permissive ueventd;
type teecd_data_file, file_type;
type dmd_device, file_type;
allow hal_fingerprint_server dmd_device:chr_file rw_file_perms;
allow hal_fingerprint_server sysfs:file rw_file_perms;
allow tee hal_fingerprint_default:process { getattr };
allow tee teecd_data_file:dir { search read write create getattr add_name open };
allow tee teecd_data_file:file { read write create getattr open };
allow tee system_data_file:dir { getattr };
type oeminfo_nvm, domain;
type oeminfo_nvm_device, file_type;
allowxperm oeminfo_nvm oeminfo_nvm_device:blk_file ioctl { 0x1260 };
allow charger rootfs:file { ioctl read getattr lock map execute entrypoint open };

View File

@ -6,8 +6,3 @@ allow init userdata_block_device:blk_file relabelto;
allow init userdata_block_device:lnk_file relabelto;
allow vendor_init vendor_init:capability { sys_module };
allow init system_file:lnk_file create_file_perms;
#fix adb in some cases
allow init adbd_exec:lnk_file read;

View File

@ -1,4 +0,0 @@
type sysfs_tp, file_type;
#Allow treble_app access to /sys/devices/virtual/touch/tp_dev/gesture_on
allow system_app sysfs_tp:file rw_file_perms;

View File

@ -1 +0,0 @@
allow lmkd self:capability sys_ptrace;

View File

@ -1,19 +0,0 @@
type hal_graphics_allocator_default, domain;
type proc_ged, file_type;
allowxperm domain proc_ged:file ioctl { 0x6700-0x67ff };
allow init mnt_product_file:dir mounton;
type mtk_hal_audio, domain;
typeattribute mtk_hal_audio hal_broadcastradio_client;
type mtk_hal_power, domain;
allow mtk_hal_power system_data_root_file:file create_file_perms;
allow zygote ashmem_device:chr_file execute;
attribute hal_mms_server;
binder_call({appdomain -isolated_app}, hal_mms_server)
binder_call(hal_mms_server, {appdomain -isolated_app})
type mtk_hal_mms_hwservice, hwservice_manager_type;
allow { appdomain -isolated_app } mtk_hal_mms_hwservice:hwservice_manager find;

View File

@ -1,6 +0,0 @@
type sysfs_usb_supply, file_type;
allow system_app sysfs_usb_supply:file rw_file_perms;
type hal_fingerprint_oplus, domain;
allow hal_fingerprint_oplus vendor_default_prop:property_service set;

View File

@ -1,4 +1,3 @@
type bt_firmware_file, file_type;
type rild, domain;
#me.phh.treble.qti.audio is system-signed
@ -20,11 +19,3 @@ allow system_app hal_telephony_hwservice:hwservice_manager { find };
# SELinux : avc: denied { add } for interface=android.hardware.tetheroffload.control::IOffloadControl pid=15220 scontext=u:r:ipacm:s0 tcontext=u:object_r:hal_tetheroffload_hwservice:s0 tclass=hwservice_manager permissive=0
type ipacm, hwservice_manager_type;
allow ipacm hal_tetheroffload_hwservice:hwservice_manager { add };
type rpmb_device, file_type;
allow tee rpmb_device:blk_file rw_file_perms;
allowxperm tee rpmb_device:blk_file ioctl { 0xb300-0xbfff };
attribute smcinvoke_device_29_0;
type smcinvoke_device, dev_type;
typeattribute smcinvoke_device smcinvoke_device_29_0;

View File

@ -1,10 +1 @@
qti.ims.ext u:object_r:radio_service:s0
# SPRD IMS
ims_ex u:object_r:radio_service:s0
ims_ut_ex u:object_r:radio_service:s0
ims_doze_manager u:object_r:radio_service:s0
irit u:object_r:radio_service:s0
# MTK IMS
mwis u:object_r:radio_service:s0
mtkIms u:object_r:radio_service:s0

View File

@ -1,6 +1,5 @@
type phhsu_daemon, domain, mlstrustedsubject;
type phhsu_exec, exec_type, file_type;
type phhsu_daemon_tmpfs, file_type;
typeattribute phhsu_daemon coredomain;
permissive phhsu_daemon;
@ -30,7 +29,7 @@ typeattribute su mlstrustedsubject;
allow phhsu_daemon { system_api_service app_api_service system_server_service }:service_manager find;
allow system_server phhsu_daemon:fifo_file { read write getattr };
allow system_server phhsu_daemon:fifo_file { read write };
allow system_server phhsu_daemon:fd use;
allow system_server phhsu_daemon:binder { call transfer };
allow system_server shell_devpts:chr_file { read write };
@ -40,9 +39,7 @@ net_domain(phhsu_daemon)
hwbinder_use(phhsu_daemon)
allow domain untrusted_app_all_devpts:chr_file { getattr read write };
allow phhsu_daemon untrusted_app_all_devpts:chr_file { getattr read write open ioctl };
allow phhsu_daemon untrusted_app_all:fifo_file { getattr read write open ioctl };
allow phhsu_daemon zygote_exec:file { execute read open execute_no_trans getattr };
allow appdomain phhsu_daemon:dir { search };
@ -54,8 +51,8 @@ allow phhsu_daemon self:file { rwx_file_perms create rename setattr unlink };
allow phhsu_daemon self:lnk_file { r_file_perms execmod };
allow phhsu_daemon adbd_exec:file { getattr read };
allow phhsu_daemon { rootfs same_process_hal_file system_file tmpfs }:file { mounton getattr };
allow phhsu_daemon self:capability { sys_admin chown setuid setgid net_raw dac_override dac_read_search kill fowner mknod };
allow phhsu_daemon { rootfs same_process_hal_file system_file }:file { mounton getattr };
allow phhsu_daemon self:capability { sys_admin chown setuid setgid net_raw dac_override dac_read_search kill };
allow phhsu_daemon self:capability2 { syslog };
allow phhsu_daemon shell_exec:file rx_file_perms;
allow phhsu_daemon system_file:file { rx_file_perms entrypoint };
@ -92,11 +89,10 @@ allow phhsu_daemon dex2oat_exec:file rx_file_perms;
allow phhsu_daemon phhsu_daemon_tmpfs:file rwx_file_perms;
allow phhsu_daemon { proc_type dev_type exec_type file_type sysfs_type fs_type phhsu_daemon }:file { rwx_file_perms create mounton setattr getattr relabelto relabelfrom unlink rename };
allow phhsu_daemon { proc_type dev_type exec_type file_type sysfs_type fs_type phhsu_daemon }:lnk_file { rw_file_perms create mounton setattr getattr relabelto relabelfrom unlink rename};
allow phhsu_daemon { proc_type dev_type exec_type file_type sysfs_type fs_type phhsu_daemon }:dir { rw_dir_perms create mounton setattr getattr relabelto relabelfrom unlink rename};
allow phhsu_daemon { proc_type dev_type exec_type file_type sysfs_type fs_type phhsu_daemon }:chr_file { rwx_file_perms unlink rename ioctl};
allow phhsu_daemon { proc_type dev_type exec_type file_type sysfs_type fs_type phhsu_daemon }:blk_file { rw_file_perms create unlink rename ioctl};
allow phhsu_daemon { proc_type dev_type exec_type file_type sysfs_type fs_type }:file { rwx_file_perms create };
allow phhsu_daemon { proc_type dev_type exec_type file_type sysfs_type fs_type }:dir rw_dir_perms;
allow phhsu_daemon { proc_type dev_type exec_type file_type sysfs_type fs_type }:chr_file rwx_file_perms;
allow phhsu_daemon { proc_type dev_type exec_type file_type sysfs_type fs_type }:blk_file rw_file_perms;
allow phhsu_daemon device:file rwx_file_perms;
allow phhsu_daemon device:dir rw_dir_perms;
@ -106,7 +102,7 @@ allow phhsu_daemon selinuxfs:file rwx_file_perms;
allow domain phhsu_daemon:process { sigchld };
allow phhsu_daemon domain:binder { call transfer };
allow phhsu_daemon kernel:system { syslog_read syslog_mod };
allow phhsu_daemon kernel:security { setenforce compute_av };
allow phhsu_daemon kernel:security { setenforce };
allow phhsu_daemon domain:unix_stream_socket { getattr };
allow phhsu_daemon logdr_socket:sock_file write;
@ -124,28 +120,4 @@ allow phhsu_daemon tombstoned:unix_stream_socket { connectto };
allow phhsu_daemon { property_data_file data_file_type tmpfs }:file create_file_perms;
allow phhsu_daemon { property_data_file data_file_type tmpfs }:dir create_dir_perms;
allow phhsu_daemon { tmpfs fs_type }:filesystem { mount remount unmount associate };
allow phhsu_daemon phhsu_daemon:file relabelfrom;
allow phhsu_daemon properties_device:dir { map };
allow phhsu_daemon { tmpfs }:dir { mounton };
allow phhsu_daemon { file_type shell_data_file system_file}:file { relabelto relabelfrom} ;
allow phhsu_daemon domain:fd { use };
allow phhsu_daemon domain:unix_stream_socket { connectto ioctl getattr getopt read write shutdown };
allow phhsu_daemon self:netlink_kobject_uevent_socket create_socket_perms;
allow phhsu_daemon self:{ netlink_tcpdiag_socket } { create_socket_perms nlmsg_write nlmsg_read };
allow phhsu_daemon self:{ netlink_selinux_socket } { create_socket_perms };
allow phhsu_daemon file_type:file create_file_perms;
allow phhsu_daemon file_type:dir create_dir_perms;
allow phhsu_daemon domain:process { transition };
# 05-09 00:05:30.149 18450 18450 W lprename: type=1400 audit(0.0:40923): avc: denied { ioctl } for path="/dev/block/sda25" dev="tmpfs" ino=19441 ioctlcmd=0x1278 scontext=u:r:phhsu_daemon:s0 tcontext=u:object_r:super_block_device:s0 tclass=blk_file permissive=0
# 06-06 12:59:53.775 30150 30150 I auditd : type=1400 audit(0.0:35585): avc: denied { ioctl } for comm="blockdev" path="/dev/block/dm-3" dev="tmpfs" ino=12687 ioctlcmd=0x125d scontext=u:r:phhsu_daemon:s0 tcontext=u:object_r:dm_device:s0 tclass=blk_file permissive=0
allowxperm phhsu_daemon { file_type block_device }:blk_file ioctl { 0-0xffff };
allowxperm phhsu_daemon { system_block_device super_block_device dm_device }:blk_file ioctl { 0x1278-0x127a 0x125d };
allow phhsu_daemon fs_type:filesystem { remount remount unmount associate};

View File

@ -3,42 +3,3 @@ allow system_app hidl_base_hwservice:hwservice_manager { add };
allow system_app wifi_data_file:dir create_dir_perms;
allow system_app wifi_data_file:file create_file_perms;
allow system_app sysfs_batteryinfo:file rw_file_perms;
type vendor_camera_prop, property_type;
set_prop(system_app, vendor_camera_prop);
type camera_prop, property_type;
set_prop(system_app, camera_prop);
type hal_ext_fingerprint_hwservice, hwservice_manager_type;
allow system_app hal_ext_fingerprint_hwservice:hwservice_manager { find };
type hal_fingerprint_default, domain;
allow system_app hal_fingerprint_default:binder { call };
allow system_app sysfs_power:dir r_dir_perms;
allow system_app sysfs_power:file rw_file_perms;
allow system_app sysfs_power:lnk_file read;
type default_hisi_hwservice, hwservice_manager_type;
allow system_app default_hisi_hwservice:hwservice_manager { find };
type hal_tp_default, domain;
allow system_app hal_tp_default:binder { call };
#cam2api
allow system_app vendor_default_prop:property_service { set };
set_prop(system_app, default_prop);
set_prop(system_app, exported3_default_prop);
type mtk_hal_rild_hwservice, hwservice_manager_type;
allow system_app mtk_hal_rild_hwservice:hwservice_manager { find};
type mtk_vilte_support_prop, property_type;
allow system_app mtk_vilte_support_prop:property_service set;
type hal_gesturewake_hwservice, hwservice_manager_type;
type hal_gesturewake_default, domain;
allow system_app hal_gesturewake_hwservice:hwservice_manager { find };
allow system_app hal_gesturewake_default:binder { call transfer };
allow hal_gesturewake_default system_app:binder { call transfer };

View File

@ -22,6 +22,3 @@ allow init vendor_configs_file:file { getattr mounton };
#/sys/module/five
allow vndk_detect sysfs:file r_file_perms;
allow vndk_detect sysfs:dir r_dir_perms;
#/proc/filesystems
allow vndk_detect proc_filesystems:file r_file_perms;

View File

@ -3,11 +3,3 @@ ro.adb.secure=0
#Disable for everyone for the moment
ro.sys.sdcardfs=0
persist.sys.overlay.nightmode=true
#Disable debugging strict mode toasts
persist.sys.strictmode.disable=true
persist.sys.phh.mainkeys=0
fw.max_users=10
persist.sys.max_profiles=10
ro.boot.realme.lockstate=0

Some files were not shown because too many files have changed in this diff Show More