Compare commits

..

18 Commits

Author SHA1 Message Date
Pierre-Hugues HUSSON 54d34268cb
Merge pull request #273 from guylamar2006/patch-1
Rename resetprop to resetprop_phh to prevent conflict with Magisk
2021-09-02 00:16:11 +02:00
guylamar2006 1e665496d2
Magisk
Changed resetprop to resetprop_phh to prevent conflict with Magisk.
2021-09-01 16:38:15 -05:00
guylamar2006 de8249361f
Magisk
Changed resetprop to resetprop_phh to prevent conflict with Magisk.
2021-09-01 16:32:14 -05:00
guylamar2006 98245d8427
Magisk
Renamed to setprop_phh to prevent conflict with Magisk.
2021-09-01 14:13:49 -05:00
Pierre-Hugues HUSSON 51964b08c2
Merge pull request #247 from TTTT555/patch-1
begonia: Drop deprecated props
2021-05-01 22:07:08 +02:00
TTTT555 9d3d8de412
begonia: Drop deprecated props
* these fixes are not needed since A10/A11 vendor (and only cause errors)
2021-05-01 21:13:59 +02:00
Pierre-Hugues HUSSON 1ddbcc1216
Merge pull request #224 from DarkJoker360/10-emui9-fp
Address Huawei fingerprint denials
2021-01-22 10:52:41 +01:00
DarkJoker360 207d758a4f Address Huawei fingerprint denials
* Fixes fingerprint enrollment issues on P vendor devices.
2021-01-22 10:42:34 +01:00
Pierre-Hugues HUSSON 0bf2de0b26
Merge pull request #214 from eremitein/merlin
tweaks for Xiaomi Redmi Note 9 'merlin'
2020-10-17 23:12:15 +02:00
Victor Bo 4f5c4420f4 tweaks for Xiaomi Redmi Note 9 'merlin'
audiojack, brightness, fp touches
  (thanks Akitake for reports)
2020-10-17 14:58:29 -04:00
Pierre-Hugues Husson 1be7bd1bb1 Fix CAF audio policy on non-boot 2020-10-13 17:20:26 +02:00
Pierre-Hugues HUSSON 3705999a82
Merge pull request #209 from eremitein/redmi9
Redmi9 need uinput trick
2020-10-07 20:55:13 +02:00
Victor Bo 7370ee9c1b Redmi9 need uinput trick 2020-10-07 14:14:42 -04:00
Pierre-Hugues Husson 9a2b982b7f Some devices require their vendor mounted to /persist even if fstab says otherwise
See https://github.com/phhusson/treble_experimentations/issues/668
2020-10-05 22:14:32 +02:00
Pierre-Hugues Husson 768afc3cbe Fix A2DP on some Qualcomm Q vendors by disable A2DP offload harder
Also there is a mismatch between framework which expects property to be
false/true and treble app setting it to 0/1
2020-10-02 20:05:58 +02:00
Pierre-Hugues Husson 51f9d61755 Looks like Samsung FODs are calibrated at 319 nits, not max brightness 2020-09-29 00:19:35 +02:00
Pierre-Hugues HUSSON 57029e924a
Merge pull request #204 from LooKeR-learner/android-10.0
Fix jack on realme 6
2020-09-25 13:39:38 +00:00
Mohit 106e66d123
Update rw-system.sh 2020-09-25 17:38:51 +05:30
43 changed files with 154 additions and 1165 deletions

View File

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

24
base.mk
View File

@ -6,14 +6,13 @@ PRODUCT_COPY_FILES := \
frameworks/native/data/etc/android.hardware.telephony.ims.xml:system/etc/permissions/android.hardware.telephony.ims.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.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.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 \
#Use a more decent APN config #Use a more decent APN config
PRODUCT_COPY_FILES += \ PRODUCT_COPY_FILES += \
device/sample/etc/apns-full-conf.xml:system/etc/apns-conf.xml device/sample/etc/apns-full-conf.xml:system/etc/apns-conf.xml
BOARD_PLAT_PRIVATE_SEPOLICY_DIR += device/phh/treble/sepolicy 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, vendor/hardware_overlay/overlay.mk)
$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
@ -43,8 +42,7 @@ PRODUCT_COPY_FILES += \
#USB Audio #USB Audio
PRODUCT_COPY_FILES += \ PRODUCT_COPY_FILES += \
frameworks/av/services/audiopolicy/config/usb_audio_policy_configuration.xml:system/etc/usb_audio_policy_configuration.xml \ 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 \
# NFC: # NFC:
# Provide default libnfc-nci.conf file for devices that does not have one in # Provide default libnfc-nci.conf file for devices that does not have one in
@ -124,13 +122,8 @@ PRODUCT_COPY_FILES += \
device/phh/treble/files/daisy-uinput-fpc.kl:system/phh/daisy-uinput-fpc.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/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/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-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/zf6-googlekey_input.kl:system/phh/zf6-googlekey_input.kl \
device/phh/treble/files/teracube2e-mtk-kpd.kl:system/phh/teracube2e-mtk-kpd.kl \
SELINUX_IGNORE_NEVERALLOWS := true SELINUX_IGNORE_NEVERALLOWS := true
@ -159,7 +152,6 @@ PRODUCT_PACKAGES += \
PRODUCT_PACKAGES += \ PRODUCT_PACKAGES += \
resetprop_phh resetprop_phh
PRODUCT_COPY_FILES += \ PRODUCT_COPY_FILES += \
device/phh/treble/phh-securize.sh:system/bin/phh-securize.sh \ device/phh/treble/phh-securize.sh:system/bin/phh-securize.sh \
device/phh/treble/files/ota.sh:system/bin/ota.sh \ device/phh/treble/files/ota.sh:system/bin/ota.sh \
@ -169,7 +161,6 @@ PRODUCT_COPY_FILES += \
PRODUCT_COPY_FILES += \ PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.software.secure_lock_screen.xml:system/etc/permissions/android.software.secure_lock_screen.xml \ 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 += \ PRODUCT_COPY_FILES += \
device/phh/treble/ld.config.26.txt:system/etc/ld.config.26.txt \ device/phh/treble/ld.config.26.txt:system/etc/ld.config.26.txt \
@ -189,19 +180,8 @@ PRODUCT_COPY_FILES += \
PRODUCT_PACKAGES += \ PRODUCT_PACKAGES += \
android.hardware.biometrics.fingerprint@2.1-service.oppo.compat \ android.hardware.biometrics.fingerprint@2.1-service.oppo.compat \
android.hardware.biometrics.fingerprint@2.1-service.oplus.compat \
PRODUCT_PACKAGES += \ PRODUCT_PACKAGES += \
vr_hwc \ vr_hwc \
curl \ curl \
healthd \
PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
debug.fdsan=warn_once \
# AOSP overlays
PRODUCT_PACKAGES += \
NavigationBarMode2ButtonOverlay
PRODUCT_PACKAGES += \
oplus-alert-slider

View File

@ -198,8 +198,6 @@ cc_binary {
"libfs_mgr", "libfs_mgr",
"libutils", "libutils",
"libcutils", "libcutils",
"android.hardware.boot@1.1",
"libhidlbase",
], ],
static_libs: [ static_libs: [
"libdm", "libdm",
@ -212,36 +210,6 @@ cc_binary {
], ],
} }
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 { cc_binary {
name: "sec-camera-list", name: "sec-camera-list",
srcs: [ srcs: [
@ -253,13 +221,3 @@ cc_binary {
"libhidlbase", "libhidlbase",
], ],
} }
cc_binary {
name: "oplus-alert-slider",
srcs: [
"oplus-alert-slider.cpp",
],
init_rc: [
"oplus-alert-slider.rc",
],
}

View File

@ -40,11 +40,6 @@
#include <fs_mgr_dm_linear.h> #include <fs_mgr_dm_linear.h>
#include <libdm/dm.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;
using namespace android::fs_mgr; using namespace android::fs_mgr;
@ -67,6 +62,7 @@ public:
static FileOrBlockDeviceOpener opener; static FileOrBlockDeviceOpener opener;
std::unique_ptr<MetadataBuilder> makeBuilder() { std::unique_ptr<MetadataBuilder> makeBuilder() {
MetadataBuilder::OverrideABForTesting(false);
auto builder = MetadataBuilder::New(opener, "super", 0); auto builder = MetadataBuilder::New(opener, "super", 0);
if(builder == nullptr) { if(builder == nullptr) {
std::cout << "Failed creating super builder" << std::endl; std::cout << "Failed creating super builder" << std::endl;
@ -82,25 +78,8 @@ void saveToDisk(std::unique_ptr<MetadataBuilder> builder) {
} }
} }
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) { std::string findGroup(std::unique_ptr<MetadataBuilder>& builder) {
auto groups = builder->ListGroups(); 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 = ""; std::string maxGroup = "";
uint64_t maxGroupSize = 0; uint64_t maxGroupSize = 0;
for(auto groupName: groups) { for(auto groupName: groups) {
@ -138,20 +117,15 @@ int main(int argc, char **argv) {
exit(1); exit(1);
} }
partition = builder->AddPartition(partName, group, 0); partition = builder->AddPartition(partName, group, 0);
auto result = builder->ResizePartition(partition, size); std::cout << "Growing partition " << builder->ResizePartition(partition, size) << std::endl;
std::cout << "Growing partition " << result << std::endl;
if(!result) return 1;
saveToDisk(std::move(builder)); saveToDisk(std::move(builder));
std::string dmPath; std::string dmPath;
CreateLogicalPartitionParams params { auto dmCreateRes = android::fs_mgr::CreateLogicalPartition(
.block_device = "/dev/block/by-name/super", "/dev/block/by-name/super",
.metadata_slot = 0, 0, partName,
.partition_name = partName, true,
.timeout_ms = std::chrono::milliseconds(10000), std::chrono::milliseconds(10000), &dmPath);
.force_writable = true,
};
auto dmCreateRes = android::fs_mgr::CreateLogicalPartition(params, &dmPath);
std::cout << "Creating dm partition for " << partName << " answered " << dmCreateRes << " at " << dmPath << std::endl; std::cout << "Creating dm partition for " << partName << " answered " << dmCreateRes << " at " << dmPath << std::endl;
exit(0); exit(0);
} else if(strcmp(argv[1], "remove") == 0) { } else if(strcmp(argv[1], "remove") == 0) {
@ -162,7 +136,7 @@ int main(int argc, char **argv) {
auto partName = argv[2]; auto partName = argv[2];
auto dmState = android::dm::DeviceMapper::Instance().GetState(partName); auto dmState = android::dm::DeviceMapper::Instance().GetState(partName);
if(dmState == android::dm::DmDeviceState::ACTIVE) { if(dmState == android::dm::DmDeviceState::ACTIVE) {
android::fs_mgr::DestroyLogicalPartition(partName); android::fs_mgr::DestroyLogicalPartition(partName, std::chrono::milliseconds(2000));
} }
builder->RemovePartition(partName); builder->RemovePartition(partName);
saveToDisk(std::move(builder)); saveToDisk(std::move(builder));
@ -187,23 +161,13 @@ int main(int argc, char **argv) {
auto src = argv[2]; auto src = argv[2];
auto dst = argv[3]; auto dst = argv[3];
auto srcPartition = builder->FindPartition(src); 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; std::vector<std::unique_ptr<Extent>> originalExtents;
const auto& extents = srcPartition->extents(); const auto& extents = srcPartition->extents();
for(unsigned i=0; i<extents.size(); i++) { for(unsigned i=0; i<extents.size(); i++) {
const auto& extend = extents[i]; const auto& extend = extents[i];
auto linear = extend->AsLinearExtent(); auto linear = extend->AsLinearExtent();
std::cerr << (linear != nullptr) << std::endl;
if(linear != nullptr) { if(linear != nullptr) {
auto copyLinear = std::make_unique<LinearExtent>(linear->num_sectors(), linear->device_index(), linear->physical_sector()); auto copyLinear = std::make_unique<LinearExtent>(linear->num_sectors(), linear->device_index(), linear->physical_sector());
originalExtents.push_back(std::move(copyLinear)); originalExtents.push_back(std::move(copyLinear));
@ -212,9 +176,9 @@ int main(int argc, char **argv) {
originalExtents.push_back(std::move(copyZero)); originalExtents.push_back(std::move(copyZero));
} }
} }
builder->RemovePartition(srcPartition->name()); builder->RemovePartition(src);
builder->RemovePartition(dstPartitionName); builder->RemovePartition(dst);
auto newDstPartition = builder->AddPartition(dstPartitionName, group, 0); auto newDstPartition = builder->AddPartition(dst, group, 0);
for(auto&& extent: originalExtents) { for(auto&& extent: originalExtents) {
newDstPartition->AddExtent(std::move(extent)); newDstPartition->AddExtent(std::move(extent));
} }
@ -227,14 +191,11 @@ int main(int argc, char **argv) {
} }
auto partName = argv[2]; auto partName = argv[2];
std::string dmPath; std::string dmPath;
CreateLogicalPartitionParams params { auto dmCreateRes = android::fs_mgr::CreateLogicalPartition(
.block_device = "/dev/block/by-name/super", "/dev/block/by-name/super",
.metadata_slot = 0, 0, partName,
.partition_name = partName, true,
.timeout_ms = std::chrono::milliseconds(10000), std::chrono::milliseconds(10000), &dmPath);
.force_writable = true,
};
auto dmCreateRes = android::fs_mgr::CreateLogicalPartition(params, &dmPath);
std::cout << "Creating dm partition for " << partName << " answered " << dmCreateRes << " at " << dmPath << std::endl; std::cout << "Creating dm partition for " << partName << " answered " << dmCreateRes << " at " << dmPath << std::endl;
exit(0); exit(0);
} else if(strcmp(argv[1], "unmap") == 0) { } else if(strcmp(argv[1], "unmap") == 0) {
@ -245,64 +206,9 @@ int main(int argc, char **argv) {
auto partName = argv[2]; auto partName = argv[2];
auto dmState = android::dm::DeviceMapper::Instance().GetState(partName); auto dmState = android::dm::DeviceMapper::Instance().GetState(partName);
if(dmState == android::dm::DmDeviceState::ACTIVE) { if(dmState == android::dm::DmDeviceState::ACTIVE) {
android::fs_mgr::DestroyLogicalPartition(partName); android::fs_mgr::DestroyLogicalPartition(partName, std::chrono::milliseconds(2000));
} }
exit(0); 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; 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

@ -41,17 +41,10 @@ typedef struct chunk_header {
* For a CRC32 chunk, it's 4 bytes of CRC32 * 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) { void nsendfile(int out_fd, int in_fd, size_t count) {
char buf[1024*1024]; char buf[1024*1024];
while(count) { while(count) {
ssize_t res = -1; ssize_t res = splice(in_fd, NULL, out_fd, NULL, count, 0);
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) { if(res==-1) {
ssize_t sizeToRead = sizeof(buf); ssize_t sizeToRead = sizeof(buf);
if(count < sizeToRead) sizeToRead = count; if(count < sizeToRead) sizeToRead = count;

View File

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

View File

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

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,72 +1,65 @@
#!/system/bin/sh #!/bin/bash
set -e set -e
if ! [ "$(getprop ro.boot.dynamic_partitions)" = true ];then latestVersion=$(curl -L --silent https://api.github.com/repos/phhusson/treble_experimentations/releases |grep -oE 'v2[0-9]*' |sort -V |sort -u |tail -n 1)
echo "OTA is supported only for devices with dynamic partitions!" if [ -n "$1" ];then
exit 1 echo "Forcing dl of version $1 instead of $latestVersion"
latestVersion="$1"
fi fi
flavor=$(getprop ro.product.product.name) flavor=$(getprop ro.build.flavor)
nextVersion=$(curl --silent -L https://raw.githubusercontent.com/phhusson/treble_experimentations/master/ota/roar/$flavor/date) fileName=""
if [ -z "$nextVersion" ];then
echo "Couldn't find any OTA for $flavor" fileName="system-quack"
exit 1 if echo "$flavor" |grep -E '^treble_arm64';then
fileName="${fileName}-arm64"
elif echo "$flavor" | grep -E '^treble_arm_';then
fileName="${fileName}-arm"
elif echo "$flavor" | grep -E '^treble_a64_';then
fileName="${fileName}-arm32_binder64"
fi fi
url=$(curl --silent -L https://raw.githubusercontent.com/phhusson/treble_experimentations/master/ota/roar/$flavor/url) if echo "$flavor" |grep -E '^treble_[^_]*_b';then
size=$(curl --silent -L https://raw.githubusercontent.com/phhusson/treble_experimentations/master/ota/roar/$flavor/size) fileName="${fileName}-ab"
elif echo "$flavor" |grep -E '^treble_[^_]*_a';then
if [ "$(getprop ro.product.build.date.utc)" = "$nextVersion" ];then fileName="${fileName}-aonly"
echo "Installing $nextVersion onto itself, aborting"
exit 1
fi 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 if echo "$flavor" |grep -E '^treble_[^_]*_.g';then
echo "Warning! The build you are currently running is unknown. Type YES to confirm you want to apply OTA from $url" fileName="${fileName}-gapps"
read answer elif echo "$flavor" |grep -E '^treble_[^_]*_.o';then
if ! [ "$answer" = YES ];then fileName="${fileName}-go"
exit 1 elif echo "$flavor" |grep -E '^treble_[^_]*_.f';then
fi fileName="${fileName}-floss"
elif echo "$flavor" |grep -E '^treble_[^_]*_.v';then
fileName="${fileName}-floss"
fi fi
if [ -b /dev/tmp-phh ] && ! tune2fs -l /dev/tmp-phh |grep 'Last mount time' |grep -q n/a;then fileName="${fileName}.img.xz"
echo "Warning! It looks like you modified your system image! Flashing this OTA will revert this!" url=https://github.com/phhusson/treble_experimentations/releases/download/"$latestVersion"/"${fileName}"
echo "Type YES to acknowledge" echo "Downloading from ${url}..."
read answer #This path is really NOT ideal.
if ! [ "$answer" = YES ];then out=/sdcard/sys.img.xz
exit 1 curl -L "$url" > $out
fi
if [ "$(getprop ro.boot.dynamic_partitions)" = true ];then
#Having to decompress twice is pretty stupid, but how do I get the size otherwise?
size=$(busybox_phh xz -d -c < $out | simg2img_simple |wc -c)
lptools remove system_phh
lptools create system_phh "$size"
lptools unmap system_phh
dmDevice=$(lptools map system_phh|grep -oE '/dev/block/[^ ]*')
busybox_phh xz -d -c < $out | simg2img_simple > $dmDevice
lptools replace system_phh system
reboot
exit 0
else
#Use twrp.sh
mkdir -p /cache/phh
uncrypt /data/media/0/sys.img.xz /cache/phh/block.map
touch /cache/phh/flash
reboot
exit 0
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

@ -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,7 +1,6 @@
BUILD_GMS := yes BUILD_GMS := yes
#include not inherit, because we must edit some values #include not inherit, because we must edit some values
-include vendor/google/products/gms_go.mk 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))) FILTER_OUT = $(foreach v,$(2),$(if $(findstring $(1),$(v)),,$(v)))

View File

@ -1,7 +1,6 @@
BUILD_GMS := yes BUILD_GMS := yes
ifneq ($(wildcard vendor/google)$(wildcard vendor/partner_gms),) ifneq ($(wildcard vendor/google),)
-include vendor/google/products/gms.mk -include vendor/google/products/gms.mk
-include vendor/partner_gms/products/gms.mk
PRODUCT_SHIPPING_API_LEVEL := PRODUCT_SHIPPING_API_LEVEL :=
PRODUCT_PACKAGES := $(filter-out CalendarGoogle, $(PRODUCT_PACKAGES)) PRODUCT_PACKAGES := $(filter-out CalendarGoogle, $(PRODUCT_PACKAGES))
@ -23,7 +22,7 @@ PRODUCT_COPY_FILES += \
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.experimental2016.xml \
device/phh/treble/empty-permission.xml:system/etc/permissions/com.google.android.camera.experimental2017.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 GAPPS_VARIANT := pico
DONT_DEXPREOPT_PREBUILTS := true DONT_DEXPREOPT_PREBUILTS := true
WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY := true WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY := true

View File

@ -80,6 +80,7 @@ for part in a ab;do
TARGET_GAPPS_ARCH := ${baseArch} TARGET_GAPPS_ARCH := ${baseArch}
\$(call inherit-product, device/phh/treble/base-pre.mk) \$(call inherit-product, device/phh/treble/base-pre.mk)
include build/make/target/product/aosp_${baseArch}_ab.mk include build/make/target/product/aosp_${baseArch}_ab.mk
\$(call inherit-product, vendor/vndk/${vndk})
\$(call inherit-product, device/phh/treble/base.mk) \$(call inherit-product, device/phh/treble/base.mk)
$optional_base $optional_base
$apps_script $apps_script
@ -87,8 +88,7 @@ $rom_script
PRODUCT_NAME := $target PRODUCT_NAME := $target
PRODUCT_DEVICE := phhgsi_${arch}_$part PRODUCT_DEVICE := phhgsi_${arch}_$part
PRODUCT_BRAND := Phh PRODUCT_BRAND := Android
PRODUCT_SYSTEM_BRAND := Phh
PRODUCT_MODEL := Phh-Treble $apps_name PRODUCT_MODEL := Phh-Treble $apps_name
PRODUCT_PACKAGES += $extra_packages PRODUCT_PACKAGES += $extra_packages

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

@ -14,6 +14,7 @@ cc_binary {
"libcutils", "libcutils",
"liblog", "liblog",
"libhidlbase", "libhidlbase",
"libhidltransport",
"libhardware", "libhardware",
"libutils", "libutils",
"libbase", "libbase",

View File

@ -26,11 +26,6 @@
<bool name="config_unplugTurnsOnScreen">true</bool> <bool name="config_unplugTurnsOnScreen">true</bool>
<integer name="config_multiuserMaximumUsers">5</integer> <integer name="config_multiuserMaximumUsers">5</integer>
<bool name="config_enableMultiUserUI">true</bool> <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> <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_swipe_up_gesture_setting_available">true</bool>
@ -39,20 +34,4 @@
<dimen name="config_buttonCornerRadius">4.0dip</dimen> <dimen name="config_buttonCornerRadius">4.0dip</dimen>
<bool name="config_cellBroadcastAppLinks">true</bool> <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> </resources>

View File

@ -36,20 +36,18 @@ setprop ctl.stop storageproxyd
sleep 10 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 if [ "$vndk" = 27 ];then
mount $minijailSrc64 /vendor/lib64/libminijail_vendor.so mount /system/lib64/vndk-27/libminijail.so /vendor/lib64/libminijail_vendor.so
mount $minijailSrc /vendor/lib/libminijail_vendor.so mount /system/lib/vndk-27/libminijail.so /vendor/lib/libminijail_vendor.so
fi fi
if [ "$vndk" = 28 ];then if [ "$vndk" = 28 ];then
mount $minijailSrc64 /vendor/lib64/libminijail_vendor.so mount /system/lib64/vndk-27/libminijail.so /vendor/lib64/libminijail_vendor.so
mount $minijailSrc /vendor/lib/libminijail_vendor.so mount /system/lib/vndk-27/libminijail.so /vendor/lib/libminijail_vendor.so
mount $minijailSrc64 /system/lib64/vndk-28/libminijail.so mount /system/lib64/vndk-27/libminijail.so /system/lib64/vndk-28/libminijail.so
mount $minijailSrc /system/lib/vndk-28/libminijail.so mount /system/lib/vndk-27/libminijail.so /system/lib/vndk-28/libminijail.so
mount $minijailSrc64 /vendor/lib64/libminijail.so mount /system/lib64/vndk-27/libminijail.so /vendor/lib64/libminijail.so
mount $minijailSrc /vendor/lib/libminijail.so mount /system/lib/vndk-27/libminijail.so /vendor/lib/libminijail.so
fi fi
#Clear looping services #Clear looping services

View File

@ -14,18 +14,16 @@ if getprop persist.sys.phh.caf.media_profile |grep -q true;then
fi 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 if [ "$vndk" = 27 ];then
mount $minijailSrc64 /vendor/lib64/libminijail_vendor.so mount /system/lib64/vndk-27/libminijail.so /vendor/lib64/libminijail_vendor.so
mount $minijailSrc /vendor/lib/libminijail_vendor.so mount /system/lib/vndk-27/libminijail.so /vendor/lib/libminijail_vendor.so
fi fi
if [ "$vndk" = 28 ];then if [ "$vndk" = 28 ];then
mount $minijailSrc64 /vendor/lib64/libminijail_vendor.so mount /system/lib64/vndk-27/libminijail.so /vendor/lib64/libminijail_vendor.so
mount $minijailSrc /vendor/lib/libminijail_vendor.so mount /system/lib/vndk-27/libminijail.so /vendor/lib/libminijail_vendor.so
mount $minijailSrc64 /system/lib64/vndk-28/libminijail.so mount /system/lib64/vndk-27/libminijail.so /system/lib64/vndk-28/libminijail.so
mount $minijailSrc /system/lib/vndk-28/libminijail.so mount /system/lib/vndk-27/libminijail.so /system/lib/vndk-28/libminijail.so
mount $minijailSrc64 /vendor/lib64/libminijail.so mount /system/lib64/vndk-27/libminijail.so /vendor/lib64/libminijail.so
mount $minijailSrc /vendor/lib/libminijail.so mount /system/lib/vndk-27/libminijail.so /vendor/lib/libminijail.so
fi fi

View File

@ -119,37 +119,13 @@ if [ "$1" == "persist.sys.phh.caf.audio_policy" ];then
exit 1 exit 1
fi fi
sku="$(getprop ro.boot.product.vendor.sku)"
if [[ "$prop_value" == 1 ]];then if [[ "$prop_value" == 1 ]];then
umount /vendor/etc/audio umount /vendor/etc/audio
umount /vendor/etc/audio umount /vendor/etc/audio
mount /vendor/etc/audio/audio_policy_configuration.xml /vendor/etc/audio_policy_configuration.xml
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 else
umount /vendor/etc/audio_policy_configuration.xml umount /vendor/etc/audio_policy_configuration.xml
umount /vendor/etc/audio/sku_$sku/audio_policy_configuration.xml mount /mnt/phh/empty_dir /vendor/etc/audio
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 fi
restartAudio restartAudio
exit exit
@ -167,20 +143,3 @@ if [ "$1" == "persist.sys.phh.vsmart.dt2w" ];then
fi fi
exit exit
fi 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,22 +1,13 @@
#!/system/bin/sh #!/system/bin/sh
if [ -e /system/bin/magisk ] SYSTEM=/system
then [ -d /sbin/.magisk/mirror/system ] && SYSTEM=/sbin/.magisk/mirror/system
# 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) for MOUNTPOINT in \
umount -l /system/xbin/su /sbin/.magisk/mirror/system_root \
/sbin/.magisk/mirror/system \
for MOUNTPOINT in $MOUNTPOINT_LIST /system \
/
do do
[ -d $MOUNTPOINT ] && mountpoint -q $MOUNTPOINT && break [ -d $MOUNTPOINT ] && mountpoint -q $MOUNTPOINT && break
done done
@ -25,6 +16,7 @@ mount -o remount,rw $MOUNTPOINT
remount remount
touch $SYSTEM/phh/secure touch $SYSTEM/phh/secure
umount -l $SYSTEM/xbin/su
rm $SYSTEM/xbin/su rm $SYSTEM/xbin/su
rm $SYSTEM/bin/phh-su rm $SYSTEM/bin/phh-su
rm $SYSTEM/etc/init/su.rc rm $SYSTEM/etc/init/su.rc

View File

@ -6,3 +6,5 @@ BOARD_SYSTEMIMAGE_PARTITION_SIZE := 2147483648
else else
BOARD_SYSTEMIMAGE_PARTITION_RESERVED_SIZE := 33554432 BOARD_SYSTEMIMAGE_PARTITION_RESERVED_SIZE := 33554432
endif endif
BUILD_BROKEN_PHONY_TARGETS := true

View File

@ -3,6 +3,4 @@
<privapp-permissions package="me.phh.treble.app"> <privapp-permissions package="me.phh.treble.app">
<permission name="android.permission.INTERACT_ACROSS_USERS"/> <permission name="android.permission.INTERACT_ACROSS_USERS"/>
</privapp-permissions> </privapp-permissions>
<!-- fix voice channels in calls (stop unloading treble-app) -->
<allow-in-power-save package="me.phh.treble.app" />
</permissions> </permissions>

View File

@ -1,56 +1,10 @@
#!/system/bin/sh #!/system/bin/sh
if [ -z "$debug" ] && [ -f /cache/phh-log ];then #Uncomment me to output sh -x of this script to /cache/phh/logs
mkdir -p /cache/phh #if [ -z "$debug" ];then
debug=1 exec sh -x "$(readlink -f -- "$0")" > /cache/phh/logs 2>&1 # mkdir -p /cache/phh
else # debug=1 exec sh -x "$(readlink -f -- "$0")" > /cache/phh/logs 2>&1
# Allow accessing logs from system app #fi
# 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
vndk="$(getprop persist.sys.vndk)" vndk="$(getprop persist.sys.vndk)"
[ -z "$vndk" ] && vndk="$(getprop ro.vndk.version |grep -oE '^[0-9]+')" [ -z "$vndk" ] && vndk="$(getprop ro.vndk.version |grep -oE '^[0-9]+')"
@ -68,8 +22,8 @@ fixSPL() {
else else
setprop ro.keymaster.mod 'AOSP on ARM64' setprop ro.keymaster.mod 'AOSP on ARM64'
fi fi
img="$(find /dev/block -type l -iname kernel"$(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 -iname boot"$(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 if [ -n "$img" ]; then
#Rewrite SPL/Android version if needed #Rewrite SPL/Android version if needed
Arelease="$(getSPL "$img" android)" Arelease="$(getSPL "$img" android)"
@ -77,22 +31,16 @@ fixSPL() {
setprop ro.keymaster.xxx.security_patch "$(getSPL "$img" spl)" setprop ro.keymaster.xxx.security_patch "$(getSPL "$img" spl)"
setprop ro.keymaster.brn Android setprop ro.keymaster.brn Android
if getprop ro.vendor.build.fingerprint |grep -qiE 'samsung.*star.*lte';then getprop ro.vendor.build.fingerprint | grep -qiE '^samsung/' && return 0
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 \ 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 \ /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 \ /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/lib64/vndk/libsoftkeymasterdevice.so /system/lib/vndk/libsoftkeymasterdevice.so \
/system/lib/vndk-26/libsoftkeymasterdevice.so \ /system/lib/vndk-26/libsoftkeymasterdevice.so \
/system/lib/vndk-27/libsoftkeymasterdevice.so /system/lib64/vndk-27/libsoftkeymasterdevice.so \ /system/lib/vndk-27/libsoftkeymasterdevice.so /system/lib64/vndk-27/libsoftkeymasterdevice.so \
/vendor/lib/libkeymaster3device.so /vendor/lib64/libkeymaster3device.so \ /vendor/lib/libkeymaster3device.so /vendor/lib64/libkeymaster3device.so \
/vendor/lib/libMcTeeKeymaster.so /vendor/lib64/libMcTeeKeymaster.so \ /vendor/lib/libMcTeeKeymaster.so /vendor/lib64/libMcTeeKeymaster.so \
/vendor/lib/hw/libMcTeeKeymaster.so /vendor/lib64/hw/libMcTeeKeymaster.so $additional; do /vendor/lib/hw/libMcTeeKeymaster.so /vendor/lib64/hw/libMcTeeKeymaster.so ; do
[ ! -f "$f" ] && continue [ ! -f "$f" ] && continue
# shellcheck disable=SC2010 # shellcheck disable=SC2010
ctxt="$(ls -lZ "$f" | grep -oE 'u:object_r:[^:]*:s0')" ctxt="$(ls -lZ "$f" | grep -oE 'u:object_r:[^:]*:s0')"
@ -137,7 +85,12 @@ changeKeylayout() {
fi fi
if getprop ro.vendor.build.fingerprint | grep -iq \ if getprop ro.vendor.build.fingerprint | grep -iq \
-e poco/ -e redmi/ -e xiaomi/ ; 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 Redmi/begonia\
-e xiaomi/nitrogen -e xiaomi/sakura -e xiaomi/andromeda \
-e xiaomi/whyred -e xiaomi/tulip -e xiaomi/onc -e Redmi/merlin \
-e redmi/curtana -e redmi/picasso -e redmi/galahad; then
if [ ! -f /mnt/phh/keylayout/uinput-goodix.kl ]; then if [ ! -f /mnt/phh/keylayout/uinput-goodix.kl ]; then
cp /system/phh/empty /mnt/phh/keylayout/uinput-goodix.kl cp /system/phh/empty /mnt/phh/keylayout/uinput-goodix.kl
chmod 0644 /mnt/phh/keylayout/uinput-goodix.kl chmod 0644 /mnt/phh/keylayout/uinput-goodix.kl
@ -197,9 +150,7 @@ changeKeylayout() {
changed=true changed=true
fi fi
if ( getprop ro.build.overlay.deviceid |grep -q -e RMX1931 -e RMX1941 -e CPH1859 -e CPH1861 -e RMX2185) || if getprop ro.build.overlay.deviceid |grep -q -e RMX1931 -e RMX1941 -e CPH1859 -e CPH1861;then
( 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/touchpanel.kl
cp /system/phh/oppo-touchpanel.kl /mnt/phh/keylayout/mtk-tpd.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/touchpanel.kl
@ -227,12 +178,6 @@ changeKeylayout() {
changed=true changed=true
fi 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 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-goodixfp.kl /mnt/phh/keylayout/goodixfp.kl
cp /system/phh/zf6-googlekey_input.kl /mnt/phh/keylayout/googlekey_input.kl cp /system/phh/zf6-googlekey_input.kl /mnt/phh/keylayout/googlekey_input.kl
@ -241,24 +186,6 @@ changeKeylayout() {
changed=true changed=true
fi 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 if [ "$changed" = true ]; then
mount -o bind /mnt/phh/keylayout /system/usr/keylayout mount -o bind /mnt/phh/keylayout /system/usr/keylayout
restorecon -R /system/usr/keylayout restorecon -R /system/usr/keylayout
@ -312,13 +239,8 @@ if grep vendor.huawei.hardware.biometrics.fingerprint /vendor/manifest.xml; then
fi fi
foundFingerprint=false foundFingerprint=false
for manifest in /vendor/manifest.xml /vendor/etc/vintf/manifest.xml /odm/etc/vintf/manifest.xml;do for manifest in /vendor/manifest.xml /vendor/etc/vintf/manifest.xml;do
if grep -q \ if grep -q -e android.hardware.biometrics.fingerprint -e vendor.oppo.hardware.biometrics.fingerprint $manifest;then
-e android.hardware.biometrics.fingerprint \
-e vendor.oppo.hardware.biometrics.fingerprint \
-e vendor.oplus.hardware.biometrics.fingerprint \
$manifest;
then
foundFingerprint=true foundFingerprint=true
fi fi
done done
@ -377,33 +299,32 @@ fi
if getprop ro.vendor.build.fingerprint | grep -q -i \ if getprop ro.vendor.build.fingerprint | grep -q -i \
-e xiaomi/clover -e xiaomi/wayne -e xiaomi/sakura \ -e xiaomi/clover -e xiaomi/wayne -e xiaomi/sakura \
-e xiaomi/nitrogen -e xiaomi/whyred -e xiaomi/platina \ -e xiaomi/nitrogen -e xiaomi/whyred -e xiaomi/platina -e Redmi/merlin \
-e xiaomi/ysl -e nubia/nx60 -e nubia/nx61 -e xiaomi/tulip \ -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 xiaomi/lavender -e xiaomi/olive -e xiaomi/olivelite -e xiaomi/pine; then
-e Redmi/lancelot -e Redmi/galahad; then
setprop persist.sys.qcom-brightness "$(cat /sys/class/leds/lcd-backlight/max_brightness)" setprop persist.sys.qcom-brightness "$(cat /sys/class/leds/lcd-backlight/max_brightness)"
fi fi
#Xiaomi Redmi Note 9
if getprop ro.vendor.build.fingerprint |grep -qi -e Redmi/merlin; then
setprop persist.sys.overlay.devinputjack true
fi
#Realme 6 #Realme 6
if getprop ro.vendor.product.device |grep -iq -e RMX2001 -e RMX2151 -e RMX2111 -e RMX2111L1;then if getprop ro.vendor.product.device |grep -iq -e RMX2001;then
setprop persist.sys.phh.fingerprint.nocleanup true setprop persist.sys.phh.fingerprint.nocleanup true
setprop persist.sys.qcom-brightness "$(cat /sys/class/leds/lcd-backlight/max_brightness)" setprop persist.sys.qcom-brightness "$(cat /sys/class/leds/lcd-backlight/max_brightness)"
setprop persist.sys.overlay.devinputjack true
fi fi
if getprop ro.vendor.product.device |grep -iq -e RMX1801 -e RMX1803 -e RMX1807;then 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)" setprop persist.sys.qcom-brightness "$(cat /sys/class/leds/lcd-backlight/max_brightness)"
fi fi
if getprop ro.build.overlay.deviceid |grep -q -e CPH1859 -e CPH1861 -e RMX1811 -e RMX2185;then if getprop ro.build.overlay.deviceid |grep -q -e CPH1859 -e CPH1861 -e RMX1811;then
setprop persist.sys.qcom-brightness "$(cat /sys/class/leds/lcd-backlight/max_brightness)" setprop persist.sys.qcom-brightness "$(cat /sys/class/leds/lcd-backlight/max_brightness)"
fi 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 \ if getprop ro.vendor.build.fingerprint | grep -iq \
-e xiaomi/beryllium/beryllium -e xiaomi/sirius/sirius \ -e xiaomi/beryllium/beryllium -e xiaomi/sirius/sirius \
-e xiaomi/dipper/dipper -e xiaomi/ursa/ursa -e xiaomi/polaris/polaris \ -e xiaomi/dipper/dipper -e xiaomi/ursa/ursa -e xiaomi/polaris/polaris \
@ -411,20 +332,13 @@ if getprop ro.vendor.build.fingerprint | grep -iq \
-e xiaomi/equuleus/equuleus -e motorola/nora -e xiaomi/nitrogen \ -e xiaomi/equuleus/equuleus -e motorola/nora -e xiaomi/nitrogen \
-e motorola/hannah -e motorola/james -e motorola/pettyl -e xiaomi/cepheus \ -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/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 xiaomi/ginkgo -e xiaomi/laurel_sprout -e xiaomi/andromeda \
-e iaomi/renoir \ -e redmi/curtana -e redmi/picasso ; then
-e redmi/curtana -e redmi/picasso \
-e bq/Aquaris_M10 ; then
mount -o bind /mnt/phh/empty_dir /vendor/lib64/soundfx mount -o bind /mnt/phh/empty_dir /vendor/lib64/soundfx
mount -o bind /mnt/phh/empty_dir /vendor/lib/soundfx mount -o bind /mnt/phh/empty_dir /vendor/lib/soundfx
setprop ro.audio.ignore_effects true setprop ro.audio.ignore_effects true
fi 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 \ if getprop ro.build.fingerprint | grep -iq \
-e motorola/channel; then -e motorola/channel; then
mount -o bind /mnt/phh/empty_dir /vendor/lib64/soundfx mount -o bind /mnt/phh/empty_dir /vendor/lib64/soundfx
@ -484,6 +398,10 @@ if getprop ro.vendor.build.fingerprint | grep -iq -e iaomi/cactus -e iaomi/cereu
setprop debug.stagefright.omx_default_rank 0 setprop debug.stagefright.omx_default_rank 0
fi fi
if getprop ro.vendor.build.fingerprint | grep -iq -e xiaomi/ginkgo -e xiaomi/willow; then
mount -o bind /system/phh/empty /vendor/lib/soundfx/libvolumelistener.so
fi
mount -o bind /system/phh/empty /vendor/lib/libpdx_default_transport.so 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/lib64/libpdx_default_transport.so
@ -532,11 +450,6 @@ if getprop ro.vendor.build.fingerprint | grep -iq -e xiaomi/daisy; then
setprop debug.sf.enable_hwc_vds 1 setprop debug.sf.enable_hwc_vds 1
fi 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 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 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 ||
@ -570,8 +483,6 @@ fi
# This matches both Razer Phone 1 & 2 # This matches both Razer Phone 1 & 2
if getprop ro.vendor.build.fingerprint |grep -qE razer/cheryl;then if getprop ro.vendor.build.fingerprint |grep -qE razer/cheryl;then
setprop ro.audio.monitorRotation true 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 fi
if getprop ro.vendor.build.fingerprint | grep -qiE '^samsung'; then if getprop ro.vendor.build.fingerprint | grep -qiE '^samsung'; then
@ -591,9 +502,7 @@ if getprop ro.vendor.build.fingerprint | grep -qE '^xiaomi/wayne/wayne.*'; then
setprop audio.camerasound.force true setprop audio.camerasound.force true
fi fi
if [ $(find /vendor/etc/audio -type f |wc -l) -le 3 ];then mount -o bind /mnt/phh/empty_dir /vendor/etc/audio || true
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 for f in /vendor/lib{,64}/hw/com.qti.chi.override.so /vendor/lib{,64}/libVD*;do
[ ! -f $f ] && continue [ ! -f $f ] && continue
@ -652,22 +561,6 @@ if getprop ro.vendor.build.fingerprint | grep -qiE '^samsung/' && [ "$vndk" -ge
fi fi
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 if [ -f /system/phh/secure ];then
copyprop() { copyprop() {
p="$(getprop "$2")" p="$(getprop "$2")"
@ -687,8 +580,8 @@ if [ -f /system/phh/secure ];then
copyprop ro.product.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.system.name ro.vendor.product.name
copyprop ro.product.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.system.name ro.product.vendor.device
copyprop ro.product.name ro.product.vendor.name copyprop ro.product.name ro.product.vendor.device
copyprop ro.system.product.brand ro.vendor.product.brand copyprop ro.system.product.brand ro.vendor.product.brand
copyprop ro.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.system.model ro.vendor.product.model
@ -725,7 +618,7 @@ for abi in "" 64;do
f=/vendor/lib$abi/libstagefright_foundation.so f=/vendor/lib$abi/libstagefright_foundation.so
if [ -f "$f" ];then if [ -f "$f" ];then
for vndk in 26 27 28 29;do for vndk in 26 27 28 29;do
mount "$f" /system/system_ext/apex/com.android.vndk.v$vndk/lib$abi/libstagefright_foundation.so mount "$f" /system/lib$abi/vndk-$vndk/libstagefright_foundation.so
done done
fi fi
done done
@ -769,11 +662,6 @@ for i in odm oem vendor product;do
if grep -qF android.hardware.wifi.hostapd /$i/etc/vintf/manifest.xml;then if grep -qF android.hardware.wifi.hostapd /$i/etc/vintf/manifest.xml;then
has_hostapd=true has_hostapd=true
fi fi
for j in /$i/etc/vintf/manifest/*;do
if grep -qF android.hardware.wifi.hostapd $j;then
has_hostapd=true
fi
done
done done
if [ "$has_hostapd" = false ];then if [ "$has_hostapd" = false ];then
@ -804,11 +692,6 @@ if [ -e /dev/sprd-adf-dev ];then
setprop ro.config.avoid_gfx_accel true setprop ro.config.avoid_gfx_accel true
fi 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 # Fix manual network selection with old modem
# https://github.com/LineageOS/android_hardware_ril/commit/e3d006fa722c02fc26acdfcaa43a3f3a1378eba9 # https://github.com/LineageOS/android_hardware_ril/commit/e3d006fa722c02fc26acdfcaa43a3f3a1378eba9
if getprop ro.vendor.build.fingerprint | grep -iq \ if getprop ro.vendor.build.fingerprint | grep -iq \
@ -830,14 +713,8 @@ if [ -f /proc/oppoVersion/prjVersion ];then
setprop ro.separate.soft $(cat /proc/oppoVersion/prjVersion) setprop ro.separate.soft $(cat /proc/oppoVersion/prjVersion)
fi 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 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
echo 1 > /proc/touchpanel/tp_fw_update
fi
if getprop ro.build.overlay.deviceid |grep -qE '^RMX';then if getprop ro.build.overlay.deviceid |grep -qE '^RMX';then
chmod 0660 /sys/devices/platform/soc/soc:fpc_fpc1020/{irq,irq_enable,wakelock_enable} chmod 0660 /sys/devices/platform/soc/soc:fpc_fpc1020/{irq,irq_enable,wakelock_enable}
@ -868,7 +745,7 @@ resetprop_phh service.adb.root 0
# This is for Samsung Galaxy devices with HBM FOD # This is for Samsung Galaxy devices with HBM FOD
# On those devices, a magic Layer usageBits switches to "mask_brightness" # On those devices, a magic Layer usageBits switches to "mask_brightness"
# But default is 255, so set it to max instead # 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 echo 319 > /sys/class/lcd/panel/mask_brightness
if getprop ro.vendor.build.fingerprint |grep -qiE '^xiaomi/';then if getprop ro.vendor.build.fingerprint |grep -qiE '^xiaomi/';then
setprop persist.sys.phh.fod.xiaomi true setprop persist.sys.phh.fod.xiaomi true
@ -876,11 +753,9 @@ fi
if getprop ro.vendor.build.fingerprint |grep -qiE '^samsung/';then 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 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
chcon u:object_r:sysfs_lcd_writable:s0 $f chmod 0644 $f
chmod 0644 $f chown system:system $f
chown system:system $f
fi
done done
setprop persist.sys.phh.fod.samsung true setprop persist.sys.phh.fod.samsung true
@ -898,10 +773,6 @@ if getprop ro.build.overlay.deviceid |grep -iq -e RMX1941 -e RMX1945 -e RMX1943
setprop persist.sys.phh.mainkeys 0 setprop persist.sys.phh.mainkeys 0
fi 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 resetprop_phh ro.bluetooth.library_name libbluetooth.so
if getprop ro.vendor.build.fingerprint |grep -iq xiaomi/cepheus;then if getprop ro.vendor.build.fingerprint |grep -iq xiaomi/cepheus;then
@ -928,30 +799,6 @@ fi
resetprop_phh ro.control_privapp_permissions log 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 if grep -q /mnt/vendor/persist /vendor/etc/fstab.qcom;then
mount /mnt/vendor/persist /persist mount /mnt/vendor/persist /persist
fi 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

@ -15,7 +15,6 @@
/dev/dsm u:object_r:dmd_device: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.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 /efs u:object_r:efs_file:s0

View File

@ -6,7 +6,7 @@ type dmd_device, file_type;
allow hal_fingerprint_server dmd_device:chr_file rw_file_perms; allow hal_fingerprint_server dmd_device:chr_file rw_file_perms;
allow hal_fingerprint_server sysfs:file rw_file_perms; allow hal_fingerprint_server sysfs:file rw_file_perms;
allow tee hal_fingerprint_default:process { getattr }; 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:dir { search write getattr add_name };
allow tee teecd_data_file:file { read write create getattr open }; allow tee teecd_data_file:file { read write create getattr open };
allow tee system_data_file:dir { getattr }; allow tee system_data_file:dir { getattr };

View File

@ -6,8 +6,3 @@ allow init userdata_block_device:blk_file relabelto;
allow init userdata_block_device:lnk_file relabelto; allow init userdata_block_device:lnk_file relabelto;
allow vendor_init vendor_init:capability { sys_module }; 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

@ -3,17 +3,3 @@ type proc_ged, file_type;
allowxperm domain proc_ged:file ioctl { 0x6700-0x67ff }; allowxperm domain proc_ged:file ioctl { 0x6700-0x67ff };
allow init mnt_product_file:dir mounton; 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 +1,3 @@
type sysfs_usb_supply, file_type; type sysfs_usb_supply, file_type;
allow system_app sysfs_usb_supply:file rw_file_perms; 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,10 +1 @@
qti.ims.ext u:object_r:radio_service:s0 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

@ -148,4 +148,5 @@ allow phhsu_daemon domain:process { transition };
# 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 # 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 { 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 }; allowxperm phhsu_daemon { super_block_device dm_device }:blk_file ioctl { 0x1278-0x127a 0x125d };

View File

@ -7,8 +7,6 @@ allow system_app sysfs_batteryinfo:file rw_file_perms;
type vendor_camera_prop, property_type; type vendor_camera_prop, property_type;
set_prop(system_app, vendor_camera_prop); 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; type hal_ext_fingerprint_hwservice, hwservice_manager_type;
allow system_app hal_ext_fingerprint_hwservice:hwservice_manager { find }; allow system_app hal_ext_fingerprint_hwservice:hwservice_manager { find };
@ -24,21 +22,3 @@ allow system_app default_hisi_hwservice:hwservice_manager { find };
type hal_tp_default, domain; type hal_tp_default, domain;
allow system_app hal_tp_default:binder { call }; 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

@ -79,7 +79,7 @@ if [ "$configfs" == 1 ];then
sleep 1 sleep 1
echo none > /config/usb_gadget/g1/UDC echo none > /config/usb_gadget/g1/UDC
ln -s /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/c.1/f1 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 echo ff100000.dwc3 > /config/usb_gadget/g1/UDC
sleep 2 sleep 2
echo 2 > /sys/devices/virtual/android_usb/android0/port_mode echo 2 > /sys/devices/virtual/android_usb/android0/port_mode

18
vndk.rc
View File

@ -44,12 +44,6 @@ on property:persist.sys.phh.caf.audio_policy=*
on property:persist.sys.phh.vsmart.dt2w=* on property:persist.sys.phh.vsmart.dt2w=*
exec u:r:phhsu_daemon:s0 root -- /system/bin/phh-prop-handler.sh "persist.sys.phh.vsmart.dt2w" exec u:r:phhsu_daemon:s0 root -- /system/bin/phh-prop-handler.sh "persist.sys.phh.vsmart.dt2w"
on property:persist.sys.phh.backlight.scale=*
exec u:r:phhsu_daemon:s0 root -- /system/bin/phh-prop-handler.sh "persist.sys.phh.backlight.scale"
on property:ro.sf.lcd_density=*
restart surfaceflinger
on property:persist.sys.phh.disable_a2dp_offload=0 on property:persist.sys.phh.disable_a2dp_offload=0
setprop persist.sys.phh.disable_a2dp_offload false setprop persist.sys.phh.disable_a2dp_offload false
@ -58,15 +52,3 @@ on property:persist.sys.phh.disable_a2dp_offload=1
on property:persist.sys.phh.disable_a2dp_offload=* on property:persist.sys.phh.disable_a2dp_offload=*
setprop persist.bluetooth.bluetooth_audio_hal.disabled ${persist.sys.phh.disable_a2dp_offload} setprop persist.bluetooth.bluetooth_audio_hal.disabled ${persist.sys.phh.disable_a2dp_offload}
on property:init.svc.ril-proxy=stopped && property:persist.sys.phh.restart_ril=true
start ril-proxy
on property:init.svc.vendor.ril-daemon-mtk=stopped && property:persist.sys.phh.restart_ril=true
start vendor.ril-daemon-mtk
on property:persist.sys.phh.restart_ril=true
restart ril-proxy
restart vendor.qcrild
restart vendor.qcrild2
restart vendor.ril-daemon-mtk