Compare commits

...

10 Commits

Author SHA1 Message Date
pure-soul-kk
6156a43052 miuicamera: switch to leica 2024-09-14 13:37:47 +00:00
basamaryan
8098c6143c
miuicamera: Regenerate with checkelf changes
Change-Id: I5cb60ba44b0f9223cc258af76275e18b3021a0b1
2024-09-13 16:10:15 -04:00
Michael Bestas
13a8776665
miuicamera: Libraries are now automatically added to PRODUCT_PACKAGES
Change-Id: Ie92fe02b7e6279195bf28944942c815db773b798
2024-09-13 16:10:12 -04:00
Arian
c12dc0d8a7
miuicamera: Drop explicit building of libgui shim
Change-Id: I7bbc4e7b4ba12fe427ce2d986125fca8f24731f2
2024-09-13 16:10:12 -04:00
Aaron Kling
0739aa6e5a
miuicamera: Enable elf checks
Change-Id: Ia6c9a381abb3384c77532d75e02fd84c841a4d1e
2024-09-13 16:10:12 -04:00
Michael Bestas
7d90015f98
miuicamera: Sync extract scripts with templates
Change-Id: I98a36854c5a0c0390592911bb2558b34eff77efc
2024-09-13 16:10:12 -04:00
basamaryan
18bcc482e7
miuicamera: Drop vendor libraries
Change-Id: Ib5d5d6025dbea8733b1b86094d200564aad24a67
2024-09-13 16:10:12 -04:00
basamaryan
1de918fbc4
miuicamera: sepolicy: Allow reading /proc/stat
Change-Id: Id0cd3ebd2bed45b451baa37d579feb5739e88293
2024-08-07 01:05:11 +05:30
basamaryan
1400cac197
miuicamera: Patch during extract time
Change-Id: I102024ee87de9f443cfa288d762826c30b68fac1
2024-08-06 23:50:50 +05:30
basamaryan
a3448c828f
miuicamera: Patch to disable BackupAgent
18fc4af4bd

Change-Id: Id94361c03885ab0b8034b65d30e236d710e18ccd
2024-07-30 21:28:10 +05:30
12 changed files with 119 additions and 74 deletions

View File

@ -0,0 +1,11 @@
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -72,7 +72,7 @@
<package android:name="com.xiaomi.scanner"/>
<package android:name="com.android.htmlviewer"/>
</queries>
- <application android:allowBackup="true" android:appComponentFactory="androidx.core.app.CoreComponentFactory" android:backupAgent="com.android.camera.backup.CameraBackupAgent" android:extractNativeLibs="false" android:hardwareAccelerated="true" android:icon="@mipmap/ic_launcher_camera_cv" android:label="@string/camera_label" android:largeHeap="true" android:name="com.android.camera.CameraAppImpl" android:networkSecurityConfig="@xml/network_security_config" android:resizeableActivity="false" android:supportsRtl="true" android:theme="@style/ThemeCamera">
+ <application android:allowBackup="false" android:appComponentFactory="androidx.core.app.CoreComponentFactory" android:extractNativeLibs="false" android:hardwareAccelerated="true" android:icon="@mipmap/ic_launcher_camera_cv" android:label="@string/camera_label" android:largeHeap="true" android:name="com.android.camera.CameraAppImpl" android:networkSecurityConfig="@xml/network_security_config" android:resizeableActivity="false" android:supportsRtl="true" android:theme="@style/ThemeCamera">
<meta-data android:name="required_permissions" android:value="@string/required_permissions_supportModifiable"/>
<meta-data android:name="miui.supportRequiredModifiable" android:value="true"/>
<meta-data android:name="com.miui.bugreport.LOG_DIR" android:resource="@xml/log_paths"/>

View File

@ -0,0 +1,61 @@
--- a/smali_classes2/com/xiaomi/protocol/ICustomCaptureResult.smali
+++ b/smali_classes2/com/xiaomi/protocol/ICustomCaptureResult.smali
@@ -346,7 +346,7 @@
.end method
.method public static toTotalCaptureResult(Lcom/xiaomi/protocol/ICustomCaptureResult;IZ)Landroid/hardware/camera2/TotalCaptureResult;
- .locals 23
+ .locals 27
const-string v0, "android.hardware.camera2.impl.PhysicalCaptureResultInfo"
@@ -434,7 +434,7 @@
if-lt v7, v8, :cond_0
- const/16 v7, 0xb
+ const/16 v7, 0xd
:try_start_1
new-array v8, v7, [Ljava/lang/Class;
@@ -488,6 +488,18 @@
aput-object v19, v8, v21
+ sget-object v19, Ljava/lang/Boolean;->TYPE:Ljava/lang/Class;
+
+ const/16 v23, 0xb
+
+ aput-object v19, v8, v23
+
+ sget-object v19, Ljava/lang/Long;->TYPE:Ljava/lang/Class;
+
+ const/16 v24, 0xc
+
+ aput-object v19, v8, v24
+
.line 8
invoke-virtual {v1, v8}, Ljava/lang/Class;->getDeclaredConstructor([Ljava/lang/Class;)Ljava/lang/reflect/Constructor;
@@ -565,6 +577,22 @@
aput-object v19, v7, v21
+ const/16 v25, 0x0
+
+ invoke-static/range {v25 .. v25}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;
+
+ move-result-object v19
+
+ aput-object v19, v7, v23
+
+ const/16 v26, 0x0
+
+ invoke-static/range {v26 .. v26}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
+
+ move-result-object v19
+
+ aput-object v19, v7, v24
+
.line 11
invoke-virtual {v8, v7}, Ljava/lang/reflect/Constructor;->newInstance([Ljava/lang/Object;)Ljava/lang/Object;

View File

@ -16,10 +16,10 @@ cc_prebuilt_library_shared {
target: {
android_arm64: {
srcs: ["proprietary/system/lib64/libcamera_algoup_jni.xiaomi.so"],
shared_libs: ["libgui_shim_miuicamera", "libandroid", "libandroid_runtime", "libbase", "libbinder", "libcamera_client", "libcamera_metadata", "libcutils", "libgui", "liblog", "libmedia_jni_utils", "libnativehelper", "libnativewindow", "libui", "libutils", "libvndksupport", "android.hidl.token@1.0-utils", "libc++", "libc", "libm", "libdl", ],
},
},
compile_multilib: "64",
check_elf_files: false,
prefer: true,
}
@ -32,10 +32,10 @@ cc_prebuilt_library_shared {
target: {
android_arm64: {
srcs: ["proprietary/system/lib64/libcamera_mianode_jni.xiaomi.so"],
shared_libs: ["libgui_shim_miuicamera", "libandroid", "libbinder", "libcamera_client", "libcamera_metadata", "libcutils", "libgui", "liblog", "libmedia_jni_utils", "libui", "libutils", "libvndksupport", "libxml2", "libc++", "libc", "libm", "libdl", ],
},
},
compile_multilib: "64",
check_elf_files: false,
prefer: true,
}
@ -48,10 +48,10 @@ cc_prebuilt_library_shared {
target: {
android_arm64: {
srcs: ["proprietary/system/lib64/libmicampostproc_client.so"],
shared_libs: ["liblog", "libutils", "libcutils", "libhardware", "libnativewindow", "libEGL", "libGLESv2", "libfmq", "libgui", "libui", "libcamera_client", "libcamera_metadata", "libmedia_jni_utils", "libnativehelper", "libhidlbase", "vendor.xiaomi.hardware.campostproc@1.0", "libc++", "libc", "libm", "libdl", ],
},
},
compile_multilib: "64",
check_elf_files: false,
prefer: true,
}
@ -64,47 +64,13 @@ cc_prebuilt_library_shared {
target: {
android_arm64: {
srcs: ["proprietary/system/lib64/vendor.xiaomi.hardware.campostproc@1.0.so"],
shared_libs: ["android.hardware.camera.common@1.0", "libhidlbase", "liblog", "libutils", "libcutils", "libc++", "libc", "libm", "libdl", ],
},
},
compile_multilib: "64",
check_elf_files: false,
prefer: true,
}
cc_prebuilt_library_shared {
name: "libarcdualcamsat",
owner: "xiaomi",
strip: {
none: true,
},
target: {
android_arm64: {
srcs: ["proprietary/vendor/lib64/libarcdualcamsat.so"],
},
},
compile_multilib: "64",
check_elf_files: false,
prefer: true,
soc_specific: true,
}
cc_prebuilt_library_shared {
name: "libarcsat",
owner: "xiaomi",
strip: {
none: true,
},
target: {
android_arm64: {
srcs: ["proprietary/vendor/lib64/libarcsat.so"],
},
},
compile_multilib: "64",
check_elf_files: false,
prefer: true,
soc_specific: true,
}
android_app_import {
name: "MiuiCamera",
owner: "xiaomi",

View File

@ -11,6 +11,4 @@ PRODUCT_PACKAGES += \
libcamera_mianode_jni.xiaomi \
libmicampostproc_client \
vendor.xiaomi.hardware.campostproc@1.0 \
libarcdualcamsat \
libarcsat \
MiuiCamera

Binary file not shown.

View File

@ -1,8 +1,7 @@
#!/bin/bash
#
# Copyright (C) 2016 The CyanogenMod Project
# Copyright (C) 2017-2020 The LineageOS Project
#
# SPDX-FileCopyrightText: 2016 The CyanogenMod Project
# SPDX-FileCopyrightText: 2017-2024 The LineageOS Project
# SPDX-License-Identifier: Apache-2.0
#
@ -17,6 +16,8 @@ if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi
ANDROID_ROOT="${MY_DIR}/../../.."
export TARGET_ENABLE_CHECKELF=true
HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh"
if [ ! -f "${HELPER}" ]; then
echo "Unable to find helper script at ${HELPER}"
@ -32,19 +33,20 @@ 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}"
;;
-n | --no-cleanup)
CLEAN_VENDOR=false
;;
-k | --kang)
KANG="--kang"
;;
-s | --section)
SECTION="${2}"
shift
CLEAN_VENDOR=false
;;
*)
SRC="${1}"
;;
esac
shift
done
@ -55,19 +57,29 @@ fi
function blob_fixup() {
case "${1}" in
system/priv-app/MiuiCamera/MiuiCamera.apk)
[ "$2" = "" ] && return 0
apktool_patch "${2}" "$MY_DIR/blob-patches"
;;
system/lib64/libcamera_algoup_jni.xiaomi.so|system/lib64/libcamera_mianode_jni.xiaomi.so)
[ "$2" = "" ] && return 0
grep -q "libgui_shim_miuicamera.so" "${2}" || "${PATCHELF}" --add-needed "libgui_shim_miuicamera.so" "${2}"
;;
system/lib64/libmicampostproc_client.so)
[ "$2" = "" ] && return 0
"${PATCHELF}" --remove-needed "libhidltransport.so" "${2}"
;;
*)
return 1
;;
esac
return 0
}
if [ -z "$SRC" ]; then
echo "Path to system dump not specified! Specify one with --path"
exit 1
fi
function blob_fixup_dry() {
blob_fixup "$1" ""
}
# Initialize the helper
setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" false "${CLEAN_VENDOR}"

View File

@ -22,10 +22,6 @@ PRODUCT_DEXPREOPT_SPEED_APPS += \
PRODUCT_COPY_FILES += \
vendor/xiaomi/sweet-miuicamera/configs/permissions/privapp-permissions-miuicamera.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/permissions/privapp-permissions-miuicamera.xml
# Shims
PRODUCT_PACKAGES += \
libgui_shim_miuicamera
# Sysconfig
PRODUCT_COPY_FILES += \
vendor/xiaomi/sweet-miuicamera/configs/sysconfig/miuicamera-hiddenapi-package-whitelist.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/sysconfig/miuicamera-hiddenapi-package-whitelist.xml

View File

@ -1,9 +1,7 @@
# These proprietary files are extracted from Redmi Note 10 Pro (codenamed `sweet`) MIUI V14.0.9.0.TKFMIXM, unless pinned
-product/priv-app/MiuiCamera/MiuiCamera.apk:system/priv-app/MiuiCamera/MiuiCamera.apk;OVERRIDES=Aperture,Snap,Camera2,GoogleCameraGo|0a5f5e9c5158ade7d23bd1501dde4228191b1f30
-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
-vendor/lib64/libarcdualcamsat.so
-vendor/lib64/libarcsat.so
product/priv-app/MiuiCamera/MiuiCamera.apk:system/priv-app/MiuiCamera/MiuiCamera.apk;OVERRIDES=Aperture,Snap,Camera2,GoogleCameraGo
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

View File

@ -12,4 +12,6 @@ allow miuicamera_app {
mediaserver_service
}:service_manager find;
allow miuicamera_app proc_stat:file r_file_perms;
dontaudit miuicamera_app radio_service:service_manager find;

View File

@ -1,8 +1,7 @@
#!/bin/bash
#
# Copyright (C) 2016 The CyanogenMod Project
# Copyright (C) 2017-2020 The LineageOS Project
#
# SPDX-FileCopyrightText: 2016 The CyanogenMod Project
# SPDX-FileCopyrightText: 2017-2024 The LineageOS Project
# SPDX-License-Identifier: Apache-2.0
#
@ -17,6 +16,8 @@ if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi
ANDROID_ROOT="${MY_DIR}/../../.."
export TARGET_ENABLE_CHECKELF=true
HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh"
if [ ! -f "${HELPER}" ]; then
echo "Unable to find helper script at ${HELPER}"