Compare commits

...

4 Commits

Author SHA1 Message Date
90fb7b9799 camera: Use device path instead of vendor 2026-03-09 16:23:42 +00:00
450963c2c1 camera: Remove missing files 2026-03-09 16:21:14 +00:00
4518acbf26 camera: Switch to py extract utils 2026-03-09 16:01:51 +00:00
33370e86dc camera: Split Device/Vendor 2026-03-09 15:44:01 +00:00
51 changed files with 39 additions and 214 deletions

View File

@@ -1,4 +0,0 @@
# Automatically generated file. DO NOT MODIFY
#
# This file is generated by device/oplus/camera/setup-makefiles.sh

View File

@@ -4,13 +4,13 @@ Prebuilt stock oplus Camera to include in custom ROM builds.
### How to use?
1. Clone this repo to `vendor/oplus/camera`
1. Clone this repo to `device/oplus/camera`
2. Inherit it from `device.mk` in device tree:
```
# Camera
$(call inherit-product-if-exists, vendor/oplus/camera/opluscamera.mk)
$(call inherit-product-if-exists, device/oplus/camera/opluscamera.mk)
```
3. Ensure that the PRODUCT_BRAND is either oneplus or oppo or realme and that it is not overriden by any of the safetynet hacks.

View File

@@ -1,51 +0,0 @@
# Automatically generated file. DO NOT MODIFY
#
# This file is generated by device/oplus/camera/setup-makefiles.sh
PRODUCT_SOONG_NAMESPACES += \
vendor/oplus/camera
PRODUCT_COPY_FILES += \
vendor/oplus/camera/proprietary/system_ext/etc/default-permissions/oplus_camera_default_grant_permissions_list.xml:$(TARGET_COPY_OUT_SYSTEM_EXT)/etc/default-permissions/oplus_camera_default_grant_permissions_list.xml
PRODUCT_PACKAGES += \
libpenguin \
libAPSClient-cmd-jni \
libAPSClient-jni \
libAncFilter_jni \
libAncHumBokeh-jni \
libAncHumanDoubleExposure-jni \
libAncHumanRetain-jni_v2 \
libAncHumanSegFigureFusion-jni \
libAncHumanVideo-jni \
libApsFaceBeautyPreviewProductJni \
libAvatarEngineRender \
libAvatarEngineRenderNative \
libCombineLut \
libCombineLutJni \
libFileExtender-jni \
libHeifEncoderWrapper \
libNativeWinBuffExchange \
libOplusBlurPreviewJNI \
libSuperTextWrapper_system_ext \
libXDocProcessSDK-jni \
libXDocProcessSDK_system_ext \
libYTCommon_system_ext \
libarcsoft_wideselfie \
libcolorx-loader \
libcolorx \
libcoolex \
libextendfile_system_ext \
libjni_wideselfie \
libjnisingleblur_api \
libjnistblur_api \
libmpbase_system_ext \
liboplusheifwriter \
libsingle_camera_bokeh_native \
libst_mobile \
libst_sticker_jni \
OplusAppPlatform \
OplusCamera \
oplus-support-wrapper \
com.oplus.camera.unit.sdk.adapter \
com.oplus.camera.unit.sdk

32
extract-files.py Executable file
View File

@@ -0,0 +1,32 @@
#!/usr/bin/env -S PYTHONPATH=../../../tools/extract-utils python3
#
# SPDX-FileCopyrightText: 2024 The LineageOS Project
# SPDX-License-Identifier: Apache-2.0
#
from extract_utils.fixups_blob import (
blob_fixup,
blob_fixups_user_type,
)
from extract_utils.fixups_lib import (
lib_fixup_remove,
lib_fixups,
lib_fixups_user_type,
)
from extract_utils.main import (
ExtractUtils,
ExtractUtilsModule,
)
namespace_imports = [
'hardware/oplus',
]
module = ExtractUtilsModule(
'camera',
'oplus',
namespace_imports=namespace_imports,
)
if __name__ == '__main__':
utils = ExtractUtils.device(module)
utils.run()

View File

@@ -1,61 +0,0 @@
#!/bin/bash
#
# SPDX-FileCopyrightText: 2016 The CyanogenMod Project
# SPDX-FileCopyrightText: 2017-2024 The LineageOS Project
# SPDX-License-Identifier: Apache-2.0
#
set -e
DEVICE=camera
VENDOR=oplus
# 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
# 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"

View File

@@ -29,7 +29,7 @@ $(call soong_config_set,camera,package_name,com.oplus.packageName)
$(call soong_config_set,camera,override_format_from_reserved,true)
# SEpolicy
include vendor/oplus/camera/sepolicy/SEPolicy.mk
include device/oplus/camera/sepolicy/SEPolicy.mk
# Inherit from camera-vendor.mk
$(call inherit-product, vendor/oplus/camera/camera-vendor.mk)

View File

@@ -24,9 +24,6 @@ my_product/lib64/libXDocProcessSDK-jni.so:system_ext/lib64/libXDocProcessSDK-jni
my_product/lib64/libXDocProcessSDK.so:system_ext/lib64/libXDocProcessSDK.so;MODULE_SUFFIX=_system_ext
my_product/lib64/libYTCommon.so:system_ext/lib64/libYTCommon.so;MODULE_SUFFIX=_system_ext
my_product/lib64/libarcsoft_wideselfie.so:system_ext/lib64/libarcsoft_wideselfie.so
my_product/lib64/libcolorx-loader.so:system_ext/lib64/libcolorx-loader.so
my_product/lib64/libcolorx.so:system_ext/lib64/libcolorx.so
my_product/lib64/libcoolex.so:system_ext/lib64/libcoolex.so
my_product/lib64/libextendfile.so:system_ext/lib64/libextendfile.so;MODULE_SUFFIX=system_ext
my_product/lib64/libjni_wideselfie.so:system_ext/lib64/libjni_wideselfie.so
my_product/lib64/libjnisingleblur_api.so:system_ext/lib64/libjnisingleblur_api.so;FIX_SONAME
@@ -38,7 +35,6 @@ my_product/lib64/libst_sticker_jni.so:system_ext/lib64/libst_sticker_jni.so;FIX_
my_product/product_overlay/etc/permissions/oplus_camera_default_grant_permissions_list.xml:system_ext/etc/default-permissions/oplus_camera_default_grant_permissions_list.xml
my_product/product_overlay/framework/com.oplus.camera.unit.sdk.adapter.jar:system_ext/framework/com.oplus.camera.unit.sdk.adapter.jar
my_product/product_overlay/framework/com.oplus.camera.unit.sdk.jar:system_ext/framework/com.oplus.camera.unit.sdk.jar
system/framework/oplus-support-wrapper.jar
system_ext/lib64/libpenguin.so:vendor/lib64/libpenguin.so
system_ext/lib64/libHeifEncoderWrapper.so
system_ext/lib64/libNativeWinBuffExchange.so

View File

@@ -1,23 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
********************************************************************************
** Copyright (C) 2018-2021 Oplus. All rights reserved.
** All rights reserved.
**
** File: - privapp-permission-oplus.xml
** Description:
** Customization of Android default_grant_permissions_list.xml
**
** Version: 1.0
** Date: 2021-08-26
********************************************************************************/
-->
<packages>
<default-grant-permissions package="com.oplus.camera" >
<permission name="android.permission.CAMERA"/>
<permission name="android.permission.RECORD_AUDIO"/>
<permission name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<permission name="android.permission.READ_EXTERNAL_STORAGE"/>
<permission name="android.permission.READ_PHONE_STATE"/>
</default-grant-permissions>
</packages>

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:74c839698f8095386b016f3b9e6762ae42d51417cbf03262489dac2d463d807c
size 3307752

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7b9c86eab1276809c2661add2cf860e23bed1dc42f1333d95118578ad7985b12
size 124061322

Binary file not shown.

View File

@@ -5,10 +5,10 @@
#
BOARD_VENDOR_SEPOLICY_DIRS += \
vendor/oplus/camera/sepolicy/vendor
${LOCAL_PATH}/sepolicy/vendor
SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS += \
vendor/oplus/camera/sepolicy/private
${LOCAL_PATH}/sepolicy/private
SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS += \
vendor/oplus/camera/sepolicy/public
${LOCAL_PATH}/sepolicy/public

1
setup-makefiles.py Executable file
View File

@@ -0,0 +1 @@
#!./extract-files.py --regenerate_makefiles

View File

@@ -1,59 +0,0 @@
#!/bin/bash
#
# SPDX-FileCopyrightText: 2016 The CyanogenMod Project
# SPDX-FileCopyrightText: 2017-2024 The LineageOS Project
# SPDX-License-Identifier: Apache-2.0
#
set -e
DEVICE=camera
VENDOR=oplus
# 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}"
function lib_to_package_fixup_system_ext_variants() {
if [ "$2" != "system_ext" ]; then
return 1
fi
case "$1" in
libSuperTextWrapper | \
libXDocProcessSDK | \
libYTCommon | \
libmpbase)
echo "$1_system_ext"
;;
*)
return 1
;;
esac
}
function lib_to_package_fixup() {
lib_to_package_fixup_clang_rt_ubsan_standalone "$1" ||
lib_to_package_fixup_proto_3_9_1 "$1" ||
lib_to_package_fixup_system_ext_variants "$@"
}
# Initialize the helper
setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}"
# Warning headers and guards
write_headers
write_makefiles "${MY_DIR}/proprietary-files.txt"
# Finish
write_footers