commit f369a00f6955af908188bbffd2bd7d1615496123 Author: johnmart19 Date: Thu Feb 22 20:55:51 2024 +0200 MiuiCamera: Initial Poco F3 Repository - Includes following changes: * Import Xiaomi MiSys Hal and Sepolicy * Import needed camera permissions * Import Camera Postprocessing * Import Poco F3 / Mi 11x Device Features [For Miui Deps] * Import camxoverride settings & tune down CameraX logging * Import needed camera prebuilts for Poco F3 AOSP Device trees * Import Leica/Miui Camera mod 5.x by https://t.me/itzdfplayer & HollyBear * Create device-specific config overlay for following Camera to enable appropriate features * Import device-specific OpenCL * Import AOSP and LOS aux camera overlays * Import appropriate sepolicy for Poco F3 / Mi11x - Repo requires: * Have device-side hides in libinit for .mod_device and .name * Import MiSys entries to FCM [Example: https://github.com/VoidUI-Devices/device_xiaomi_sm8250-common/commit/47e3f385a6cd16b0200a4bfd34cad1fba75ac210 ] * Enable newer HIDL overrideFormat [https://github.com/VoidUI-Devices/device_xiaomi_sm8250-common/commit/4d9f9a23e9f6e90a1a4cc1f5430f8ac53b1d5816 ] * Build camera for Jemalloc [https://github.com/VoidUI-Devices/device_xiaomi_sm8250-common/commit/c5d5ea6706c72bbe8b4c3184f32a580f6c0e4c90 ] * Set TARGET_CAMERA_PACKAGE_NAME for vendor tags [https://github.com/VoidUI-Devices/device_xiaomi_sm8250-common/commit/60ad521bf18764f51dcd1551c2addda1df0c81bb ] -> [https://github.com/VoidUI-Tiramisu/frameworks_av/commit/c4fbccafa0a6bab1bfe33ff23166e4bc5100533e ] Used changes from following authors: Co-authored-by: UtsavBalar1231 Co-authored-by: ItzDFPlayer Co-authored-by: chrisl7 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..3312716 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +*.apk filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text diff --git a/Android.bp b/Android.bp new file mode 100644 index 0000000..a1d08ff --- /dev/null +++ b/Android.bp @@ -0,0 +1,79 @@ +// Automatically generated file. DO NOT MODIFY +// +// This file is generated by vendor/xiaomi/camera/setup-makefiles.sh + +soong_namespace { +} + +android_app_import { + name: "MiuiCamera", + owner: "xiaomi", + apk: "proprietary/system/priv-app/MiuiCamera/MiuiCamera.apk", + overrides: ["GrapheneCamera", "Camera", "Camera2", "Aperture", "GoogleCameraGo"], + certificate: "platform", + dex_preopt: { + enabled: false, + }, + privileged: true, +} + +dex_import { + name: "vendor.xiaomi.hardware.misys-V1.0-java", + owner: "xiaomi", + jars: ["proprietary/system/framework/vendor.xiaomi.hardware.misys-V1.0-java.jar"], +} + +dex_import { + name: "vendor.xiaomi.hardware.misys-V2.0-java", + owner: "xiaomi", + jars: ["proprietary/system/framework/vendor.xiaomi.hardware.misys-V2.0-java.jar"], +} + +dex_import { + name: "vendor.xiaomi.hardware.misys-V4.0-java", + owner: "xiaomi", + jars: ["proprietary/system/framework/vendor.xiaomi.hardware.misys-V4.0-java.jar"], +} + +dex_import { + name: "vendor.xiaomi.hardware.misys.V3_0", + owner: "xiaomi", + jars: ["proprietary/system/framework/vendor.xiaomi.hardware.misys.V3_0.jar"], +} + +prebuilt_etc_xml { + name: "vendor.xiaomi.hardware.misys@1.0", + owner: "xiaomi", + src: "proprietary/vendor/etc/vintf/manifest/vendor.xiaomi.hardware.misys@1.0.xml", + filename_from_src: true, + sub_dir: "vintf/manifest", + soc_specific: true, +} + +prebuilt_etc_xml { + name: "vendor.xiaomi.hardware.misys@2.0", + owner: "xiaomi", + src: "proprietary/vendor/etc/vintf/manifest/vendor.xiaomi.hardware.misys@2.0.xml", + filename_from_src: true, + sub_dir: "vintf/manifest", + soc_specific: true, +} + +prebuilt_etc_xml { + name: "vendor.xiaomi.hardware.misys@3.0", + owner: "xiaomi", + src: "proprietary/vendor/etc/vintf/manifest/vendor.xiaomi.hardware.misys@3.0.xml", + filename_from_src: true, + sub_dir: "vintf/manifest", + soc_specific: true, +} + +prebuilt_etc_xml { + name: "vendor.xiaomi.hardware.misys@4.0", + owner: "xiaomi", + src: "proprietary/vendor/etc/vintf/manifest/vendor.xiaomi.hardware.misys@4.0.xml", + filename_from_src: true, + sub_dir: "vintf/manifest", + soc_specific: true, +} + diff --git a/Android.mk b/Android.mk new file mode 100644 index 0000000..82bdeec --- /dev/null +++ b/Android.mk @@ -0,0 +1,9 @@ +# Automatically generated file. DO NOT MODIFY +# +# This file is generated by vendor/xiaomi/camera/setup-makefiles.sh + +LOCAL_PATH := $(call my-dir) + +ifneq ($(filter alioth,$(TARGET_DEVICE)),) + +endif diff --git a/BoardConfigVendor.mk b/BoardConfigVendor.mk new file mode 100644 index 0000000..59d0ce1 --- /dev/null +++ b/BoardConfigVendor.mk @@ -0,0 +1,4 @@ +# Automatically generated file. DO NOT MODIFY +# +# This file is generated by vendor/xiaomi/camera/setup-makefiles.sh + diff --git a/README.md b/README.md new file mode 100644 index 0000000..cf80f46 --- /dev/null +++ b/README.md @@ -0,0 +1,52 @@ +# proprietary_vendor_xiaomi_camera + +Prebuilt stock MIUI/Leica Camera for Poco F3/Redmi K40/Mi 11x (alioth), to include in custom ROM builds. + +### How to use? + +1. Clone this repo to `vendor/xiaomi/camera` + +2. Inherit it from `device.mk` in device tree: + +``` +# Camera +$(call inherit-product-if-exists, vendor/xiaomi/camera/miuicamera.mk) +``` + +3. Ensure that you added misys vintf dependencies in your framework_compatibility_matrix.xml: + +``` + + vendor.xiaomi.hardware.misys + 1.0 + + IMiSys + default + + + + vendor.xiaomi.hardware.misys + 2.0 + + IMiSys + default + + + + vendor.xiaomi.hardware.misys + 3.0 + + IMiSys + default + + + + vendor.xiaomi.hardware.misys + 4.0 + + IMiSys + default + + +``` +3.1 Reference - https://github.com/VoidUI-Devices/device_xiaomi_sm8250-common/commit/47e3f385a6cd16b0200a4bfd34cad1fba75ac210 diff --git a/camera-vendor.mk b/camera-vendor.mk new file mode 100644 index 0000000..eb28cd1 --- /dev/null +++ b/camera-vendor.mk @@ -0,0 +1,63 @@ +# Automatically generated file. DO NOT MODIFY +# +# This file is generated by vendor/xiaomi/camera/setup-makefiles.sh + +PRODUCT_SOONG_NAMESPACES += \ + vendor/xiaomi/camera + +PRODUCT_COPY_FILES += \ + vendor/xiaomi/camera/proprietary/system/etc/permissions/vendor.xiaomi.hardware.misys-V1.0-java-permission.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/permissions/vendor.xiaomi.hardware.misys-V1.0-java-permission.xml \ + vendor/xiaomi/camera/proprietary/system/etc/permissions/vendor.xiaomi.hardware.misys-V2.0-java-permission.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/permissions/vendor.xiaomi.hardware.misys-V2.0-java-permission.xml \ + vendor/xiaomi/camera/proprietary/system/etc/permissions/vendor.xiaomi.hardware.misys-V4.0-java-permission.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/permissions/vendor.xiaomi.hardware.misys-V4.0-java-permission.xml \ + vendor/xiaomi/camera/proprietary/system/etc/permissions/vendor.xiaomi.hardware.misys.V3_0-permission.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/permissions/vendor.xiaomi.hardware.misys.V3_0-permission.xml \ + vendor/xiaomi/camera/proprietary/system/etc/public.libraries-xiaomi.txt:$(TARGET_COPY_OUT_SYSTEM)/etc/public.libraries-xiaomi.txt \ + vendor/xiaomi/camera/proprietary/system/lib64/libcamera_algoup_jni.xiaomi.so:$(TARGET_COPY_OUT_SYSTEM)/lib64/libcamera_algoup_jni.xiaomi.so \ + vendor/xiaomi/camera/proprietary/system/lib64/libcamera_mianode_jni.xiaomi.so:$(TARGET_COPY_OUT_SYSTEM)/lib64/libcamera_mianode_jni.xiaomi.so \ + vendor/xiaomi/camera/proprietary/system/lib64/libmicampostproc_client.so:$(TARGET_COPY_OUT_SYSTEM)/lib64/libmicampostproc_client.so \ + vendor/xiaomi/camera/proprietary/system/lib64/libmisys_jni.xiaomi.so:$(TARGET_COPY_OUT_SYSTEM)/lib64/libmisys_jni.xiaomi.so \ + vendor/xiaomi/camera/proprietary/system/lib64/vendor.xiaomi.hardware.campostproc@1.0.so:$(TARGET_COPY_OUT_SYSTEM)/lib64/vendor.xiaomi.hardware.campostproc@1.0.so \ + vendor/xiaomi/camera/proprietary/system/lib64/vendor.xiaomi.hardware.misys@1.0.so:$(TARGET_COPY_OUT_SYSTEM)/lib64/vendor.xiaomi.hardware.misys@1.0.so \ + vendor/xiaomi/camera/proprietary/system/lib64/vendor.xiaomi.hardware.misys@2.0.so:$(TARGET_COPY_OUT_SYSTEM)/lib64/vendor.xiaomi.hardware.misys@2.0.so \ + vendor/xiaomi/camera/proprietary/system/lib64/vendor.xiaomi.hardware.misys@3.0.so:$(TARGET_COPY_OUT_SYSTEM)/lib64/vendor.xiaomi.hardware.misys@3.0.so \ + vendor/xiaomi/camera/proprietary/system/lib64/vendor.xiaomi.hardware.misys@4.0.so:$(TARGET_COPY_OUT_SYSTEM)/lib64/vendor.xiaomi.hardware.misys@4.0.so \ + vendor/xiaomi/camera/proprietary/system_ext/lib/libOpenCL_system.so:$(TARGET_COPY_OUT_SYSTEM_EXT)/lib/libOpenCL_system.so \ + vendor/xiaomi/camera/proprietary/system_ext/lib64/libOpenCL_system.so:$(TARGET_COPY_OUT_SYSTEM_EXT)/lib64/libOpenCL_system.so \ + vendor/xiaomi/camera/proprietary/vendor/bin/hw/vendor.xiaomi.hardware.misys@1.0-service:$(TARGET_COPY_OUT_VENDOR)/bin/hw/vendor.xiaomi.hardware.misys@1.0-service \ + vendor/xiaomi/camera/proprietary/vendor/bin/hw/vendor.xiaomi.hardware.misys@2.0-service:$(TARGET_COPY_OUT_VENDOR)/bin/hw/vendor.xiaomi.hardware.misys@2.0-service \ + vendor/xiaomi/camera/proprietary/vendor/bin/hw/vendor.xiaomi.hardware.misys@3.0-service:$(TARGET_COPY_OUT_VENDOR)/bin/hw/vendor.xiaomi.hardware.misys@3.0-service \ + vendor/xiaomi/camera/proprietary/vendor/bin/hw/vendor.xiaomi.hardware.misys@4.0-service:$(TARGET_COPY_OUT_VENDOR)/bin/hw/vendor.xiaomi.hardware.misys@4.0-service \ + vendor/xiaomi/camera/proprietary/vendor/etc/init/android.hardware.camera.provider@2.4-service_64.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/android.hardware.camera.provider@2.4-service_64.rc \ + vendor/xiaomi/camera/proprietary/vendor/etc/init/vendor.xiaomi.hardware.misys@1.0-service.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/vendor.xiaomi.hardware.misys@1.0-service.rc \ + vendor/xiaomi/camera/proprietary/vendor/etc/init/vendor.xiaomi.hardware.misys@2.0-service.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/vendor.xiaomi.hardware.misys@2.0-service.rc \ + vendor/xiaomi/camera/proprietary/vendor/etc/init/vendor.xiaomi.hardware.misys@3.0-service.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/vendor.xiaomi.hardware.misys@3.0-service.rc \ + vendor/xiaomi/camera/proprietary/vendor/etc/init/vendor.xiaomi.hardware.misys@4.0-service.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/vendor.xiaomi.hardware.misys@4.0-service.rc \ + vendor/xiaomi/camera/proprietary/vendor/lib/libOpenCL.so:$(TARGET_COPY_OUT_VENDOR)/lib/libOpenCL.so \ + vendor/xiaomi/camera/proprietary/vendor/lib64/hw/vendor.xiaomi.hardware.misys@1.0-impl.so:$(TARGET_COPY_OUT_VENDOR)/lib64/hw/vendor.xiaomi.hardware.misys@1.0-impl.so \ + vendor/xiaomi/camera/proprietary/vendor/lib64/hw/vendor.xiaomi.hardware.misys@2.0-impl.so:$(TARGET_COPY_OUT_VENDOR)/lib64/hw/vendor.xiaomi.hardware.misys@2.0-impl.so \ + vendor/xiaomi/camera/proprietary/vendor/lib64/hw/vendor.xiaomi.hardware.misys@3.0-impl.so:$(TARGET_COPY_OUT_VENDOR)/lib64/hw/vendor.xiaomi.hardware.misys@3.0-impl.so \ + vendor/xiaomi/camera/proprietary/vendor/lib64/hw/vendor.xiaomi.hardware.misys@4.0-impl.so:$(TARGET_COPY_OUT_VENDOR)/lib64/hw/vendor.xiaomi.hardware.misys@4.0-impl.so \ + vendor/xiaomi/camera/proprietary/vendor/lib64/libOpenCL.so:$(TARGET_COPY_OUT_VENDOR)/lib64/libOpenCL.so \ + vendor/xiaomi/camera/proprietary/vendor/lib64/lib_sr_models.so:$(TARGET_COPY_OUT_VENDOR)/lib64/lib_sr_models.so \ + vendor/xiaomi/camera/proprietary/vendor/lib64/libarcsat.so:$(TARGET_COPY_OUT_VENDOR)/lib64/libarcsat.so \ + vendor/xiaomi/camera/proprietary/vendor/lib64/libbeauty_face_interface.so:$(TARGET_COPY_OUT_VENDOR)/lib64/libbeauty_face_interface.so \ + vendor/xiaomi/camera/proprietary/vendor/lib64/libcheckpid.so:$(TARGET_COPY_OUT_VENDOR)/lib64/libcheckpid.so \ + vendor/xiaomi/camera/proprietary/vendor/lib64/libflaw.so:$(TARGET_COPY_OUT_VENDOR)/lib64/libflaw.so \ + vendor/xiaomi/camera/proprietary/vendor/lib64/liblogwrap_vendor.so:$(TARGET_COPY_OUT_VENDOR)/lib64/liblogwrap_vendor.so \ + vendor/xiaomi/camera/proprietary/vendor/lib64/librelight_only.so:$(TARGET_COPY_OUT_VENDOR)/lib64/librelight_only.so \ + vendor/xiaomi/camera/proprietary/vendor/lib64/libsdk_sr.so:$(TARGET_COPY_OUT_VENDOR)/lib64/libsdk_sr.so \ + vendor/xiaomi/camera/proprietary/vendor/lib64/libsupermoon.so:$(TARGET_COPY_OUT_VENDOR)/lib64/libsupermoon.so \ + vendor/xiaomi/camera/proprietary/vendor/lib64/vendor.xiaomi.hardware.misys@1.0.so:$(TARGET_COPY_OUT_VENDOR)/lib64/vendor.xiaomi.hardware.misys@1.0.so \ + vendor/xiaomi/camera/proprietary/vendor/lib64/vendor.xiaomi.hardware.misys@2.0.so:$(TARGET_COPY_OUT_VENDOR)/lib64/vendor.xiaomi.hardware.misys@2.0.so \ + vendor/xiaomi/camera/proprietary/vendor/lib64/vendor.xiaomi.hardware.misys@3.0.so:$(TARGET_COPY_OUT_VENDOR)/lib64/vendor.xiaomi.hardware.misys@3.0.so \ + vendor/xiaomi/camera/proprietary/vendor/lib64/vendor.xiaomi.hardware.misys@4.0.so:$(TARGET_COPY_OUT_VENDOR)/lib64/vendor.xiaomi.hardware.misys@4.0.so + +PRODUCT_PACKAGES += \ + MiuiCamera \ + vendor.xiaomi.hardware.misys-V1.0-java \ + vendor.xiaomi.hardware.misys-V2.0-java \ + vendor.xiaomi.hardware.misys-V4.0-java \ + vendor.xiaomi.hardware.misys.V3_0 \ + vendor.xiaomi.hardware.misys@1.0 \ + vendor.xiaomi.hardware.misys@2.0 \ + vendor.xiaomi.hardware.misys@3.0 \ + vendor.xiaomi.hardware.misys@4.0 diff --git a/configs/camera/camxoverridesettings.txt b/configs/camera/camxoverridesettings.txt new file mode 100644 index 0000000..7b547d7 --- /dev/null +++ b/configs/camera/camxoverridesettings.txt @@ -0,0 +1,73 @@ +multiCameraEnable=TRUE +logInfoMask=0x0 +overrideLogLevels=0x1 +logConfigMask=0x0 +logWarningMask=0x0 +logVerboseMask=0x0 +logDRQEnable=0x0 +logMetaEnable=0x0 +logRequestMapping=0x0 +systemLogEnable=TRUE +logCoreCfgMask=0 +enableAsciiLogging=FALSE +enableTxtLogging=0 +traceGroupsEnable=0 +enable3ADebugData=FALSE +enableTuningMetadata=FALSE +MPMSizeThresToDisableDelayedUnmap=0 +MPMForceDisableDelayedUnmap=TRUE +#pdafHWEnable=TRUE +oisMaxWaitingTime=50 +enableOISOptimization=TRUE +enableResourceManager=TRUE +enableRawHDR=0 +#forceHWMFFixedNumOfFrames=5 +enableICAInGrid=1 +enableNCSService=1 +iseispreviewSupported=TRUE +ismfnrbokehsupported=TRUE +isBeautyMakeupSupported=TRUE +isVideoBeautifierSupported=TRUE +isSuperPortraitSupported=TRUE +is3rdLightWeightSupported=TRUE +raiserecoverysigabrt=FALSE +minReprocessInputWidth=8000 +minReprocessInputHeight=6000 +gyroSensitivityLLS=0.04 +gyroSensitivityLLSEnable=FALSE +disableFocusIndication=TRUE +overrideFlashTorchCurrent=380 +overrideFlashlightCurrent=130 +enableSensorHWSync=1 +enableSensorFpsMatch=TRUE +isVideoBokehSupported=TRUE +isVideoMimovieSupported=TRUE +isVideoLogformatSupported=TRUE +isFrontVideoBokehSupported=TRUE +isColorRetentionSupported=TRUE +isVideoFilterSupported=TRUE +AIEnhancementVersion=2 +multiCameraFrameSync=1 +#isParallelCameraDeviceSupported=TRUE +FDFilterEngine=FD_Standard_ARM +isVideoColorRetentionBackSupported=TRUE +fovcEnable=1 +vsquality=5@30|6@30 +FDPreprocessing=GTM +#miIfeCamnocBandwidthMBytes=4317 +#miIfeExternalBandwidthMBytes=3746 +#miIfeBandwidthBoostCount=1 +algoNormalSupportedValue=0:99|21:99|1:39|G:33 +algoHQSupportedValue=0:66|21:66|1:6|G:0 +algoSuperNightSupportedValue=0:8|1:8|21:0|G:0 +algoEISSupportedValue=0:16|1:0|21:16|G:0 +algoCameraXEnabled=TRUE +sessionMaxFlushWaitTime=2000 +algoSDKEnabled=TRUE +enableCHIPartialData=1 +quickviewsupport=TRUE +enableGPURotation=TRUE +colorBokehVersion=0 +AIEnhancementVideoSupportVersion=1 +superVideoFilterVersion=1 +isVideoBeautyScreenshotSupported=TRUE diff --git a/configs/device_features/alioth.xml b/configs/device_features/alioth.xml new file mode 100644 index 0000000..615b5eb --- /dev/null +++ b/configs/device_features/alioth.xml @@ -0,0 +1,623 @@ + + + + false + + true + + false + + true + + false + + true + + false + + false + + true + + true + + false + + true + + false + + true + + false + + false + + false + + true + + false + + true + + 1 + + true + + false + + true + + false + + false + + false + + 7 + + true + + true + + false + + false + + false + + false + + true + + true + + true + + false + + true + + true + + true + + true + + true + + false + + true + + true + + false + + true + + false + + + true + true + + true + + false + + true + + true + + true + + true + + true + + true + + true + + true + + true + + true + + true + + true + + true + + true + + true + + true + + false + + true + + false + + true + + false + + true + + false + + true + + false + + true + + false + + true + + false + + true + + true + + true + + false + + true + + false + + true + + false + + true + + true + + true + + true + + true + + true + + true + + true + + true + + true + + true + + false + + true + + true + + true + + true + + true + + true + + true + + true + + 4520 + + qcom + + 1473868800000 + + 1 + + 255.0 + + 58.0 + + 14 + + 100 + + 11 + + false + + 320 + + 2 + + 12.0 + + -0.5573 + false + $ + true + + 1 + 0 + 0 + 1080 + 1920 + + + uinput-fpc + uinput-goodix + + false + + 2 + + 1 + + 3 + + true + + 44 + 9 + 9 + + false + + false + + 0.86 + + 1.05 + + 1.25 + + 1.40 + + 1.40 + + true + + true + + false + + + org.codeaurora.snapcam + com.android.camera + com.miui.cit + com.qualcomm.qti.qmmi + com.android.keyguard + com.android.systemui + com.phonetest.application + com.phonetest.application.test + com.ss.android.ugc.aweme + com.xiaomi.cameratest + com.xiaomi.cameratools + com.blink.academy.protake + com.xiaomi.camera.mivi + com.xiaomi.camera.sample + com.smile.gifmaker + com.snapchat.android + + + + com.blink.academy.protake + com.xiaomi.camera.mivi + com.xiaomi.camera.sample + com.smile.gifmaker + com.snapchat.android + + + + + com.ludashi:0, add, 8000, 6000, 33,false + com.ludashi:1, add, 5184, 3880, 33,false + + com.antutu:0, ssize, 8000, 6000;1, ssize, 5184, 3880 + + com.tencent.mobileqq:1,limit,1920, 1080 + + + i:2 + + 921600 + + false + false + true + true + + true + + true + + + com.xiaomi.pass + com.xiaomi.scanner + com.xiaomi.gamecenter + com.miui.weather2 + com.miui.notes + com.miui.compass + com.miui.calculator + com.android.email + com.miui.cleanmaster + com.mi.misupport + com.mfashiongallery.emag + com.miui.personalassistant + com.miui.voip + com.miui.yellowpage + com.xiaomi.midrop + com.android.midrive + com.xiaomi.drivemode + com.miui.smarttravel + + + + /system/data-app/XMPass/XMPass.apk + /system/data-app/MiuiScanner/MiuiScanner.apk + /system/data-app/GameCenter/GameCenter.apk + /system/data-app/Weather/Weather.apk + /system/data-app/Notes/Notes.apk + /system/data-app/MiuiCompass/MiuiCompass.apk + /system/data-app/Calculator/Calculator.apk + /system/data-app/Email/Email.apk + /system/data-app/CleanMaster/CleanMaster.apk + /system/data-app/MiSupport/MiSupport.apk + /system/data-app/MiGalleryLockscreen/MiGalleryLockscreen.apk + /system/data-app/PersonalAssistant/PersonalAssistant.apk + /system/data-app/MiuiVoip/MiuiVoip.apk + /system/data-app/YellowPage/YellowPage.apk + /system/data-app/MiDrop/MiDrop.apk + /system/data-app/MiDrive/MiDrive.apk + /system/data-app/MiuiDriveMode/MiuiDriveMode.apk + /system/data-app/SmartTravel/SmartTravel.apk + + + true + + true + + true + + true + + false + + false + + true + + true + + true + + true + + true + + false + + true + + true + + false + + true + + true + + true + + true + + true + 0x000011C0 + + true + + true + true + + false + + true + + true + + true + + true + + + 120 + 60 + + 60 + + true + + true + + false + + + ALL + + + + CN + + + true + true + + 0 + + true + + true + + true + + false + + true + + true + + 0 + + 0 + + 3 + + 255 + + 50 + + 255 + + 0 + + -180 + + 180 + + 0 + + -50 + + 50 + + 0 + + -255 + + 255 + + 0 + + -100 + + 100 + + 220 + + 170 + + 270 + + 1.037 + + 0.718 + + true + + true + + true + + true + + true + + true + + 3 + + false + + true + + true + + + + + 50 + 2 + 4 + 6 + 8 + 10 + + + + 0 + 3 + 5 + 8 + 10 + + + + 150 + 300 + 170 + 170 + + + + 12 + 96 + + + true + + 91.0 + + 18 + + 0 + + 35 + + true + + true + + true + + true + + 1000 + + true + true + + true + + + /system + /system_ext + /product + /vendor + /odm + /mi_ext + + + rescue + oops + minidump + rawdump + crash_history + expdb + + /dev/block/by-name/ + diff --git a/configs/device_features/aliothin.xml b/configs/device_features/aliothin.xml new file mode 100644 index 0000000..009c8f6 --- /dev/null +++ b/configs/device_features/aliothin.xml @@ -0,0 +1,619 @@ + + + + false + + true + + false + + true + + false + + true + + false + + false + + true + + true + + false + + true + + false + + true + + false + + false + + false + + true + + false + + true + + 1 + + true + + false + + true + + false + + false + + false + + 7 + + true + + true + + false + + false + + false + + false + + true + + true + + true + + false + + true + + true + + true + + true + + true + + false + + true + + true + + false + + true + + false + + + true + true + + true + + false + + true + + true + + true + + true + + true + + true + + true + + true + + true + + true + + true + + true + + true + + true + + true + + true + + false + + true + + false + + true + + false + + true + + false + + true + + false + + true + + false + + true + + false + + true + + true + + true + + false + + true + + false + + true + + false + + true + + true + + true + + true + + true + + true + + true + + true + + true + + true + + true + + false + + true + + true + + true + + true + + true + + true + + true + + true + + 4520 + + qcom + + 1473868800000 + + 1 + + 255.0 + + 58.0 + + 14 + + 100 + + 11 + + false + + 320 + + 2 + + 12.0 + + -0.5573 + false + $ + true + + 1 + 0 + 0 + 1080 + 1920 + + + uinput-fpc + uinput-goodix + + false + + 2 + + 1 + + 3 + + true + + 44 + 9 + 9 + + false + + false + + 0.86 + + 1.05 + + 1.25 + + 1.40 + + 1.40 + + true + + true + + false + + + org.codeaurora.snapcam + com.android.camera + com.miui.cit + com.qualcomm.qti.qmmi + com.android.keyguard + com.android.systemui + com.phonetest.application + com.phonetest.application.test + com.ss.android.ugc.aweme + com.xiaomi.cameratest + com.xiaomi.cameratools + com.blink.academy.protake + com.xiaomi.camera.mivi + com.xiaomi.camera.sample + com.smile.gifmaker + com.snapchat.android + + + + com.blink.academy.protake + com.xiaomi.camera.mivi + com.xiaomi.camera.sample + com.smile.gifmaker + com.snapchat.android + + + + + com.ludashi:0, add, 8000, 6000, 33,false + com.ludashi:1, add, 5184, 3880, 33,false + + com.antutu:0, ssize, 8000, 6000;1, ssize, 5184, 3880 + + com.tencent.mobileqq:1,limit,1920, 1080 + + + i:2 + + 921600 + + false + false + true + true + + true + + true + + + com.xiaomi.pass + com.xiaomi.scanner + com.xiaomi.gamecenter + com.miui.weather2 + com.miui.notes + com.miui.compass + com.miui.calculator + com.android.email + com.miui.cleanmaster + com.mi.misupport + com.duokan.reader + com.mfashiongallery.emag + com.miui.personalassistant + com.miui.voip + com.miui.yellowpage + com.xiaomi.midrop + com.android.midrive + com.xiaomi.drivemode + com.miui.smarttravel + + + + /system/data-app/XMPass/XMPass.apk + /system/data-app/MiuiScanner/MiuiScanner.apk + /system/data-app/GameCenter/GameCenter.apk + /system/data-app/Weather/Weather.apk + /system/data-app/Notes/Notes.apk + /system/data-app/MiuiCompass/MiuiCompass.apk + /system/data-app/Calculator/Calculator.apk + /system/data-app/Email/Email.apk + /system/data-app/CleanMaster/CleanMaster.apk + /system/data-app/MiSupport/MiSupport.apk + /system/data-app/com.duokan.reader/com.duokan.reader.apk + /system/data-app/MiGalleryLockscreen/MiGalleryLockscreen.apk + /system/data-app/PersonalAssistant/PersonalAssistant.apk + /system/data-app/MiuiVoip/MiuiVoip.apk + /system/data-app/YellowPage/YellowPage.apk + /system/data-app/MiDrop/MiDrop.apk + /system/data-app/MiDrive/MiDrive.apk + /system/data-app/MiuiDriveMode/MiuiDriveMode.apk + /system/data-app/SmartTravel/SmartTravel.apk + + + true + + true + + true + + true + + false + + false + + true + + true + + true + + true + + true + + false + + true + + true + + false + + true + + true + + true + + true + + true + 0x000011C0 + + true + + true + true + + false + + true + + true + + true + + true + + + 120 + 60 + + 60 + + true + + true + + false + + + ALL + + + + CN + + + true + true + + 0 + + true + + true + + true + + false + + true + + true + + 0 + + 0 + + 3 + + 255 + + 50 + + 255 + + 0 + + -180 + + 180 + + 0 + + -50 + + 50 + + 0 + + -255 + + 255 + + 0 + + -100 + + 100 + + 220 + + 170 + + 270 + + 0.860 + + 0.694 + + true + + true + + true + + true + + true + + true + + 3 + + false + + true + + true + + + + + 50 + 2 + 4 + 6 + 8 + 10 + + + + 0 + 3 + 5 + 8 + 10 + + + + 150 + 300 + 170 + 170 + + + + 12 + 96 + + + true + + 91.0 + + 18 + + 0 + + 35 + + true + + true + + true + + true + true + + + /system + /system_ext + /product + /vendor + /odm + /mi_ext + + + rescue + oops + minidump + rawdump + crash_history + expdb + + /dev/block/by-name/ + diff --git a/configs/permissions/default-permissions/default-permissions-miuicamera.xml b/configs/permissions/default-permissions/default-permissions-miuicamera.xml new file mode 100644 index 0000000..8083da8 --- /dev/null +++ b/configs/permissions/default-permissions/default-permissions-miuicamera.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/configs/permissions/permissions/android.hardware.camera.flash-autofocus.xml b/configs/permissions/permissions/android.hardware.camera.flash-autofocus.xml new file mode 100644 index 0000000..64052aa --- /dev/null +++ b/configs/permissions/permissions/android.hardware.camera.flash-autofocus.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + diff --git a/configs/permissions/permissions/android.hardware.camera.front.xml b/configs/permissions/permissions/android.hardware.camera.front.xml new file mode 100644 index 0000000..73fcb68 --- /dev/null +++ b/configs/permissions/permissions/android.hardware.camera.front.xml @@ -0,0 +1,22 @@ + + + + + + + + + diff --git a/configs/permissions/permissions/android.hardware.camera.full.xml b/configs/permissions/permissions/android.hardware.camera.full.xml new file mode 100644 index 0000000..dc24c11 --- /dev/null +++ b/configs/permissions/permissions/android.hardware.camera.full.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + diff --git a/configs/permissions/permissions/android.hardware.camera.raw.xml b/configs/permissions/permissions/android.hardware.camera.raw.xml new file mode 100644 index 0000000..ea6b1fd --- /dev/null +++ b/configs/permissions/permissions/android.hardware.camera.raw.xml @@ -0,0 +1,22 @@ + + + + + + + + + diff --git a/configs/permissions/permissions/privapp-permissions-miuicamera.xml b/configs/permissions/permissions/privapp-permissions-miuicamera.xml new file mode 100644 index 0000000..00ccd3f --- /dev/null +++ b/configs/permissions/permissions/privapp-permissions-miuicamera.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/configs/permissions/sysconfig/miuicamera-hiddenapi-package-whitelist.xml b/configs/permissions/sysconfig/miuicamera-hiddenapi-package-whitelist.xml new file mode 100644 index 0000000..2bd7d33 --- /dev/null +++ b/configs/permissions/sysconfig/miuicamera-hiddenapi-package-whitelist.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/extract-files.sh b/extract-files.sh new file mode 100755 index 0000000..34c9824 --- /dev/null +++ b/extract-files.sh @@ -0,0 +1,69 @@ +#!/bin/bash +# +# Copyright (C) 2016 The CyanogenMod Project +# Copyright (C) 2017-2020 The LineageOS Project +# +# SPDX-License-Identifier: Apache-2.0 +# + +set -e + +DEVICE=camera +VENDOR=xiaomi + +# Load extract_utils and do some sanity checks +MY_DIR="${BASH_SOURCE%/*}" +if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi + +ANDROID_ROOT="${MY_DIR}/../../.." + +HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh" +if [ ! -f "${HELPER}" ]; then + echo "Unable to find helper script at ${HELPER}" + exit 1 +fi +source "${HELPER}" + +# Default to sanitizing the vendor folder before extraction +CLEAN_VENDOR=true + +KANG= +SECTION= + +while [ "${#}" -gt 0 ]; do + case "${1}" in + -n | --no-cleanup ) + CLEAN_VENDOR=false + ;; + -k | --kang ) + KANG="--kang" + ;; + -s | --section ) + SECTION="${2}"; shift + CLEAN_VENDOR=false + ;; + * ) + SRC="${1}" + ;; + esac + shift +done + +if [ -z "${SRC}" ]; then + SRC="adb" +fi + +function blob_fixup() { + case "${1}" in + system/lib64/libmicampostproc_client.so) + patchelf --remove-needed libhidltransport.so "${2}" + ;; + esac +} + +# Initialize the helper +setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" false "${CLEAN_VENDOR}" + +extract "${MY_DIR}/proprietary-files.txt" "${SRC}" "${KANG}" --section "${SECTION}" + +"${MY_DIR}/setup-makefiles.sh" diff --git a/miuicamera.mk b/miuicamera.mk new file mode 100644 index 0000000..420150f --- /dev/null +++ b/miuicamera.mk @@ -0,0 +1,71 @@ +# +# Copyright (C) 2024 VoidUI Project +# +# SPDX-License-Identifier: Apache-2.0 +# + +CAMERA_PATH := vendor/xiaomi/camera + +# Permissions +PRODUCT_COPY_FILES += \ + $(call find-copy-subdir-files,*,$(CAMERA_PATH)/configs/permissions/,$(TARGET_COPY_OUT_SYSTEM)/etc) + +# CameraX Config Overwrite +PRODUCT_COPY_FILES += \ + $(CAMERA_PATH)/configs/camera/camxoverridesettings.txt:$(TARGET_COPY_OUT_VENDOR)/etc/camera/camxoverridesettings.txt + +# Device-Features +PRODUCT_COPY_FILES += \ + $(CAMERA_PATH)/configs/device_features/alioth.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/device_features/alioth.xml \ + $(CAMERA_PATH)/configs/device_features/aliothin.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/device_features/aliothin.xml + +# Properties +PRODUCT_SYSTEM_PROPERTIES += \ + ro.com.google.lens.oem_camera_package=com.android.camera \ + ro.miui.notch=1 + +# Logging +PRODUCT_SYSTEM_PROPERTIES += \ + log.tag.CHIUSECASE=ERROR + +PRODUCT_VENDOR_PROPERTIES += \ + persist.vendor.camera.logInfoMask=false + +# Sepolicy Camera +BOARD_VENDOR_SEPOLICY_DIRS += \ + $(CAMERA_PATH)/sepolicy/camera/vendor + +SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS += \ + $(CAMERA_PATH)/sepolicy/camera/private + +# Sepolicy MiSys +BOARD_VENDOR_SEPOLICY_DIRS += \ + $(CAMERA_PATH)/sepolicy/misys/vendor + +SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS += \ + $(CAMERA_PATH)/sepolicy/misys/private + +SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS += \ + $(CAMERA_PATH)/sepolicy/misys/public + +# MiSys HIDL deps +PRODUCT_PACKAGES += \ + android.hidl.manager@1.0 \ + android.hidl.manager@1.0.vendor \ + android.hidl.memory.block@1.0 \ + android.hidl.memory.block@1.0.vendor \ + android.hidl.memory@1.0-impl + +# RRO Overlays +PRODUCT_PACKAGES += \ + MiuiCameraOverlay \ + MiuiCameraOverlayLos \ + MiuiCameraOverlayAosp + +# System Properties +PRODUCT_SYSTEM_PROPERTIES += \ + persist.vendor.camera.privapp.list=com.android.camera \ + ro.com.google.lens.oem_camera_package=com.android.camera \ + vendor.camera.aux.packagelist=com.android.camera,org.pixelexperience.faceunlock + +$(call inherit-product, $(CAMERA_PATH)/camera-vendor.mk) diff --git a/proprietary-files.txt b/proprietary-files.txt new file mode 100644 index 0000000..43ab80c --- /dev/null +++ b/proprietary-files.txt @@ -0,0 +1,67 @@ +# From Alioth MIUI V14.0.8.0.TKHMIXM package +# Leica App Mod +system/priv-app/MiuiCamera/MiuiCamera.apk;OVERRIDES=GrapheneCamera,Camera,Camera2,Aperture,GoogleCameraGo + +# Device Prebuilts +system/etc/public.libraries-xiaomi.txt +system/lib64/libcamera_algoup_jni.xiaomi.so +system/lib64/libcamera_mianode_jni.xiaomi.so +system/lib64/libmicampostproc_client.so +system/lib64/vendor.xiaomi.hardware.campostproc@1.0.so + +# Device OpenCL Prebuilts +vendor/lib/libOpenCL.so +vendor/lib64/libOpenCL.so +system_ext/lib/libOpenCL_system.so +system_ext/lib64/libOpenCL_system.so + +# Device Camera Deps +vendor/lib64/lib_sr_models.so +vendor/lib64/libarcsat.so +vendor/lib64/libbeauty_face_interface.so +vendor/lib64/libflaw.so +vendor/lib64/librelight_only.so +vendor/lib64/libsdk_sr.so +vendor/lib64/libsupermoon.so + +# MiSys +system/etc/permissions/vendor.xiaomi.hardware.misys-V1.0-java-permission.xml +system/etc/permissions/vendor.xiaomi.hardware.misys-V2.0-java-permission.xml +system/etc/permissions/vendor.xiaomi.hardware.misys-V4.0-java-permission.xml +system/etc/permissions/vendor.xiaomi.hardware.misys.V3_0-permission.xml +system/framework/vendor.xiaomi.hardware.misys-V1.0-java.jar +system/framework/vendor.xiaomi.hardware.misys-V2.0-java.jar +system/framework/vendor.xiaomi.hardware.misys-V4.0-java.jar +system/framework/vendor.xiaomi.hardware.misys.V3_0.jar +system/lib64/libmisys_jni.xiaomi.so +system/lib64/vendor.xiaomi.hardware.misys@1.0.so +system/lib64/vendor.xiaomi.hardware.misys@2.0.so +system/lib64/vendor.xiaomi.hardware.misys@3.0.so +system/lib64/vendor.xiaomi.hardware.misys@4.0.so +vendor/bin/hw/vendor.xiaomi.hardware.misys@1.0-service +vendor/bin/hw/vendor.xiaomi.hardware.misys@2.0-service +vendor/bin/hw/vendor.xiaomi.hardware.misys@3.0-service +vendor/bin/hw/vendor.xiaomi.hardware.misys@4.0-service +vendor/etc/init/vendor.xiaomi.hardware.misys@1.0-service.rc +vendor/etc/init/vendor.xiaomi.hardware.misys@2.0-service.rc +vendor/etc/init/vendor.xiaomi.hardware.misys@3.0-service.rc +vendor/etc/init/vendor.xiaomi.hardware.misys@4.0-service.rc +vendor/etc/vintf/manifest/vendor.xiaomi.hardware.misys@1.0.xml +vendor/etc/vintf/manifest/vendor.xiaomi.hardware.misys@2.0.xml +vendor/etc/vintf/manifest/vendor.xiaomi.hardware.misys@3.0.xml +vendor/etc/vintf/manifest/vendor.xiaomi.hardware.misys@4.0.xml +vendor/lib64/hw/vendor.xiaomi.hardware.misys@1.0-impl.so +vendor/lib64/hw/vendor.xiaomi.hardware.misys@2.0-impl.so +vendor/lib64/hw/vendor.xiaomi.hardware.misys@3.0-impl.so +vendor/lib64/hw/vendor.xiaomi.hardware.misys@4.0-impl.so +vendor/lib64/vendor.xiaomi.hardware.misys@1.0.so +vendor/lib64/vendor.xiaomi.hardware.misys@2.0.so +vendor/lib64/vendor.xiaomi.hardware.misys@3.0.so +vendor/lib64/vendor.xiaomi.hardware.misys@4.0.so + +# MiSys Deps +vendor/lib64/libcheckpid.so +vendor/lib64/liblogwrap_vendor.so + +# Camera Overwrite +vendor/etc/init/android.hardware.camera.provider@2.4-service_64.rc diff --git a/proprietary/system/etc/permissions/vendor.xiaomi.hardware.misys-V1.0-java-permission.xml b/proprietary/system/etc/permissions/vendor.xiaomi.hardware.misys-V1.0-java-permission.xml new file mode 100644 index 0000000..d95b470 --- /dev/null +++ b/proprietary/system/etc/permissions/vendor.xiaomi.hardware.misys-V1.0-java-permission.xml @@ -0,0 +1,4 @@ + + + diff --git a/proprietary/system/etc/permissions/vendor.xiaomi.hardware.misys-V2.0-java-permission.xml b/proprietary/system/etc/permissions/vendor.xiaomi.hardware.misys-V2.0-java-permission.xml new file mode 100644 index 0000000..2b79ef9 --- /dev/null +++ b/proprietary/system/etc/permissions/vendor.xiaomi.hardware.misys-V2.0-java-permission.xml @@ -0,0 +1,4 @@ + + + diff --git a/proprietary/system/etc/permissions/vendor.xiaomi.hardware.misys-V4.0-java-permission.xml b/proprietary/system/etc/permissions/vendor.xiaomi.hardware.misys-V4.0-java-permission.xml new file mode 100644 index 0000000..0e5e84e --- /dev/null +++ b/proprietary/system/etc/permissions/vendor.xiaomi.hardware.misys-V4.0-java-permission.xml @@ -0,0 +1,4 @@ + + + diff --git a/proprietary/system/etc/permissions/vendor.xiaomi.hardware.misys.V3_0-permission.xml b/proprietary/system/etc/permissions/vendor.xiaomi.hardware.misys.V3_0-permission.xml new file mode 100644 index 0000000..a779d50 --- /dev/null +++ b/proprietary/system/etc/permissions/vendor.xiaomi.hardware.misys.V3_0-permission.xml @@ -0,0 +1,4 @@ + + + diff --git a/proprietary/system/etc/public.libraries-xiaomi.txt b/proprietary/system/etc/public.libraries-xiaomi.txt new file mode 100644 index 0000000..b5f60f7 --- /dev/null +++ b/proprietary/system/etc/public.libraries-xiaomi.txt @@ -0,0 +1 @@ +libmisys_jni.xiaomi.so diff --git a/proprietary/system/framework/vendor.xiaomi.hardware.misys-V1.0-java.jar b/proprietary/system/framework/vendor.xiaomi.hardware.misys-V1.0-java.jar new file mode 100644 index 0000000..1657b5c Binary files /dev/null and b/proprietary/system/framework/vendor.xiaomi.hardware.misys-V1.0-java.jar differ diff --git a/proprietary/system/framework/vendor.xiaomi.hardware.misys-V2.0-java.jar b/proprietary/system/framework/vendor.xiaomi.hardware.misys-V2.0-java.jar new file mode 100644 index 0000000..b24345c Binary files /dev/null and b/proprietary/system/framework/vendor.xiaomi.hardware.misys-V2.0-java.jar differ diff --git a/proprietary/system/framework/vendor.xiaomi.hardware.misys-V4.0-java.jar b/proprietary/system/framework/vendor.xiaomi.hardware.misys-V4.0-java.jar new file mode 100644 index 0000000..73bb5f3 Binary files /dev/null and b/proprietary/system/framework/vendor.xiaomi.hardware.misys-V4.0-java.jar differ diff --git a/proprietary/system/framework/vendor.xiaomi.hardware.misys.V3_0.jar b/proprietary/system/framework/vendor.xiaomi.hardware.misys.V3_0.jar new file mode 100644 index 0000000..1f7c4cd Binary files /dev/null and b/proprietary/system/framework/vendor.xiaomi.hardware.misys.V3_0.jar differ diff --git a/proprietary/system/lib64/libcamera_algoup_jni.xiaomi.so b/proprietary/system/lib64/libcamera_algoup_jni.xiaomi.so new file mode 100644 index 0000000..b6fce54 Binary files /dev/null and b/proprietary/system/lib64/libcamera_algoup_jni.xiaomi.so differ diff --git a/proprietary/system/lib64/libcamera_mianode_jni.xiaomi.so b/proprietary/system/lib64/libcamera_mianode_jni.xiaomi.so new file mode 100644 index 0000000..af241db Binary files /dev/null and b/proprietary/system/lib64/libcamera_mianode_jni.xiaomi.so differ diff --git a/proprietary/system/lib64/libmicampostproc_client.so b/proprietary/system/lib64/libmicampostproc_client.so new file mode 100644 index 0000000..4b60ece Binary files /dev/null and b/proprietary/system/lib64/libmicampostproc_client.so differ diff --git a/proprietary/system/lib64/libmisys_jni.xiaomi.so b/proprietary/system/lib64/libmisys_jni.xiaomi.so new file mode 100644 index 0000000..3e0f27e Binary files /dev/null and b/proprietary/system/lib64/libmisys_jni.xiaomi.so differ diff --git a/proprietary/system/lib64/vendor.xiaomi.hardware.campostproc@1.0.so b/proprietary/system/lib64/vendor.xiaomi.hardware.campostproc@1.0.so new file mode 100644 index 0000000..299ae0b Binary files /dev/null and b/proprietary/system/lib64/vendor.xiaomi.hardware.campostproc@1.0.so differ diff --git a/proprietary/system/lib64/vendor.xiaomi.hardware.misys@1.0.so b/proprietary/system/lib64/vendor.xiaomi.hardware.misys@1.0.so new file mode 100644 index 0000000..e171271 Binary files /dev/null and b/proprietary/system/lib64/vendor.xiaomi.hardware.misys@1.0.so differ diff --git a/proprietary/system/lib64/vendor.xiaomi.hardware.misys@2.0.so b/proprietary/system/lib64/vendor.xiaomi.hardware.misys@2.0.so new file mode 100644 index 0000000..0fc2688 Binary files /dev/null and b/proprietary/system/lib64/vendor.xiaomi.hardware.misys@2.0.so differ diff --git a/proprietary/system/lib64/vendor.xiaomi.hardware.misys@3.0.so b/proprietary/system/lib64/vendor.xiaomi.hardware.misys@3.0.so new file mode 100644 index 0000000..b15aa0a Binary files /dev/null and b/proprietary/system/lib64/vendor.xiaomi.hardware.misys@3.0.so differ diff --git a/proprietary/system/lib64/vendor.xiaomi.hardware.misys@4.0.so b/proprietary/system/lib64/vendor.xiaomi.hardware.misys@4.0.so new file mode 100644 index 0000000..7d9d8cd Binary files /dev/null and b/proprietary/system/lib64/vendor.xiaomi.hardware.misys@4.0.so differ diff --git a/proprietary/system/priv-app/MiuiCamera/MiuiCamera.apk b/proprietary/system/priv-app/MiuiCamera/MiuiCamera.apk new file mode 100644 index 0000000..87fa404 --- /dev/null +++ b/proprietary/system/priv-app/MiuiCamera/MiuiCamera.apk @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:60b13d1eb3e261512b0eb932c4903d8601d9084015d7d2596954bdbf40a571ac +size 164940624 diff --git a/proprietary/system_ext/lib/libOpenCL_system.so b/proprietary/system_ext/lib/libOpenCL_system.so new file mode 100644 index 0000000..2cb0079 Binary files /dev/null and b/proprietary/system_ext/lib/libOpenCL_system.so differ diff --git a/proprietary/system_ext/lib64/libOpenCL_system.so b/proprietary/system_ext/lib64/libOpenCL_system.so new file mode 100644 index 0000000..93688e0 Binary files /dev/null and b/proprietary/system_ext/lib64/libOpenCL_system.so differ diff --git a/proprietary/vendor/bin/hw/vendor.xiaomi.hardware.misys@1.0-service b/proprietary/vendor/bin/hw/vendor.xiaomi.hardware.misys@1.0-service new file mode 100644 index 0000000..de4e393 Binary files /dev/null and b/proprietary/vendor/bin/hw/vendor.xiaomi.hardware.misys@1.0-service differ diff --git a/proprietary/vendor/bin/hw/vendor.xiaomi.hardware.misys@2.0-service b/proprietary/vendor/bin/hw/vendor.xiaomi.hardware.misys@2.0-service new file mode 100644 index 0000000..d501212 Binary files /dev/null and b/proprietary/vendor/bin/hw/vendor.xiaomi.hardware.misys@2.0-service differ diff --git a/proprietary/vendor/bin/hw/vendor.xiaomi.hardware.misys@3.0-service b/proprietary/vendor/bin/hw/vendor.xiaomi.hardware.misys@3.0-service new file mode 100644 index 0000000..1e9187d Binary files /dev/null and b/proprietary/vendor/bin/hw/vendor.xiaomi.hardware.misys@3.0-service differ diff --git a/proprietary/vendor/bin/hw/vendor.xiaomi.hardware.misys@4.0-service b/proprietary/vendor/bin/hw/vendor.xiaomi.hardware.misys@4.0-service new file mode 100644 index 0000000..1145454 Binary files /dev/null and b/proprietary/vendor/bin/hw/vendor.xiaomi.hardware.misys@4.0-service differ diff --git a/proprietary/vendor/etc/init/android.hardware.camera.provider@2.4-service_64.rc b/proprietary/vendor/etc/init/android.hardware.camera.provider@2.4-service_64.rc new file mode 100644 index 0000000..b5a3363 --- /dev/null +++ b/proprietary/vendor/etc/init/android.hardware.camera.provider@2.4-service_64.rc @@ -0,0 +1,17 @@ +#! /bin/sh +# +#Copyright (c) 2019 Qualcomm Technologies, Inc. +#All Rights Reserved. +#Confidential and Proprietary - Qualcomm Technologies, Inc. +# + +service vendor.camera-provider-2-4 /vendor/bin/hw/android.hardware.camera.provider@2.4-service_64 + override + interface android.hardware.camera.provider@2.4::ICameraProvider legacy/0 + interface vendor.qti.hardware.camera.postproc@1.0::IPostProcService camerapostprocservice + class hal + user cameraserver + group audio camera input drmrpc oem_2907 + ioprio rt 4 + capabilities SYS_NICE + writepid /dev/cpuset/camera-daemon/tasks /dev/stune/foreground/tasks diff --git a/proprietary/vendor/etc/init/vendor.xiaomi.hardware.misys@1.0-service.rc b/proprietary/vendor/etc/init/vendor.xiaomi.hardware.misys@1.0-service.rc new file mode 100644 index 0000000..aabd6dc --- /dev/null +++ b/proprietary/vendor/etc/init/vendor.xiaomi.hardware.misys@1.0-service.rc @@ -0,0 +1,8 @@ +on fs + mkdir /mnt/vendor/persist/stability 0755 system system + mkdir /mnt/vendor/persist/misys 0755 system system + +service vendor.misys /vendor/bin/hw/vendor.xiaomi.hardware.misys@1.0-service + class hal + user system + group system root diff --git a/proprietary/vendor/etc/init/vendor.xiaomi.hardware.misys@2.0-service.rc b/proprietary/vendor/etc/init/vendor.xiaomi.hardware.misys@2.0-service.rc new file mode 100644 index 0000000..504bd0f --- /dev/null +++ b/proprietary/vendor/etc/init/vendor.xiaomi.hardware.misys@2.0-service.rc @@ -0,0 +1,8 @@ +on fs + mkdir /mnt/vendor/persist/stability 0755 system system + mkdir /mnt/vendor/persist/misys 0755 system system + +service vendor.misys@2.0 /vendor/bin/hw/vendor.xiaomi.hardware.misys@2.0-service + class hal + user system + group system diff --git a/proprietary/vendor/etc/init/vendor.xiaomi.hardware.misys@3.0-service.rc b/proprietary/vendor/etc/init/vendor.xiaomi.hardware.misys@3.0-service.rc new file mode 100644 index 0000000..906ddda --- /dev/null +++ b/proprietary/vendor/etc/init/vendor.xiaomi.hardware.misys@3.0-service.rc @@ -0,0 +1,8 @@ +on fs + mkdir /mnt/vendor/persist/stability 0755 system system + mkdir /mnt/vendor/persist/misys 0755 system system + +service vendor.misys@3.0 /vendor/bin/hw/vendor.xiaomi.hardware.misys@3.0-service + class hal + user system + group system diff --git a/proprietary/vendor/etc/init/vendor.xiaomi.hardware.misys@4.0-service.rc b/proprietary/vendor/etc/init/vendor.xiaomi.hardware.misys@4.0-service.rc new file mode 100644 index 0000000..542b7e3 --- /dev/null +++ b/proprietary/vendor/etc/init/vendor.xiaomi.hardware.misys@4.0-service.rc @@ -0,0 +1,4 @@ +service vendor.misys@4.0 /vendor/bin/hw/vendor.xiaomi.hardware.misys@4.0-service + class hal + user root + group root system diff --git a/proprietary/vendor/etc/vintf/manifest/vendor.xiaomi.hardware.misys@1.0.xml b/proprietary/vendor/etc/vintf/manifest/vendor.xiaomi.hardware.misys@1.0.xml new file mode 100644 index 0000000..1510521 --- /dev/null +++ b/proprietary/vendor/etc/vintf/manifest/vendor.xiaomi.hardware.misys@1.0.xml @@ -0,0 +1,38 @@ + + + + vendor.xiaomi.hardware.misys + hwbinder + 1.0 + + IMiSys + default + + + diff --git a/proprietary/vendor/etc/vintf/manifest/vendor.xiaomi.hardware.misys@2.0.xml b/proprietary/vendor/etc/vintf/manifest/vendor.xiaomi.hardware.misys@2.0.xml new file mode 100644 index 0000000..2e148db --- /dev/null +++ b/proprietary/vendor/etc/vintf/manifest/vendor.xiaomi.hardware.misys@2.0.xml @@ -0,0 +1,38 @@ + + + + vendor.xiaomi.hardware.misys + hwbinder + 2.0 + + IMiSys + default + + + diff --git a/proprietary/vendor/etc/vintf/manifest/vendor.xiaomi.hardware.misys@3.0.xml b/proprietary/vendor/etc/vintf/manifest/vendor.xiaomi.hardware.misys@3.0.xml new file mode 100644 index 0000000..df402fe --- /dev/null +++ b/proprietary/vendor/etc/vintf/manifest/vendor.xiaomi.hardware.misys@3.0.xml @@ -0,0 +1,38 @@ + + + + vendor.xiaomi.hardware.misys + hwbinder + 3.0 + + IMiSys + default + + + diff --git a/proprietary/vendor/etc/vintf/manifest/vendor.xiaomi.hardware.misys@4.0.xml b/proprietary/vendor/etc/vintf/manifest/vendor.xiaomi.hardware.misys@4.0.xml new file mode 100644 index 0000000..ae2f38d --- /dev/null +++ b/proprietary/vendor/etc/vintf/manifest/vendor.xiaomi.hardware.misys@4.0.xml @@ -0,0 +1,38 @@ + + + + vendor.xiaomi.hardware.misys + hwbinder + 4.0 + + IMiSys + default + + + diff --git a/proprietary/vendor/lib/libOpenCL.so b/proprietary/vendor/lib/libOpenCL.so new file mode 100644 index 0000000..a21ab60 Binary files /dev/null and b/proprietary/vendor/lib/libOpenCL.so differ diff --git a/proprietary/vendor/lib64/hw/vendor.xiaomi.hardware.misys@1.0-impl.so b/proprietary/vendor/lib64/hw/vendor.xiaomi.hardware.misys@1.0-impl.so new file mode 100644 index 0000000..c80d538 Binary files /dev/null and b/proprietary/vendor/lib64/hw/vendor.xiaomi.hardware.misys@1.0-impl.so differ diff --git a/proprietary/vendor/lib64/hw/vendor.xiaomi.hardware.misys@2.0-impl.so b/proprietary/vendor/lib64/hw/vendor.xiaomi.hardware.misys@2.0-impl.so new file mode 100644 index 0000000..fa88de1 Binary files /dev/null and b/proprietary/vendor/lib64/hw/vendor.xiaomi.hardware.misys@2.0-impl.so differ diff --git a/proprietary/vendor/lib64/hw/vendor.xiaomi.hardware.misys@3.0-impl.so b/proprietary/vendor/lib64/hw/vendor.xiaomi.hardware.misys@3.0-impl.so new file mode 100644 index 0000000..e3d93e1 Binary files /dev/null and b/proprietary/vendor/lib64/hw/vendor.xiaomi.hardware.misys@3.0-impl.so differ diff --git a/proprietary/vendor/lib64/hw/vendor.xiaomi.hardware.misys@4.0-impl.so b/proprietary/vendor/lib64/hw/vendor.xiaomi.hardware.misys@4.0-impl.so new file mode 100644 index 0000000..d9002be Binary files /dev/null and b/proprietary/vendor/lib64/hw/vendor.xiaomi.hardware.misys@4.0-impl.so differ diff --git a/proprietary/vendor/lib64/libOpenCL.so b/proprietary/vendor/lib64/libOpenCL.so new file mode 100644 index 0000000..d5ff3b7 Binary files /dev/null and b/proprietary/vendor/lib64/libOpenCL.so differ diff --git a/proprietary/vendor/lib64/lib_sr_models.so b/proprietary/vendor/lib64/lib_sr_models.so new file mode 100644 index 0000000..417bb6e Binary files /dev/null and b/proprietary/vendor/lib64/lib_sr_models.so differ diff --git a/proprietary/vendor/lib64/libarcsat.so b/proprietary/vendor/lib64/libarcsat.so new file mode 100644 index 0000000..a601aed Binary files /dev/null and b/proprietary/vendor/lib64/libarcsat.so differ diff --git a/proprietary/vendor/lib64/libbeauty_face_interface.so b/proprietary/vendor/lib64/libbeauty_face_interface.so new file mode 100644 index 0000000..99595b6 Binary files /dev/null and b/proprietary/vendor/lib64/libbeauty_face_interface.so differ diff --git a/proprietary/vendor/lib64/libcheckpid.so b/proprietary/vendor/lib64/libcheckpid.so new file mode 100644 index 0000000..617c029 Binary files /dev/null and b/proprietary/vendor/lib64/libcheckpid.so differ diff --git a/proprietary/vendor/lib64/libflaw.so b/proprietary/vendor/lib64/libflaw.so new file mode 100644 index 0000000..2f4f190 Binary files /dev/null and b/proprietary/vendor/lib64/libflaw.so differ diff --git a/proprietary/vendor/lib64/liblogwrap_vendor.so b/proprietary/vendor/lib64/liblogwrap_vendor.so new file mode 100644 index 0000000..ed00276 Binary files /dev/null and b/proprietary/vendor/lib64/liblogwrap_vendor.so differ diff --git a/proprietary/vendor/lib64/librelight_only.so b/proprietary/vendor/lib64/librelight_only.so new file mode 100644 index 0000000..78dbe07 Binary files /dev/null and b/proprietary/vendor/lib64/librelight_only.so differ diff --git a/proprietary/vendor/lib64/libsdk_sr.so b/proprietary/vendor/lib64/libsdk_sr.so new file mode 100644 index 0000000..d6ce529 Binary files /dev/null and b/proprietary/vendor/lib64/libsdk_sr.so differ diff --git a/proprietary/vendor/lib64/libsupermoon.so b/proprietary/vendor/lib64/libsupermoon.so new file mode 100644 index 0000000..4018f85 Binary files /dev/null and b/proprietary/vendor/lib64/libsupermoon.so differ diff --git a/proprietary/vendor/lib64/vendor.xiaomi.hardware.misys@1.0.so b/proprietary/vendor/lib64/vendor.xiaomi.hardware.misys@1.0.so new file mode 100644 index 0000000..97eb443 Binary files /dev/null and b/proprietary/vendor/lib64/vendor.xiaomi.hardware.misys@1.0.so differ diff --git a/proprietary/vendor/lib64/vendor.xiaomi.hardware.misys@2.0.so b/proprietary/vendor/lib64/vendor.xiaomi.hardware.misys@2.0.so new file mode 100644 index 0000000..877a9e4 Binary files /dev/null and b/proprietary/vendor/lib64/vendor.xiaomi.hardware.misys@2.0.so differ diff --git a/proprietary/vendor/lib64/vendor.xiaomi.hardware.misys@3.0.so b/proprietary/vendor/lib64/vendor.xiaomi.hardware.misys@3.0.so new file mode 100644 index 0000000..af2a4aa Binary files /dev/null and b/proprietary/vendor/lib64/vendor.xiaomi.hardware.misys@3.0.so differ diff --git a/proprietary/vendor/lib64/vendor.xiaomi.hardware.misys@4.0.so b/proprietary/vendor/lib64/vendor.xiaomi.hardware.misys@4.0.so new file mode 100644 index 0000000..f5912c3 Binary files /dev/null and b/proprietary/vendor/lib64/vendor.xiaomi.hardware.misys@4.0.so differ diff --git a/rro_overlays/MiuiCameraOverlay/Android.bp b/rro_overlays/MiuiCameraOverlay/Android.bp new file mode 100644 index 0000000..52160c9 --- /dev/null +++ b/rro_overlays/MiuiCameraOverlay/Android.bp @@ -0,0 +1,5 @@ +runtime_resource_overlay { + name: "MiuiCameraOverlay", + product_specific: true, +} + diff --git a/rro_overlays/MiuiCameraOverlay/AndroidManifest.xml b/rro_overlays/MiuiCameraOverlay/AndroidManifest.xml new file mode 100644 index 0000000..c31f5f8 --- /dev/null +++ b/rro_overlays/MiuiCameraOverlay/AndroidManifest.xml @@ -0,0 +1,10 @@ + + + + + diff --git a/rro_overlays/MiuiCameraOverlay/res/values/config.xml b/rro_overlays/MiuiCameraOverlay/res/values/config.xml new file mode 100644 index 0000000..2f9e974 --- /dev/null +++ b/rro_overlays/MiuiCameraOverlay/res/values/config.xml @@ -0,0 +1,12 @@ + + + + + + + true + + true + + 2 + diff --git a/rro_overlays/MiuiCameraOverlayAosp/Android.bp b/rro_overlays/MiuiCameraOverlayAosp/Android.bp new file mode 100644 index 0000000..a70a631 --- /dev/null +++ b/rro_overlays/MiuiCameraOverlayAosp/Android.bp @@ -0,0 +1,4 @@ +runtime_resource_overlay { + name: "MiuiCameraOverlayAosp", + product_specific: true, +} diff --git a/rro_overlays/MiuiCameraOverlayAosp/AndroidManifest.xml b/rro_overlays/MiuiCameraOverlayAosp/AndroidManifest.xml new file mode 100644 index 0000000..50663be --- /dev/null +++ b/rro_overlays/MiuiCameraOverlayAosp/AndroidManifest.xml @@ -0,0 +1,6 @@ + + + diff --git a/rro_overlays/MiuiCameraOverlayAosp/res/values/config.xml b/rro_overlays/MiuiCameraOverlayAosp/res/values/config.xml new file mode 100644 index 0000000..ff6ac47 --- /dev/null +++ b/rro_overlays/MiuiCameraOverlayAosp/res/values/config.xml @@ -0,0 +1,13 @@ + + + + + com.android.camera + org.lineageos.aperture + org.lineageos.aperture.dev + com.crdroid.faceunlock + org.pixelexperience.faceunlock + + diff --git a/rro_overlays/MiuiCameraOverlayLos/Android.bp b/rro_overlays/MiuiCameraOverlayLos/Android.bp new file mode 100644 index 0000000..cf6721d --- /dev/null +++ b/rro_overlays/MiuiCameraOverlayLos/Android.bp @@ -0,0 +1,4 @@ +runtime_resource_overlay { + name: "MiuiCameraOverlayLos", + product_specific: true, +} diff --git a/rro_overlays/MiuiCameraOverlayLos/AndroidManifest.xml b/rro_overlays/MiuiCameraOverlayLos/AndroidManifest.xml new file mode 100644 index 0000000..f6650d6 --- /dev/null +++ b/rro_overlays/MiuiCameraOverlayLos/AndroidManifest.xml @@ -0,0 +1,6 @@ + + + diff --git a/rro_overlays/MiuiCameraOverlayLos/res/values/config.xml b/rro_overlays/MiuiCameraOverlayLos/res/values/config.xml new file mode 100644 index 0000000..ff6ac47 --- /dev/null +++ b/rro_overlays/MiuiCameraOverlayLos/res/values/config.xml @@ -0,0 +1,13 @@ + + + + + com.android.camera + org.lineageos.aperture + org.lineageos.aperture.dev + com.crdroid.faceunlock + org.pixelexperience.faceunlock + + diff --git a/sepolicy/camera/private/cameraserver.te b/sepolicy/camera/private/cameraserver.te new file mode 100644 index 0000000..1aca86c --- /dev/null +++ b/sepolicy/camera/private/cameraserver.te @@ -0,0 +1,3 @@ +allow cameraserver property_socket:sock_file write; +allow cameraserver init:unix_stream_socket connectto; +set_prop(cameraserver, exported_system_prop) diff --git a/sepolicy/camera/private/platform_app.te b/sepolicy/camera/private/platform_app.te new file mode 100644 index 0000000..1b8fe5c --- /dev/null +++ b/sepolicy/camera/private/platform_app.te @@ -0,0 +1,6 @@ +allow platform_app { + DisplayFeatureControl + miui_multi_display + perfshielder + ProcessManager +}:service_manager find; diff --git a/sepolicy/camera/private/priv_app.te b/sepolicy/camera/private/priv_app.te new file mode 100644 index 0000000..e53a1d0 --- /dev/null +++ b/sepolicy/camera/private/priv_app.te @@ -0,0 +1,5 @@ +allow priv_app DisplayFeatureControl:service_manager find; +allow priv_app miui_multi_display:service_manager find; +allow priv_app perfshielder:service_manager find; +allow priv_app ProcessManager:service_manager find; + diff --git a/sepolicy/camera/private/property_contexts b/sepolicy/camera/private/property_contexts new file mode 100644 index 0000000..0cae346 --- /dev/null +++ b/sepolicy/camera/private/property_contexts @@ -0,0 +1,2 @@ +# Miui Camera +sys.camera.miui.apk u:object_r:exported_system_prop:s0 diff --git a/sepolicy/camera/private/service.te b/sepolicy/camera/private/service.te new file mode 100644 index 0000000..398eb74 --- /dev/null +++ b/sepolicy/camera/private/service.te @@ -0,0 +1,4 @@ +type DisplayFeatureControl, service_manager_type; +type perfshielder, service_manager_type; +type miui_multi_display, service_manager_type; +type ProcessManager, service_manager_type; diff --git a/sepolicy/camera/private/service_contexts b/sepolicy/camera/private/service_contexts new file mode 100644 index 0000000..9bcaa25 --- /dev/null +++ b/sepolicy/camera/private/service_contexts @@ -0,0 +1,4 @@ +DisplayFeatureControl u:object_r:DisplayFeatureControl:s0 +perfshielder u:object_r:perfshielder:s0 +miui_multi_display u:object_r:miui_multi_display:s0 +ProcessManager u:object_r:ProcessManager:s0 diff --git a/sepolicy/camera/vendor/attributes b/sepolicy/camera/vendor/attributes new file mode 100644 index 0000000..0475a9e --- /dev/null +++ b/sepolicy/camera/vendor/attributes @@ -0,0 +1,4 @@ +# Camera +attribute vendor_hal_camerapostproc_xiaomi; +attribute vendor_hal_camerapostproc_xiaomi_client; +attribute vendor_hal_camerapostproc_xiaomi_server; diff --git a/sepolicy/camera/vendor/file_contexts b/sepolicy/camera/vendor/file_contexts new file mode 100644 index 0000000..f7105dd --- /dev/null +++ b/sepolicy/camera/vendor/file_contexts @@ -0,0 +1,119 @@ +# Camera Data Path +/data/user/0/com.android.camera(/.*)? u:object_r:app_data_file:s0 +/data/user/0/com.miui.extraphoto(/.*)? u:object_r:app_data_file:s0 + +# Miui Gallery +/data/user/0/com.miui.gallery(/.*)? u:object_r:app_data_file:s0 +/data/user/0/com.miui.mediaeditor(/.*)? u:object_r:app_data_file:s0 + +# PostProcessing +/(vendor|system/vendor)/bin/hw/vendor\.xiaomi\.hardware\.campostproc@1\.0-service u:object_r:hal_camerapostproc_xiaomi_default_exec:s0 + +# General Rules +/vendor/lib(64)?/libmialgoengine\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libmpbase\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libmibokeh_855\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libmialgo_image_colourkeeping\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libSuperSensor\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libSuperSensorCPU\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libHalSuperSensorServer\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libSuperSensor_skel\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libmorpho_HDSR\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libHalSuperSensorServerCWrapper\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libarcsoft_beautyshot\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libarcsoft_dualcam_refocus\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libarcsoft_dualcam_refocus_rear_t\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libarcsoft_dualcam_refocus_rear_w\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libarcsoft_dualcam_refocus_front\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libarcsoft_dualcam_refocus_image\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libarcsoft_dualcam_refocus_video\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libarcsoft_portrait_lighting\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libarcsoft_portrait_lighting_c\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libarcsoft_mf_superresolution\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libsupermoon\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libarcsoft_high_dynamic_range\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libarcsoft_high_dynamic_range_v5\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libarcsoft_low_light_hdr\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libalCFR\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libalCFRLV\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libarcsoft_distortion_correction\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libarcsoft_bodyslim\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libcvp2\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libcvp2_hfi\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libcvp\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libcvp_stub\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libcvp_common\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libalhLDC\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libalAILDC\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libwa_widelens_undistort\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libflaw\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libsdk_sr\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libst_sr_models\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/lib_sr_models\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libarcsoft_superportrait\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libmialgo_ie_capture\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libmialgo_basic\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libmialgo_utils\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libmiphone_bokeh_effect\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libmiphone_bokeh_rectify\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libmiphone_bokeh_proc\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libmiphone_bokeh_gpf\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libmialgo_bokeh\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libmiphone_bokeh_depth\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libcamera_scene_dxo\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libcamera_scene\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libportrait_blur\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libmibokeh_mask\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/librelight_only\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libFaceDetLmd\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/rfsa/adsp(/.*)? u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libMIAIHDRhvx_interface\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/rfsa/adsp/libMIAIHDR_skel\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/rfsa/adsp/libapps_mem_heap\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libxmi_high_dynamic_range\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libxmi_high_dynamic_range_cdsp\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/rfsa/adsp/libhdr_cdsp_skel\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libsymphony-cpu\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libc\+\+_shared\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libwa_opticalzoom_fusion\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libmiStereoFactoryRemapLib\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libmibokeh_712\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libbeauty_face_interface\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libmiai_portraitsupernight\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libxml2_vendor\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libmiphone_capture_ldc\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libSNPE\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libsnpe_dsp_domains_v2\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libPlatformValidatorShared\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libmiai_deblur\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libmialgoengine2\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libcom.xiaomi.pluginutils\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/com.xiaomi.plugin.memcpy\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/com.xiaomi.plugin.hdr\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/com.xiaomi.plugin.skinbeautifier\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/com.xiaomi.plugin.aiasd\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/com.xiaomi.plugin.depurple\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/com.xiaomi.plugin.ldc\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/com.xiaomi.plugin.dc\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/com.xiaomi.plugin.mibokeh\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/com.xiaomi.plugin.miaiie\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/com.xiaomi.plugin.capbokeh\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/com.xiaomi.plugin.sr\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/com.qcom.plugin.gpu\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/com.xiaomi.plugin.miflaw\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/com.xiaomi.plugin.misegment\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/com.xiaomi.plugin.mifragment\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/com.xiaomi.plugin.bodyslim\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/com.xiaomi.plugin.superportrait\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/com.xiaomi.plugin.supernight\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/com.xiaomi.plugin.miaideblur\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libsnpe_dsp_skel\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libsnpe_dsp_domains_skel\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libsnpe_dsp_v65_domains_v2_skel\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libsnpe_dsp_v66_domains_v2_skel\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libanc_dc_base\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libwa_dof\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libwa_refocus\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libwa_depth\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libxmi_hdr_checker\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libmiStereoFactoryRemapBasicLib\.so u:object_r:same_process_hal_file:s0 diff --git a/sepolicy/camera/vendor/hal_camera_default.te b/sepolicy/camera/vendor/hal_camera_default.te new file mode 100644 index 0000000..d870dcb --- /dev/null +++ b/sepolicy/camera/vendor/hal_camera_default.te @@ -0,0 +1,24 @@ +binder_call(hal_camera_default, platform_app) + +allow hal_camera_default mnt_vendor_file:dir { search }; +allow hal_camera_default proc_stat:file { open read }; +allow hal_camera_default vendor_xdsp_device:chr_file { read }; + +# Allow Camera to access system_server +allow hal_camera_default system_server:binder { call transfer }; + +# Camera Post Processing +type vendor_hal_camerapostproc_xiaomi_hwservice, hwservice_manager_type; + +hal_server_domain(hal_camera_default, vendor_hal_camerapostproc_xiaomi) +add_hwservice(hal_camera_server, vendor_hal_camerapostproc_xiaomi_hwservice) + +allow hal_camera_client vendor_hal_camerapostproc_xiaomi_hwservice:hwservice_manager find; + +# Allow camera to access /data/misc +typeattribute hal_camera_default data_between_core_and_vendor_violators; + +# Allow camera to access /data/misc +allow hal_camera_default camera_data_file:sock_file write; +allow hal_camera_default camera_data_file:dir create_dir_perms; +allow hal_camera_default camera_data_file:file create_file_perms; diff --git a/sepolicy/camera/vendor/hal_camerapostproc_xiaomi.te b/sepolicy/camera/vendor/hal_camerapostproc_xiaomi.te new file mode 100644 index 0000000..a636d76 --- /dev/null +++ b/sepolicy/camera/vendor/hal_camerapostproc_xiaomi.te @@ -0,0 +1,8 @@ +type hal_camerapostproc_xiaomi_default_exec, exec_type, vendor_file_type, file_type; + +add_hwservice(vendor_hal_camerapostproc_xiaomi_server, vendor_hal_camerapostproc_xiaomi_hwservice) + +allow vendor_hal_camerapostproc_xiaomi_client vendor_hal_camerapostproc_xiaomi_hwservice:hwservice_manager find; + +binder_call(vendor_hal_camerapostproc_xiaomi_client, vendor_hal_camerapostproc_xiaomi_server) +binder_call(vendor_hal_camerapostproc_xiaomi_server, vendor_hal_camerapostproc_xiaomi_client) diff --git a/sepolicy/camera/vendor/hwservice.te b/sepolicy/camera/vendor/hwservice.te new file mode 100644 index 0000000..3f06847 --- /dev/null +++ b/sepolicy/camera/vendor/hwservice.te @@ -0,0 +1 @@ +type hal_xiaomi_camera_hwservice, hwservice_manager_type; diff --git a/sepolicy/camera/vendor/hwservice_contexts b/sepolicy/camera/vendor/hwservice_contexts new file mode 100644 index 0000000..44d20f5 --- /dev/null +++ b/sepolicy/camera/vendor/hwservice_contexts @@ -0,0 +1,2 @@ +# Camera +vendor.xiaomi.hardware.campostproc::IMiPostProcService u:object_r:hal_xiaomi_camera_hwservice:s0 diff --git a/sepolicy/camera/vendor/platform_app.te b/sepolicy/camera/vendor/platform_app.te new file mode 100644 index 0000000..384394c --- /dev/null +++ b/sepolicy/camera/vendor/platform_app.te @@ -0,0 +1,30 @@ +# Allow to execute data files +allow platform_app app_data_file:file execute; + +# Allow to find camera hal +allow platform_app hal_xiaomi_camera_hwservice:hwservice_manager find; + +# Allow to call camera hidl +binder_call(platform_app, hal_camera_default) + +# Allow to read camera props +get_prop(platform_app, vendor_camera_prop) +get_prop(platform_app, vendor_camera_sensor_prop) + +allow platform_app cgroup:file r_file_perms; + +# Allow to read display props +get_prop(platform_app, vendor_display_prop) + +# Allow to read audio props +get_prop(platform_app, vendor_audio_prop) + +# Allow to access proc/stat +allow platform_app proc_stat:file read; + +# Camera Post Processing +typeattribute platform_app halclientdomain; +typeattribute platform_app vendor_hal_camerapostproc_xiaomi_client; + +allow platform_app { vendor_hal_camerapostproc_xiaomi_hwservice hal_misys_hwservice }:hwservice_manager find; + diff --git a/sepolicy/camera/vendor/property.te b/sepolicy/camera/vendor/property.te new file mode 100644 index 0000000..b71f07c --- /dev/null +++ b/sepolicy/camera/vendor/property.te @@ -0,0 +1 @@ +vendor_public_prop(vendor_camera_sensor_prop) diff --git a/sepolicy/camera/vendor/property_contexts b/sepolicy/camera/vendor/property_contexts new file mode 100644 index 0000000..6d7a62f --- /dev/null +++ b/sepolicy/camera/vendor/property_contexts @@ -0,0 +1,5 @@ +# Camera Vendor Props +persist.vendor.low.cutoff u:object_r:vendor_camera_prop:s0 + +# Camera Persist Props +vendor.camera.skip_unconfigure.packagelist u:object_r:vendor_persist_camera_prop:s0 diff --git a/sepolicy/camera/vendor/vendor_hal_camerapostproc_xiaomi.te b/sepolicy/camera/vendor/vendor_hal_camerapostproc_xiaomi.te new file mode 100644 index 0000000..efd1884 --- /dev/null +++ b/sepolicy/camera/vendor/vendor_hal_camerapostproc_xiaomi.te @@ -0,0 +1 @@ +allow vendor_hal_camerapostproc_xiaomi platform_app:binder transfer; diff --git a/sepolicy/misys/private/platform_app.te b/sepolicy/misys/private/platform_app.te new file mode 100644 index 0000000..6ad7e7f --- /dev/null +++ b/sepolicy/misys/private/platform_app.te @@ -0,0 +1 @@ +hal_client_domain(platform_app, hal_misys) diff --git a/sepolicy/misys/private/priv_app.te b/sepolicy/misys/private/priv_app.te new file mode 100644 index 0000000..315f42d --- /dev/null +++ b/sepolicy/misys/private/priv_app.te @@ -0,0 +1 @@ +hal_client_domain(priv_app, hal_misys) diff --git a/sepolicy/misys/public/attributes b/sepolicy/misys/public/attributes new file mode 100644 index 0000000..1da9f0e --- /dev/null +++ b/sepolicy/misys/public/attributes @@ -0,0 +1,4 @@ +# Misys +attribute hal_misys; +attribute hal_misys_client; +attribute hal_misys_server; diff --git a/sepolicy/misys/vendor/file_contexts b/sepolicy/misys/vendor/file_contexts new file mode 100644 index 0000000..c3e74cc --- /dev/null +++ b/sepolicy/misys/vendor/file_contexts @@ -0,0 +1,5 @@ +# MiSys +/vendor/bin/hw/vendor\.xiaomi\.hardware\.misys@1\.0-service u:object_r:hal_misys_default_exec:s0 +/vendor/bin/hw/vendor\.xiaomi\.hardware\.misys@2\.0-service u:object_r:hal_misys_default_exec:s0 +/vendor/bin/hw/vendor\.xiaomi\.hardware\.misys@3\.0-service u:object_r:hal_misys_default_exec:s0 +/vendor/bin/hw/vendor\.xiaomi\.hardware\.misys@4\.0-service u:object_r:hal_misys_default_exec:s0 diff --git a/sepolicy/misys/vendor/hal_misys.te b/sepolicy/misys/vendor/hal_misys.te new file mode 100644 index 0000000..2072c83 --- /dev/null +++ b/sepolicy/misys/vendor/hal_misys.te @@ -0,0 +1,5 @@ +# HwBinder IPC from client to server +binder_call(hal_misys_client, hal_misys_server) + +add_hwservice(hal_misys_server, hal_misys_hwservice) +allow hal_misys_client hal_misys_hwservice:hwservice_manager find; diff --git a/sepolicy/misys/vendor/hal_misys_default.te b/sepolicy/misys/vendor/hal_misys_default.te new file mode 100644 index 0000000..4b910de --- /dev/null +++ b/sepolicy/misys/vendor/hal_misys_default.te @@ -0,0 +1,11 @@ +type hal_misys_default, domain; +hal_server_domain(hal_misys_default, hal_misys) + +type hal_misys_default_exec, exec_type, vendor_file_type, file_type; + +init_daemon_domain(hal_misys_default) + +r_dir_file(hal_misys_default, firmware_file) +r_dir_file(hal_misys_default, mnt_vendor_file) + +get_prop(hal_misys_default, vendor_camera_prop) diff --git a/sepolicy/misys/vendor/hwservice.te b/sepolicy/misys/vendor/hwservice.te new file mode 100644 index 0000000..2c2c9e9 --- /dev/null +++ b/sepolicy/misys/vendor/hwservice.te @@ -0,0 +1,2 @@ +# MiSys +type hal_misys_hwservice, hwservice_manager_type; diff --git a/sepolicy/misys/vendor/hwservice_contexts b/sepolicy/misys/vendor/hwservice_contexts new file mode 100644 index 0000000..d1dd6b0 --- /dev/null +++ b/sepolicy/misys/vendor/hwservice_contexts @@ -0,0 +1,2 @@ +# MiSys +vendor.xiaomi.hardware.misys::IMiSys u:object_r:hal_misys_hwservice:s0 diff --git a/sepolicy/misys/vendor/platform_app.te b/sepolicy/misys/vendor/platform_app.te new file mode 100644 index 0000000..a373dc5 --- /dev/null +++ b/sepolicy/misys/vendor/platform_app.te @@ -0,0 +1,2 @@ +allow platform_app hal_misys_hwservice:hwservice_manager find; +binder_call(platform_app, hal_misys_default) diff --git a/setup-makefiles.sh b/setup-makefiles.sh new file mode 100755 index 0000000..836bfe1 --- /dev/null +++ b/setup-makefiles.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# +# Copyright (C) 2016 The CyanogenMod Project +# Copyright (C) 2017-2020 The LineageOS Project +# +# SPDX-License-Identifier: Apache-2.0 +# + +set -e + +DEVICE=camera +DEVICE_COMMON=camera +VENDOR=xiaomi + +# Load extract_utils and do some sanity checks +MY_DIR="${BASH_SOURCE%/*}" +if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi + +ANDROID_ROOT="${MY_DIR}/../../.." + +HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh" +if [ ! -f "${HELPER}" ]; then + echo "Unable to find helper script at ${HELPER}" + exit 1 +fi +source "${HELPER}" + +# Initialize the helper +setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" true + +# Warning headers and guards +write_headers "alioth" +sed -i 's|device/|vendor/|g' "$ANDROIDBP" "$ANDROIDMK" "$BOARDMK" "$PRODUCTMK" + +write_makefiles "${MY_DIR}/proprietary-files.txt" true + +# Finish +write_footers