Initial commit

This commit is contained in:
Matthias Leitl
2021-02-26 14:06:07 +01:00
parent 72f9c92bfb
commit 56181bf3e5
126 changed files with 3656 additions and 0 deletions

12
Android.mk Normal file
View File

@@ -0,0 +1,12 @@
#
# Copyright (C) 2020 The LineageOS Project
#
# SPDX-License-Identifier: Apache-2.0
#
LOCAL_PATH := $(call my-dir)
ifneq ($(filter Atom_L Atom_XL ,$(TARGET_DEVICE)),)
subdir_makefiles=$(call first-makefiles-under,$(LOCAL_PATH))
$(foreach mk,$(subdir_makefiles),$(info including $(mk) ...)$(eval include $(mk)))
endif

116
BoardConfigCommon.mk Normal file
View File

@@ -0,0 +1,116 @@
# Copyright (C) 2020 The LineageOS Project
#
# SPDX-License-Identifier: Apache-2.0
#
COMMON_DEVICE_PATH := device/Unihertz/Atom_LXL
# Architecture
TARGET_ARCH := arm64
TARGET_ARCH_VARIANT := armv8-a
TARGET_CPU_ABI := arm64-v8a
TARGET_CPU_ABI2 :=
TARGET_CPU_VARIANT := generic
TARGET_2ND_ARCH := arm
TARGET_2ND_ARCH_VARIANT := armv8-a
TARGET_2ND_CPU_ABI := armeabi-v7a
TARGET_2ND_CPU_ABI2 := armeabi
TARGET_2ND_CPU_VARIANT := generic
TARGET_USES_64_BIT_BINDER := true
# Avb
BOARD_AVB_ENABLE := true
BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS += --set_hashtree_disabled_flag
BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS += --flags 2
# Audio
USE_XML_AUDIO_POLICY_CONF := 1
USE_CUSTOM_AUDIO_POLICY := 1
# Bluetooth
BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := $(DEVICE_PATH)/bluetooth/include
# Bootloader
TARGET_BOARD_PLATFORM := mt6771
TARGET_BOOTLOADER_BOARD_NAME := mt6771
TARGET_NO_BOOTLOADER := true
# These two are for MTK Chipsets only
BOARD_USES_MTK_HARDWARE := true
BOARD_HAS_MTK_HARDWARE := true
# Kernel
BOARD_KERNEL_CMDLINE := bootopt=64S3,32N2,64N2 buildvariant=$(TARGET_BUILD_VARIANT) androidboot.selinux=enforcing
BOARD_KERNEL_BASE := 0x40078000
BOARD_KERNEL_PAGESIZE := 2048
BOARD_KERNEL_OFFSET := 0x00008000
BOARD_RAMDISK_OFFSET := 0x14f88000
BOARD_KERNEL_SECOND_OFFSET := 0x00e88000
BOARD_DTB_OFFSET := 0x13f88000
BOARD_BOOT_HEADER_VERSION := 2
BOARD_KERNEL_TAGS_OFFSET := 0x13f88000
BOARD_KERNEL_IMAGE_NAME := Image.gz
TARGET_PREBUILT_KERNEL := $(DEVICE_PATH)/prebuilt/Image.gz
BOARD_PREBUILT_DTBOIMAGE := $(DEVICE_PATH)/prebuilt/dtbo.img
BOARD_PREBUILT_DTBIMAGE_DIR := $(DEVICE_PATH)/prebuilt/dtb
BOARD_INCLUDE_DTB_IN_BOOTIMG := true
BOARD_MKBOOTIMG_ARGS += --base $(BOARD_KERNEL_BASE)
BOARD_MKBOOTIMG_ARGS += --pagesize $(BOARD_KERNEL_PAGESIZE)
BOARD_MKBOOTIMG_ARGS += --ramdisk_offset $(BOARD_RAMDISK_OFFSET)
BOARD_MKBOOTIMG_ARGS += --tags_offset $(BOARD_KERNEL_TAGS_OFFSET)
BOARD_MKBOOTIMG_ARGS += --kernel_offset $(BOARD_KERNEL_OFFSET)
BOARD_MKBOOTIMG_ARGS += --second_offset $(BOARD_KERNEL_SECOND_OFFSET)
BOARD_MKBOOTIMG_ARGS += --dtb_offset $(BOARD_DTB_OFFSET)
BOARD_MKBOOTIMG_ARGS += --header_version $(BOARD_BOOT_HEADER_VERSION)
# Partitions
BOARD_FLASH_BLOCK_SIZE := 131072
BOARD_BOOTIMAGE_PARTITION_SIZE := 33554432
BOARD_RECOVERYIMAGE_PARTITION_SIZE := 33554432
BOARD_DTBOIMG_PARTITION_SIZE := 8388608
BOARD_CACHEIMAGE_PARTITION_SIZE := 452984832
BOARD_USERDATAIMAGE_PARTITION_SIZE := 121978716160
BOARD_SYSTEMIMAGE_PARTITION_RESERVED_SIZE := 536870912
BOARD_PRODUCTIMAGE_PARTITION_RESERVED_SIZE := 536870912
BOARD_SUPER_PARTITION_SIZE := 4831838208
BOARD_SUPER_PARTITION_GROUPS := main
BOARD_MAIN_SIZE := 4829741056
BOARD_MAIN_PARTITION_LIST := \
system \
product
# Non-SAR on Android 10 means the presence of stage-1 ramdisk
BOARD_BUILD_SYSTEM_ROOT_IMAGE := false
BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE := ext4
BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4
TARGET_COPY_OUT_VENDOR := vendor
TARGET_COPY_OUT_PRODUCT := product
BUILD_WITHOUT_VENDOR := true
BOARD_ROOT_EXTRA_FOLDERS += metadata
# Recovery
BOARD_INCLUDE_RECOVERY_DTBO := true
BOARD_USES_RECOVERY_AS_BOOT := false
TARGET_NO_RECOVERY := false
TARGET_RECOVERY_FSTAB := $(COMMON_DEVICE_PATH)/rootdir/etc/fstab.mt6771
TARGET_RECOVERY_PIXEL_FORMAT := "BGRA_8888"
TARGET_USERIMAGES_USE_EXT4 := true
TARGET_USES_MKE2FS := true
# Sepolicy
TARGET_USES_PREBUILT_VENDOR_SEPOLICY := true
TARGET_HAS_FUSEBLK_SEPOLICY_ON_VENDOR := true
BOARD_PLAT_PRIVATE_SEPOLICY_DIR := $(DEVICE_PATH)/sepolicy/private
BOARD_PLAT_PUBLIC_SEPOLICY_DIR := $(COMMON_DEVICE_PATH)/sepolicy/public
BOARD_VENDOR_SEPOLICY_DIRS += $(COMMON_DEVICE_PATH)/sepolicy/vendor
# Treble
BOARD_VNDK_VERSION := current
# Properties
TARGET_PRODUCT_PROP += $(COMMON_DEVICE_PATH)/product.prop
# We need this for apns-conf
# We would like to override instead of merge
BUILD_BROKEN_DUP_RULES := true

18
ImsInit/Android.mk Normal file
View File

@@ -0,0 +1,18 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_PACKAGE_NAME := ImsInit
LOCAL_PRIVATE_PLATFORM_APIS := true
LOCAL_CERTIFICATE := platform
LOCAL_PRIVILEGED_MODULE := true
LOCAL_VENDOR_MODULE := false
LOCAL_USE_AAPT2 := true
LOCAL_JAVA_LIBRARIES := \
ims-common
include $(BUILD_PACKAGE)

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.lineageos.unihertz.imsinit"
android:versionCode="1"
android:versionName="1.0"
android:sharedUserId="android.uid.phone">
<application
android:persistent="true">
<receiver android:name="org.lineageos.unihertz.imsinit.BootCompletedReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
<service android:name="org.lineageos.unihertz.imsinit.PhoneStateService"/>
</application>
</manifest>

View File

@@ -0,0 +1,33 @@
package org.lineageos.unihertz.imsinit;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.util.Log;
import com.android.ims.ImsManager;
/*
* WARNING: DIRTY HACK AHEAD
* I have no idea why MTK's IMS does not work after a reboot on
* SELinux enforcing. I have literally tried to put every service
* with denial messages to permissive and the bug was still present.
* But a global permissive environment fixes that magically.
* Re-enabling Enhanced 4G manually also fixes the issue.
* This is a dirty hack to toggle IMS off and back on again
* on every boot other than the first boot. I figured this is
* at least better than having to put the entire system on permissive.
* But it is very dirty and can't be guaranteed to work.
* We still need to figure out at some point why this happens.
*/
public class BootCompletedReceiver extends BroadcastReceiver {
private static final String LOG_TAG = "ImsInit";
@Override
public void onReceive(final Context context, Intent intent) {
Log.i(LOG_TAG, "onBoot");
context.startService(new Intent(context, PhoneStateService.class));
}
}

View File

@@ -0,0 +1,76 @@
package org.lineageos.unihertz.imsinit;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.IBinder;
import android.telephony.PhoneStateListener;
import android.telephony.ServiceState;
import android.telephony.TelephonyManager;
import android.util.Log;
import com.android.ims.ImsManager;
public class PhoneStateService extends Service {
private static final String LOG_TAG = "ImsInit";
private static ServiceState sLastState = null;
private void handleServiceStateChanged(ServiceState serviceState) {
Log.i(LOG_TAG, "handleServiceStateChanged");
if ((sLastState == null || sLastState.getDataRegState() != ServiceState.STATE_IN_SERVICE)
&& serviceState.getDataRegState() == ServiceState.STATE_IN_SERVICE) {
SharedPreferences prefs = getSharedPreferences("prefs", Context.MODE_PRIVATE);
if (prefs.getBoolean("first_time", true)) {
Log.i(LOG_TAG, "Skipping first boot");
prefs.edit().putBoolean("first_time", false).commit();
return;
}
if (ImsManager.isEnhanced4gLteModeSettingEnabledByUser(this)) {
Log.i(LOG_TAG, "VoLTE enabled, trying to toggle it off and back on");
ImsManager.setEnhanced4gLteModeSetting(this, false);
new Thread(() -> {
try {
Thread.sleep(1000);
} catch (Exception e) {
// Ignore
}
ImsManager.setEnhanced4gLteModeSetting(this, true);
}).start();
}
}
sLastState = serviceState;
}
@Override
public void onCreate() {
}
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
TelephonyManager tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
// Handle latest state at start
handleServiceStateChanged(tm.getServiceState());
tm.listen(new PhoneStateListener() {
@Override
public void onServiceStateChanged(ServiceState serviceState) {
handleServiceStateChanged(serviceState);
}
}, PhoneStateListener.LISTEN_SERVICE_STATE);
return START_STICKY;
}
@Override
public IBinder onBind(Intent intent) {
return null;
}
@Override
public void onDestroy() {
}
}

25
README.md Normal file
View File

@@ -0,0 +1,25 @@
Common device configuration for the Unihertz Atom L and XL
=================================================
This Common device tree is intended for the usage in a LineageOS or similar building environment.
The Unihertz Atom L (codenamed simply _"Atom_L"_) and the Atom XL (codenamed simply _"Atom_XL"_) are two rugged small smartphones from Unihertz, released in July 2020. They are both almost identical only the Atom XL offers an integrated amateur radio.
## Releases
For the actual releases head on over to the device tree of the individual devices:
- [Atom L Releases](https://github.com/ADeadTrousers/android_device_Unihertz_Atom_L/releases)
- [Atom XL Releases](https://github.com/ADeadTrousers/android_device_Unihertz_Atom_XL/releases)
## Documentations
- [HOW-TO-BUILD.md](docs/HOW-TO-BUILD.md) - Building instructions for LineageOS 17.1.
- [HOW-TO-INSTALL.md](docs/HOW-TO-INSTALL.md) - Installation instructions for the Atom L/XL.
- [HOW-TO-UPDATE.md](docs/HOW-TO-UPDATE.md) - Update instructions for the Atom L/XL.
- [HOW-TO-EXTRACT_FILES.md](docs/HOW-TO-EXTRACT_FILES.md) - Instructions to extract files directly from the Atom L/XL stock rom files.
- [HOW-TO-EXTRACT_SEPOLICY.md](docs/HOW-TO-EXTRACT_SEPOLICY.md) - A little guide to extract sepolicy rules from stock or phone.
- [HOW-TO-FLASH-STOCK.md](docs/HOW-TO-FLASH-STOCK.md) - Instructions on how to use the SP Flash Tool for MTK based devices.
- [HOW-TO-FLASH-SUPER.md](docs/HOW-TO-FLASH-SUPER.md) - Instructions on how to modify super.img and flashing it onto the device.
## Special Thanks To
- [PeterCxy from the XDA forum](https://forum.xda-developers.com/member.php?u=5351691) for helping me and providing the initial device tree for Atom L.

154
deviceCommon.mk Normal file
View File

@@ -0,0 +1,154 @@
# Copyright (C) 2020 The LineageOS Project
#
# SPDX-License-Identifier: Apache-2.0
#
COMMON_DEVICE_PATH := device/Unihertz/Atom_LXL
#Include GAPPS if applicable
-include $(COMMON_DEVICE_PATH)/gapps_prop.mk
$(call inherit-product, $(SRC_TARGET_DIR)/product/gsi_keys.mk)
# Enable updating of APEXes
$(call inherit-product, $(SRC_TARGET_DIR)/product/updatable_apex.mk)
# Define Dynamic Partition support
PRODUCT_TARGET_VNDK_VERSION := 29
PRODUCT_SHIPPING_API_LEVEL := 29
PRODUCT_USE_DYNAMIC_PARTITIONS := true
PRODUCT_BUILD_SUPER_PARTITION := false
PRODUCT_BUILD_PRODUCT_IMAGE := true
# Properties
PRODUCT_COMPATIBLE_PROPERTY_OVERRIDE := true
# A/B
AB_OTA_UPDATER := false
# Audio
PRODUCT_PACKAGES += \
audio.a2dp.default \
libaacwrapper
# Camera
PRODUCT_PACKAGES += \
Snap
# FMRadio
PRODUCT_PACKAGES += \
FMRadio \
libfmcust
# fastbootd
PRODUCT_PACKAGES += \
fastbootd
# fstab
PRODUCT_COPY_FILES += \
$(COMMON_DEVICE_PATH)/rootdir/etc/fstab.mt6771:$(TARGET_COPY_OUT_RAMDISK)/fstab.mt6771
# NFC stack (AOSP)
PRODUCT_PACKAGES += \
NfcNci
# ImsInit hack
PRODUCT_PACKAGES += \
ImsInit
# Init
PRODUCT_PACKAGES += \
init.mt6771.rc \
fstab.mt6771
# Magisk
PRODUCT_PACKAGES += \
MagiskManager
PRODUCT_COPY_FILES += \
frameworks/av/services/audiopolicy/config/audio_policy_configuration.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/audio_policy_configuration.xml \
frameworks/av/services/audiopolicy/config/audio_policy_configuration_bluetooth_legacy_hal.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/audio_policy_configuration_bluetooth_legacy_hal.xml \
frameworks/av/services/audiopolicy/config/audio_policy_volumes.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/audio_policy_volumes.xml \
frameworks/av/services/audiopolicy/config/a2dp_audio_policy_configuration.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/a2dp_audio_policy_configuration.xml \
frameworks/av/services/audiopolicy/config/audio_policy_configuration_stub.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/audio_policy_configuration_stub.xml \
frameworks/av/services/audiopolicy/config/bluetooth_audio_policy_configuration.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/bluetooth_audio_policy_configuration.xml \
frameworks/av/services/audiopolicy/config/usb_audio_policy_configuration.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/usb_audio_policy_configuration.xml \
frameworks/av/services/audiopolicy/config/hearing_aid_audio_policy_configuration.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/hearing_aid_audio_policy_configuration.xml \
frameworks/av/services/audiopolicy/config/r_submix_audio_policy_configuration.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/r_submix_audio_policy_configuration.xml \
frameworks/av/services/audiopolicy/config/default_volume_tables.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/default_volume_tables.xml
PRODUCT_PACKAGES += \
libGLES_android \
libaudioprocessing \
libaudioflinger \
libaudio-resampler \
libcameraservice \
libsuspend \
libstatssocket \
libsparse \
libdrm \
libpcap \
libprotobuf-cpp-full \
libbrotli \
libext2_blkid \
libext2_com_err \
libext2_e2p \
libext2_profile \
libext2_uuid \
libext2fs \
libmetricslogger \
com.android.nfc_extras \
android.frameworks.sensorservice@1.0 \
android.hardware.audio.common-util \
android.hardware.audio.common@2.0-util \
android.hardware.audio.common@4.0 \
android.hardware.audio.common@4.0-util \
android.hardware.audio.common@5.0-util \
android.hardware.audio.effect@2.0 \
android.hardware.audio.effect@4.0 \
android.hardware.audio.effect@5.0 \
android.hardware.audio@2.0 \
android.hardware.audio@4.0 \
android.hardware.audio@5.0 \
android.hardware.biometrics.fingerprint@2.1 \
android.hardware.health@1.0 \
android.hardware.health@2.0 \
android.hardware.nfc@1.0 \
android.hardware.nfc@1.1 \
android.hardware.nfc@1.2 \
android.hardware.thermal@1.0 \
android.hardware.radio@1.1 \
android.hardware.radio@1.2 \
android.hardware.radio@1.3 \
android.hardware.radio@1.4 \
android.hardware.vibrator@1.0 \
android.hardware.vibrator@1.3
# Keylayouts
PRODUCT_COPY_FILES += \
$(COMMON_DEVICE_PATH)/idc/mtk-kpd.idc:$(TARGET_COPY_OUT_SYSTEM)/usr/idc/mtk-kpd.idc \
$(COMMON_DEVICE_PATH)/keylayout/mtk-kpd.kl:$(TARGET_COPY_OUT_SYSTEM)/usr/keylayout/mtk-kpd.kl \
$(COMMON_DEVICE_PATH)/keylayout/mtk-tpd-kpd.kl:$(TARGET_COPY_OUT_SYSTEM)/usr/keylayout/mtk-tpd-kpd.kl \
$(COMMON_DEVICE_PATH)/keylayout/fingerprint_key.kl:$(TARGET_COPY_OUT_SYSTEM)/usr/keylayout/fingerprint_key.kl
# Overlays
DEVICE_PACKAGE_OVERLAYS += \
$(COMMON_DEVICE_PATH)/overlay \
$(COMMON_DEVICE_PATH)/overlay-lineage
# Overlays -- replace official
PRODUCT_PACKAGES += \
FrameworkResOverlay
# Telephony Jars
PRODUCT_BOOT_JARS += \
mediatek-common \
mediatek-framework \
mediatek-ims-base \
mediatek-ims-common \
mediatek-telecom-common \
mediatek-telephony-base \
mediatek-telephony-common
#Include GAPPS if applicable
$(call inherit-product-if-exists, vendor/opengapps/build/opengapps-packages.mk)

267
docs/HOW-TO-BUILD.md Normal file
View File

@@ -0,0 +1,267 @@
How to build LineageOS 17.1 for the Unihertz Atom L and XL
=================================================
This guide is focused on building the ROM under a Linux host environment.
## Setting up the build environment
In general follow one of the many build instructions found at the LineageOS wiki.
For example the instructions for the [Google Nexus 5 aka hammerhead](https://wiki.lineageos.org/devices/hammerhead/build).
Here is a short summing up.
### Install the build packages
To successfully build LineageOS, youll need
```bash
sudo apt-get install bc bison build-essential ccache curl flex g++-multilib gcc-multilib git gnupg gperf imagemagick lib32ncurses5-dev lib32readline-dev lib32z1-dev liblz4-tool libncurses5 libncurses5-dev libsdl1.2-dev libssl-dev libxml2 libxml2-utils lzop pngcrush rsync schedtool squashfs-tools xsltproc zip zlib1g-dev
```
For Ubuntu versions older than 16.04 (xenial), youll need
```bash
sudo apt-get install libwxgtk2.8-dev
```
For Ubuntu versions older than 20.04 (focal), youll also need
```bash
sudo apt-get install libwxgtk3.0-dev
```
### Install the platform-tools
Only if you havent previously installed adb and fastboot
```bash
wget https://dl.google.com/android/repository/platform-tools-latest-linux.zip
unzip platform-tools-latest-linux.zip -d ~
```
Update your PATH variable for your environment
```bash
gedit ~/.profile
```
Add the following
```bash
# add Android SDK platform tools to path
if [ -d "$HOME/platform-tools" ] ; then
PATH="$HOME/platform-tools:$PATH"
fi
```
Then update your environment
```bash
source ~/.profile
```
### Install the repo command
Download the binary and make it executable
```bash
mkdir -p ~/bin
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
```
Update your PATH variable for your environment
```bash
gedit ~/.profile
```
Add the following
```bash
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
```
Then update your environment
```bash
source ~/.profile
```
### (optional) Install git-lfs for GAPPS support during build
If you want to include GAPPS in the build you need [git-lfs](https://git-lfs.github.com/) otherwise the apk's can't be downloaded.
```bash
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
sudo apt-get install git-lfs
```
### Configure git
repo requires you to identify yourself to sync Android
```bash
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
```
### (optional) Turn on caching to speed up build
Update your build environment
```bash
gedit ~/.bashrc
```
Add the following
```bash
export USE_CCACHE=1
export CCACHE_EXEC=/usr/bin/ccache
export CCACHE_COMPRESS=1
```
### Initialize the LineageOS source repository
Create the project folder and download the source code
```bash
mkdir -p ~/android/lineage
cd ~/android/lineage
repo init -u https://github.com/LineageOS/android.git -b lineage-17.1
```
Now let's add this very device repo to the local_manifest
```bash
gedit cd ~/android/lineage/.repo/local_manifests/roomservice.xml
```
Add the following
```xml
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project name="ADeadTrousers/android_device_Unihertz_Atom_LXL" path="device/Unihertz/Atom_LXL" remote="github" revision="master" />
<!-- For the Atom L add -->
<project name="ADeadTrousers/android_device_Unihertz_Atom_L" path="device/Unihertz/Atom_L" remote="github" revision="master" />
<!-- For the Atom XL add -->
<project name="ADeadTrousers/android_device_Unihertz_Atom_XL" path="device/Unihertz/Atom_XL" remote="github" revision="master" />
</manifest>
```
If you want to build with GAPPS included add the following to the manifest-tag
```xml
<remote name="opengapps" fetch="https://github.com/opengapps/" />
<remote name="opengapps-gitlab" fetch="https://gitlab.opengapps.org/opengapps/" />
<project path="vendor/opengapps/build" name="aosp_build" revision="master" remote="opengapps" />
<project path="vendor/opengapps/sources/all" name="all" clone-depth="1" revision="master" remote="opengapps-gitlab" />
<!-- arm64 depends on arm -->
<project path="vendor/opengapps/sources/arm" name="arm" clone-depth="1" revision="master" remote="opengapps-gitlab" />
<project path="vendor/opengapps/sources/arm64" name="arm64" clone-depth="1" revision="master" remote="opengapps-gitlab" />
<project path="vendor/opengapps/sources/x86" name="x86" clone-depth="1" revision="master" remote="opengapps-gitlab" />
<project path="vendor/opengapps/sources/x86_64" name="x86_64" clone-depth="1" revision="master" remote="opengapps-gitlab" />
```
If you want to build with Magisk included add the following to the manifest-tag
```xml
<project name="ADeadTrousers/android_vendor_magisk" path="vendor/magisk" remote="github" revision="master" />
```
To finish everything up sync the repo
```bash
cd ~/android/lineage
repo sync --force-sync
```
If you included GAPPS you also need to sync git-lfs
```bash
cd vendor/opengapps/sources
for d in ./*/ ; do (cd "$d" && git lfs pull); done
```
## (optional) Configure GAPPS for the device
If you don't want to include GAPPS at all or want to change the apps to be installed
```bash
gedit ~/android/lineage/device/Unihertz/Atom_LXL/gapps_prop.mk
```
[Documentation of the possible settings](https://github.com/opengapps/aosp_build/blob/master/README.md)
## Extracting the vendor blobs
### Use imjtool (formerly known as imgtool) to extract from stock rom files
First follow [the instructions to extract and mount the stock rom files](HOW-TO-EXTRACT_FILES.md)
Then extract all the files we need
```bash
# For the Atom L use
~/android/lineage/device/Unihertz/Atom_L/extract-files.sh ~/unihertz/extracted
# For the Atom XL use
~/android/lineage/device/Unihertz/Atom_XL/extract-files.sh ~/unihertz/extracted
```
### Use an allready rooted device
If you were able to root your device this is just a small step. Plug in your device and do the follwing
```bash
# For the Atom L use
~/android/lineage/device/Unihertz/Atom_L/extract-files.sh
# For the Atom XL use
~/android/lineage/device/Unihertz/Atom_XL/extract-files.sh
```
## Building the rom
Prepare the build
```bash
cd ~/android/lineage
source build/envsetup.sh
# For the Atom L use
breakfast Atom_L
# For the Atom XL use
breakfast Atom_XL
```
Do the actual build
```bash
cd ~/android/lineage
ccache -M 50G
croot
# For the Atom L use
brunch Atom_L
# For the Atom XL use
brunch Atom_XL
```
## Updating the sorces (at a later time)
Make sure everything is up-to-date
```bash
cd ~/android/lineage
repo sync --force-sync
```
If you changed the settings of TWRP and GAPPS sadly you need to redo them now.
Also don't forget to sync git-lfs if you included GAPPS
```bash
cd vendor/opengapps/sources
for d in ./*/ ; do (cd "$d" && git lfs pull); done
```

View File

@@ -0,0 +1,70 @@
How to extract informations from the Unihertz Atom L and XL
=================================================
### How-To to extract boot.img and recovery.img
Make sure unpack_bootimg is build
```bash
cd ~/android/lineage
source build/envsetup.sh
# For the Atom L use
breakfast Atom_L
# For the atom XL use
breakfast Atom_XL
make unpack_bootimg
```
unpack_bootimg will be built in
~/android/lineage/out/host/linux-x86/bin/unpack_bootimg
Use it to extract all required infos from boot.img and recovery.img of the stock rom
```bash
~/android/lineage/out/host/linux-x86/bin/unpack_bootimg --boot_img boot.img --out boot
~/android/lineage/out/host/linux-x86/bin/unpack_bootimg --boot_img recovery.img --out recovery
```
You will get all informations required for BoardConfig.mk and a kernel, a dtb and a dtbo file (only from recovery).
### How to extract files directly from the stock rom
At first you need to download and install imjtool (formerly known as imgtool)
```bash
mkdir -p ~/bin
wget http://newandroidbook.com/tools/imjtool.tgz
tar -xzf imjtool.tgz -C ~/bin
```
Then download the latest ROM from [Unihertz' Google Drive](https://drive.google.com/drive/folders/0By1nhWOmuw2KdDhTUlFOZHpXQjg?sort=13&direction=a). Because these archives are different from release to release I cannot tell you exactly where to find them and how the are structured. You just need to extract the file **super.img** and put it into a folder where you could easily find it. For this example I put it into **~/unihertz**.
Now we need to extract the different images from the super.img
```bash
cd ~/unihertz
rm -rf extracted/
imjtool super.img extract
imjtool extracted/image.img extract
```
Next we need to mount them into the filesystem
```bash
cd ~/unihertz/extracted
mkdir -p system/
sudo mount -o loop system.img system/
sudo mount -o loop vendor.img system/vendor/
sudo mount -o loop product.img system/product
```
Now you can browse your phones filesystem and extract everything you need
To cleanup just unmout the images
```bash
sudo umount ~/unihertz/extracted/system/product
sudo umount ~/unihertz/extracted/system/vendor
sudo umount ~/unihertz/extracted/system
```

View File

@@ -0,0 +1,75 @@
How to extract sepolicies from the Unihertz Atom L and XL
=================================================
### Why would you even do that?
At first a little bit of warning:
I'm not sure if this is the right approach to get everything selinux-wise in order but at least at the time of me writing these lines it gave me a pretty good look into the depths of the system and how everything interconnects.
### Where do I get the stock files from?
First follow [the instructions to extract and mount the stock rom files](HOW-TO-EXTRACT_FILES.md).
The sepolicies are stored in two folders inside the extracted strock rom: `system/etc/sepolicy` and `system/vendor/etc/sepolicies`.
### These files look okay to me. Why can't I directly use them?
The files are in a combined and somewhat precompiled state.
Therefore one is forced to extract the parts needed and then convert it into a format that it can be reintegrated as a type enforcement (.te-file) into another build.
### But... But these files are HUGE! How do I make sure that I find everything that I need?
That's why I created a little python script to help with this tedious task.
You can find `extract_sepolicy.py`, `extract_sepolicy_plat.py` and `extract_sepolicy_vend.py` in my lineage repository in the folder `tools`.
### At first you had my curiosity. Now you have my attention. What else do I need?
First create a folder named `sepolicy` where you can find it easily.
Copy the files `extract_sepolicy.py`, `extract_sepolicy_plat.py` and `extract_sepolicy_vend.py` into this folder.
Next create another folder named `stock` inside this folder.
After that copy all files with the extension `cil` or without a file extension at all from the folders `system/etc/sepolicy` and `system/vendor/etc/sepolicies` of the extracted strock rom into the folder `stock`.
You should have the following files now:
- `plat_file_contexts`
- `plat_hwservice_contexts`
- `plat_property_contexts`
- `plat_pub_versioned.cil`
- `plat_sepolicy.cil`
- `plat_service_contexts`
- `vendor_file_contexts`
- `vendor_hwservice_contexts`
- `vendor_property_contexts`
- `vendor_sepolicy.cil`
- `vndservice_contexts`
Now you are good to go.
### But how ... ?
Glad you asked.
You need to find out what parts of the stock rom policies your device really needs.
This is best achieved by running `adb -d logcat > logcat.txt` while you use the phone or reproducing some errors that should not happen.
Next look out for lines containing `avc: denied` in the logcat file.
In those lines you will also find a `scontext` which is the thing we are looking for.
Inbetween `u:r:` and `:s0` you will find the name of the program (or better say context) that's denied access to a ressource.
Now run `python extract_sepolicy_plat.py <context_from_logcat>` an you get a file named `<context_from_logcat>.te` which includes everything there is in the stock rom regarding this context.
Normally the vendor sepolicy should not be tempered with but you can use `python extract_sepolicy_vend.py <context_from_logcat>` to get the type enforcing informations from the vendor partition.
### So I just need to include this file in my device tree and I'm goot to go?
Not so fast my dear friend.
You still need to split the file and put the individual parts into the right files of the sepolicy folder in your device tree:
- `##### ATTRIBUTES #####` goes into the file `attributes`.
- `##### FILES #####` goes into the file `file_contexts`.
- `##### PROPERTIES #####` goes into the file `property_contexts`.
- `##### SERIVCES #####` goes into the file `service_contexts`.
- `##### HWSERVICES #####` goes into the file `hwservice_contexts`.
- `##### GENFS #####` goes into the file `genfs_contexts`.
- `##### POLICIES #####` goes into a file with the extension `te` (It's on you to decide how you want to manage these files).
- `##### REMAINING #####` should not be there except somethin is found, that could not be extracted in one of the other sections.
- `##### FOREIGNS #####` only shows others contexts that point to the current context and can be ignored for now.
### Why so complicated? Why didn't you use one of the many apps to log avc:denied and then create the proper rules?
Honestly then I wouldn't have learned a thing from it.
Also these tools that you mentioned often need more than one go to find everything needed and also do a little bit too much.
Not every denial should be fixed.

View File

@@ -0,0 +1,40 @@
How to use the SP Flash Tool for MTK based devices.
=================================================
Let's say you don't want to use this awesome LineageOS ROM anymore or you just want to experince once more the bloated feeling of having so many apps you don't really use. Say no more.
In this guide I'll use Windows cause honestly that's the only way I know of and all other guides use it too but are not up-to-date.
## Installing the MTK USB Drivers
1. Download the [latest MTK USB Drivers](https://mtkusballdriver.com/). As of me writing this the latest version was v1.0.8.
2. Extracting the downloaded zip you should find an executable which you need to run.
3. Don't get startled because the installer is in chineese but it behaves like every other installer. Just click on the button that's normally entitled "Next" until the installer is finished.
4. What it does is simply extracting the real installer. By default it will create a folder on your desktop containing all necessary files.
5. Search for a folder starting with `Driver_Auto_Installer` and the highest number. As of me writing this it was `Driver_Auto_Installer_.1632`.
6. Exectue the installer inside this folder and follow the on screen instructions. Don't worry this time it's in english.
7. Maybe you need to restart and after that you are finished.
## Preparing the SP Flash Tool
1. Download the [latest SP Flash Tool](https://spflashtools.com/category/windows). As of me writing this the latest version was v5.2052.
2. Extract the downloaded zip to a folder of your choosing.
## Downloading the Stock ROM
1. Download the [latest Stock ROM](https://drive.google.com/drive/folders/1vdpRcZ2aGlpLCPVi3vh3EE6UjVZzSMq8?sort=13&direction=a).
2. Extract the downloaded zip to a folder of your choosing.
## Flashing the Stock ROM
![](images/spflash.png)
Since the time Unihertz created their [instructions to flash a ROM](https://drive.google.com/drive/folders/0By1nhWOmuw2KdDhTUlFOZHpXQjg?sort=13&direction=a) and now a lot has changed in the SP Flash Tool. Gone are all those unnecessary port scans.
1. Start `flash_tool.exe`.
2. Choose the scatter file from the directory you extracted the stock ROM into.
3. Select `Firmware Upgrade` from the dropdown menu.
4. Hit `Download`.
5. Power down your phone.
6. Connect your phone to your PC.
7. Turn on your phone.
8. The flashing should begin right away.

144
docs/HOW-TO-FLASH-SUPER.md Normal file
View File

@@ -0,0 +1,144 @@
How to modify super.img and then flash it onto the device.
=================================================
For some reason I don't know of yet the install script won't be able to change the partition size inside `super.img`.
When this happens the recovery will only schon an error 7 mentioning an "assert failure" with `dynamic_partitions_op_list`.
To overcome this problem you need to change the partiton layout manually on your computer and then flash the whole `super.img` back onto the device.
## Installing needed utilities
### Install brotli
First of you need brotli to uncompress the image files
```bash
sudo apt install brotli
```
### Install lpmake
Make sure lpmake is build
```bash
cd ~/android/lineage
source build/envsetup.sh
# For the Atom L use
breakfast Atom_L
# For the Atom XL use
breakfast Atom_XL
make lpmake
```
### Install sdat2img.py
Download sdat2img.py
```bash
mkdir -p ~/bin
cd ~/bin
wget https://raw.githubusercontent.com/xpirt/sdat2img/master/sdat2img.py
chmod 755 sdat2img.py
```
Update your PATH variable for your environment
```bash
gedit ~/.profile
```
Add the following
```bash
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
```
Then update your environment
```bash
source ~/.profile
```
## Extracting image files from stock rom files
Follow [the instructions to extract the stock rom files](HOW-TO-EXTRACT_FILES.md) to the point where you get `system.img`, `vendor.img` and `product.img`.
For this guide we only need `vendor.img` because the other two files are provided from the LineageOS rom.
Create the folder `~/super` and copy `vendor.img` into it.
## Extracting image files from LineageOS rom files
- [Atom L Releases](https://github.com/ADeadTrousers/android_device_Unihertz_Atom_L/releases)
- [Atom XL Releases](https://github.com/ADeadTrousers/android_device_Unihertz_Atom_XL/releases)
Download `lineage-17.1-XXX-UNOFFICIAL-YYY-signed.zip` from the latest release page of your device.
Extract the files from the zip archive into `~/super`.
Then we need to extract the brotli compressed files
```bash
brotli --decompress system.new.dat.br -o system.new.dat
brotli --decompress product.new.dat.br -o product.new.dat
```
Finally we need to create real ext4 image files for further useage
```bash
sdat2img.py system.transfer.list system.new.dat system.img
sdat2img.py product.transfer.list product.new.dat product.img
```
## (optional) Modifying system.new.dat and product.new.dat
If you want to now is the time to add or remove things from the installation file.
You just need to mount the images and do your worst.
## Creating super.img
First we need to get the exact sizes of all the image files
```bash
stat -c '%n %s' vendor.img
stat -c '%n %s' system.img
stat -c '%n %s' product.img
```
Alternativly you could also use the filesizes from the zip archive in `dynamic_partitions_op_list`.
Theses sizes are a bit bigger so you are able to add additional components like Gapps or Magisk later on.
With these number we are now able to create the `super.img`
```bash
~/android/lineage/out/host/linux-x86/bin/lpmake \
--metadata-size 65536 \
--super-name super \
--metadata-slots 1 \
--device super:4831838208 \
--group main:4432629760 \
--partition system:readonly:3384295424:main --image system=./system.img \
--partition vendor:readonly:349093888:main --image vendor=./vendor.img \
--partition product:readonly:699240448:main --image product=./product.img \
--sparse \
--output ./super.img
```
Beware that the numbers in this example are not universally valid. You need to adjust them to your needs.
- `-- metadata-size`: The maximum size that partition metadata may consume. A partition entry uses 64 bytes and an extent entry uses 16 bytes. I think 65536 should work in most cases.
- `-- metadata-slots`: The number of slots available for storing metadata. This should match the number of update slots on the device, 2 for A/B devices and 1 for non-A/B.
- `-- device super`: The size of the `super` partition on the device. It must match exactly, and it must be evenly divisible by the sector size (512 bytes). Best way to get this number is from the scatter file of the stock rom archive.
- `-- group main`: The sum of all partitions files sizes.
- `-- partition`: Every partition file size with permissions(readonly) and input img file.
## Flashing super.img with TWRP recovery
1. Connect your phone to your PC and open a terminal or a command line window.
2. Run `adb reboot recovery` on your PC or simply hold volume up while turning power on to boot your device into the recovery.
3. Wait for TWRP to boot.
4. Run `adb push super.img /external_sd`.
5. In TWRP select `Install`.
6. Use `Select Storage` to switch to your SD card.
7. Use `Install Image` to switch to image installation mode.
8. Select `super.img` from the list.
9. Select `Super` partition.
10. Swipe the slider on the bottom to the right to confirm.

102
docs/HOW-TO-INSTALL.md Normal file
View File

@@ -0,0 +1,102 @@
How to install LineageOS 17.1 for the Unihertz Atom L and XL
=================================================
## Getting adb and fastboot
### Linux or MacOS
If you are using a Linux or a similar operating system on your PC or Mac chances are very high that you already have these two applications installed.
Open a terminal and exectute the following commands.
```bash
adb version
fastboot --version
```
If one or both of these output an error you need to (re-)install adb and fastboot.
```bash
wget https://dl.google.com/android/repository/platform-tools-latest-linux.zip
unzip platform-tools-latest-linux.zip -d ~
```
Update your PATH variable for your environment
```bash
gedit ~/.profile
```
Add the following
```bash
# add Android SDK platform tools to path
if [ -d "$HOME/platform-tools" ] ; then
PATH="$HOME/platform-tools:$PATH"
fi
```
Then update your environment
```bash
source ~/.profile
```
### Windows
Download [the latest version of adb and fastboot](https://dl.google.com/android/repository/platform-tools-latest-windows.zip) to a directory of your choice and extract the archive.
## Unlocking
To be able to install anything on the Unihertz Atom L or XL we first need to unlock the bootloader.
1. Boot your device into the official OS.
2. Go to `Settings > About phone`, tap the "build number" several times to enable developer settings.
3. Go to `Settings > System > Developer Settings`, enable OEM unlocking and ADB debugging.
4. Connect your phone to your PC and open a terminal or a command line window.
5. Run `adb reboot bootloader` on your PC (there is no way to enter bootloader directly, only possible through adb).
6. Once your device has finished booting run `fastboot flashing unlock` and comfirm unlock on device (**THIS WILL WIPE ALL DATA!**).
6. Run `fastboot reboot` to reboot your device and now you should see an unlocked warning during boot screen.
## Disabling AVB (Android Verified Boot)
To get LineageOS to boot proberly we also need to disable AV. Otherwise the bootloader will check the ROM with the wrong authorization keys and prevent the loading.
- [Atom L Releases](https://github.com/ADeadTrousers/android_device_Unihertz_Atom_L/releases)
- [Atom XL Releases](https://github.com/ADeadTrousers/android_device_Unihertz_Atom_XL/releases)
1. Download `vbmeta.img` from the latest release page of your device.
2. Connect your phone to your PC and open a terminal or a command line window.
3. Run `adb reboot bootloader` on your PC to put your device in bootloader mode.
4. Once your device has finished booting run `fastboot flash --disable-verification --disable-verity vbmeta vbmeta.img`.
5. Then run `fastboot flash --disable-verification --disable-verity vbmeta_system vbmeta.img`.
6. Also run `fastboot flash --disable-verification --disable-verity vbmeta_vendor vbmeta.img`.
## Installing TWRP recovery
- [Atom L Releases](https://github.com/ADeadTrousers/twrp_device_Unihertz_Atom_L/releases)
- [Atom XL Releases](https://github.com/ADeadTrousers/twrp_device_Unihertz_Atom_XL/releases)
1. Download `recovery.img` from the latest release page of your device.
2. Connect your phone to your PC and open a terminal or a command line window.
3. Run `adb reboot bootloader` on your PC to put your device in bootloader mode.
4. Once your device has finished booting run `fastboot flash recovery recovery.img`.
5. Run `fastboot reboot` and after the screen goes dark press volume up until you see the TWRP logo.
6. Now you need to install a new ROM because booting into stock ROM will replace TWRP with the stock recovery.
## Installing LineageOS ROM
- [Atom L Releases](https://github.com/ADeadTrousers/android_device_Unihertz_Atom_L/releases)
- [Atom XL Releases](https://github.com/ADeadTrousers/android_device_Unihertz_Atom_XL/releases)
1. Download `lineage-17.1-XXX-UNOFFICIAL-YYY-signed.zip` from the latest release page of your device.
2. Connect your phone to your PC and open a terminal or a command line window.
3. Run `adb reboot recovery` on your PC or simply hold volume up while turning power on to boot your device into the recovery.
4. In TWRP select `Wipe > Advanced Wipe`.
5. Tick `Dalvik / ART Cache`, `Cache`, `Data`, `Internal Storage`.
6. Swipe the slider on the bottom to the right to confirm. (**THIS WILL WIPE ALL DATA!**)
7. Go back to the home screen and select `Advanced > ADB Sideload`.
8. Swipe the slider on the bottom to the right to confirm.
9. Run `adb sideload lineage-17.1-XXX-UNOFFICIAL-YYY.zip` from your PC.
10. Wait for the process to finish. The recovery might prompt something about verification failure, just ignore it and continue anyway.
11. (Optional) At this point, you can then sideload the latest Magisk and/or OpenGAPPS Nano at your will. Note that the size of the system partition might only be enough for the "nano" variant of OpenGAPPS. If installing Magisk / OpenGAPPS fails, you can try rebooting into recovery again in advanced menus, then try installing them again.
12. Select `Reboot System` to reboot into LineageOS and enjoy. Note that Magisk might cause your device to boot loop once or twice but it will eventually boot.

41
docs/HOW-TO-UPDATE.md Normal file
View File

@@ -0,0 +1,41 @@
How to update LineageOS 17.1 for the Unihertz Atom L and XL
=================================================
Every piece of software should allways kept up-to-date. Therefore even this ROM get updates from time to time and you should allways apply these to your device.
## (optional) Updating TWRP recovery
- [Atom L Releases](https://github.com/ADeadTrousers/twrp_device_Unihertz_Atom_L/releases)
- [Atom XL Releases](https://github.com/ADeadTrousers/twrp_device_Unihertz_Atom_XL/releases)
1. Download `recovery.img` from the latest release page of your device.
2. Connect your phone to your PC and open a terminal or a command line window.
3. Run `adb reboot recovery` on your PC or simply hold volume up while turning power on to boot your device into the recovery.
4. Wait for TWRP to boot.
5. Run `adb push recovery.img /external_sd`.
6. In TWRP select `Install`.
7. Use `Select Storage` to switch to your SD card.
8. Use `Install Image` to switch to image installation mode.
9. Select `recovery.img` from the list.
10. Select `Recovery` partition.
11. Swipe the slider on the bottom to the right to confirm.
## Updating LineageOS ROM
- [Atom L Releases](https://github.com/ADeadTrousers/android_device_Unihertz_Atom_L/releases)
- [Atom XL Releases](https://github.com/ADeadTrousers/android_device_Unihertz_Atom_XL/releases)
1. Download `lineage-17.1-XXX-UNOFFICIAL-YYY-signed.zip` from the latest release page of your device.
2. Connect your phone to your PC and open a terminal or a command line window.
3. Run `adb reboot recovery` on your PC or simply hold volume up while turning power on to boot your device into the recovery.
4. (Optional) In TWRP select `Wipe > Advanced Wipe`.
5. (Optional) Tick `Dalvik / ART Cache`, `Cache`, `Data`, `Internal Storage`.
6. (Optional) Swipe the slider on the bottom to the right to confirm. (**THIS WILL WIPE ALL DATA!**)
7. Go back to the home screen and select `Advanced > ADB Sideload`.
8. Swipe the slider on the bottom to the right to confirm.
9. Run `adb sideload lineage-17.1-XXX-UNOFFICIAL-YYY.zip` from your PC.
10. Wait for the process to finish. The recovery might prompt something about verification failure, just ignore it and continue anyway.
11. (Optional) You need to flash all the additional modules that you previously installed.
12. Select `Reboot System` to reboot into LineageOS and enjoy. Note that Magisk might cause your device to boot loop once or two but it will eventually boot.
Steps 4 to 6 are optional but if you encounter any errors later on you are on your own.

10
docs/README.md Normal file
View File

@@ -0,0 +1,10 @@
Documentations for the Unihertz Atom L and XL
=================================================
- [HOW-TO-BUILD.md](HOW-TO-BUILD.md) - Building instructions for LineageOS 17.1.
- [HOW-TO-INSTALL.md](HOW-TO-INSTALL.md) - Installation instructions for the Atom L/XL.
- [HOW-TO-UPDATE.md](HOW-TO-UPDATE.md) - Update instructions for the Atom L/XL.
- [HOW-TO-EXTRACT_FILES.md](HOW-TO-EXTRACT_FILES.md) - Instructions to extract files directly from the Atom L/XL stock rom files.
- [HOW-TO-EXTRACT_SEPOLICY.md](HOW-TO-EXTRACT_SEPOLICY.md) - A little guide to extract sepolicy rules from stock or phone.
- [HOW-TO-FLASH-STOCK.md](docs/HOW-TO-FLASH-STOCK.md) - Instructions on how to use the SP Flash Tool for MTK based devices.
- [HOW-TO-FLASH-SUPER.md](docs/HOW-TO-FLASH-SUPER.md) - Instructions on how to modify super.img and flashing it onto the device.

75
extract-files-common.sh Executable file
View File

@@ -0,0 +1,75 @@
#!/bin/bash
#
# Copyright (C) 2020 The LineageOS Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Load extract_utils and do some sanity checks
MY_DIR="${BASH_SOURCE%/*}"
if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi
LINEAGE_ROOT="${MY_DIR}"/../../..
HELPER="${LINEAGE_ROOT}/vendor/lineage/build/tools/extract_utils.sh"
if [ ! -f "${HELPER}" ]; then
echo "Unable to find helper script at ${HELPER}"
exit 1
fi
source "${HELPER}"
function blob_fixup() {
case "${1}" in
esac
}
# Default to sanitizing the vendor folder before extraction
CLEAN_VENDOR=true
SECTION=
KANG=
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 for common device
setup_vendor "${DEVICE}" "${VENDOR}" "${LINEAGE_ROOT}" false "${CLEAN_VENDOR}"
extract "${MY_DIR}/proprietary-files-common.txt" "${SRC}" \
"${KANG}" --section "${SECTION}"
extract "${LINEAGE_ROOT}/device/${VENDOR}/${DEVICE}/proprietary-files.txt" "${SRC}" \
"${KANG}" --section "${SECTION}"
COMMON_BLOB_ROOT="${LINEAGE_ROOT}/vendor/${VENDOR}/${DEVICE}/proprietary"
"${LINEAGE_ROOT}/device/${VENDOR}/${DEVICE}/setup-makefiles.sh"

38
gapps_prop.mk Normal file
View File

@@ -0,0 +1,38 @@
#
# Copyright (C) 2020 The LineageOS Project
#
# SPDX-License-Identifier: Apache-2.0
#
# GAPPS settings
# For examples see https://github.com/opengapps/aosp_build
# Here I only used the lowest set of apps including all overwrites according to "super" to save space
GAPPS_VARIANT := pico
GAPPS_FORCE_PACKAGE_OVERRIDES := true
GAPPS_FORCE_PIXEL_LAUNCHER := true
# Workaround for now to get Velvet (Google QuickSearch) to work
DONT_UNCOMPRESS_PRIV_APPS_DEXS := true
GAPPS_PRODUCT_PACKAGES += \
CalculatorGoogle \
CalendarGooglePrebuilt \
GoogleCamera \
CarrierServices \
Chrome \
PrebuiltDeskClockGoogle \
GoogleContacts \
GoogleDialer \
PrebuiltExchange3Google \
PrebuiltGmail \
LatinImeGoogle \
Maps \
PrebuiltBugle \
PixelLauncher \
Photos \
GooglePrintRecommendationService \
Velvet \
StorageManagerGoogle \
TagGoogle \
Wallpapers \
WebViewGoogle

29
idc/mtk-kpd.idc Normal file
View File

@@ -0,0 +1,29 @@
# Copyright (C) 2010 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Emulator keyboard configuration file #2.
#
touch.deviceType = touchScreen
touch.orientationAware = 1
keyboard.layout = mtk-kpd
keyboard.characterMap = qwerty
keyboard.orientationAware = 1
keyboard.builtIn = 1
cursor.mode = navigation
cursor.orientationAware = 1

View File

@@ -0,0 +1 @@
key 172 HOME VIRTUAL

101
keylayout/mtk-kpd.kl Normal file
View File

@@ -0,0 +1,101 @@
key 399 GRAVE
key 2 1
key 3 2
key 4 3
key 5 4
key 6 5
key 7 6
key 8 7
key 9 8
key 10 9
key 11 0
key 158 BACK
key 230 SOFT_RIGHT
key 60 SOFT_RIGHT
key 107 ENDCALL
key 62 ENDCALL
key 229 MENU
key 139 MENU
key 59 MENU
key 127 SYM
key 217 SEARCH
key 228 POUND
key 227 STAR
key 231 CALL
key 61 CALL
key 232 DPAD_CENTER
key 108 DPAD_DOWN
key 103 DPAD_UP
key 102 HOME
key 105 DPAD_LEFT
key 106 DPAD_RIGHT
key 115 VOLUME_UP
key 114 VOLUME_DOWN
key 113 MUTE
key 116 POWER
key 212 CAMERA
key 211 FOCUS
key 16 Q
key 17 W
key 18 E
key 19 R
key 20 T
key 21 Y
key 22 U
key 23 I
key 24 O
key 25 P
key 26 LEFT_BRACKET
key 27 RIGHT_BRACKET
key 43 BACKSLASH
key 30 A
key 31 S
key 32 D
key 33 F
key 34 G
key 35 H
key 36 J
key 37 K
key 38 L
key 39 SEMICOLON
key 40 APOSTROPHE
key 14 DEL
key 44 Z
key 45 X
key 46 C
key 47 V
key 48 B
key 49 N
key 50 M
key 51 COMMA
key 52 PERIOD
key 53 SLASH
key 28 ENTER
key 56 ALT_LEFT
key 100 ALT_RIGHT
key 42 SHIFT_LEFT
key 54 SHIFT_RIGHT
key 15 TAB
key 57 SPACE
key 150 EXPLORER
key 155 ENVELOPE
key 12 MINUS
key 13 EQUALS
key 215 AT
key 164 MEDIA_PLAY_PAUSE
key 128 MEDIA_STOP
key 163 MEDIA_NEXT
key 165 MEDIA_PREVIOUS
key 168 MEDIA_REWIND
key 159 MEDIA_FAST_FORWARD
# agold add
key 249 ASSIST
key 250 SEARCH

2
keylayout/mtk-tpd-kpd.kl Normal file
View File

@@ -0,0 +1,2 @@
key 158 BACK VIRTUAL
key 580 APP_SWITCH VIRTUAL

View File

@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2015-2016 The CyanogenMod Project
2017-2018 The LineageOS Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources>
<!-- Hardware keys present on the device, stored as a bit field.
This integer should equal the sum of the corresponding value for each
of the following keys present:
1 - Home
2 - Back
4 - Menu
8 - Assistant (search)
16 - App switch
32 - Camera
64 - Volume rocker
For example, a device with Home, Back and Menu keys would set this
config to 7. -->
<integer name="config_deviceHardwareKeys">91</integer>
<!-- Hardware keys present on the device with the ability to wake, stored as a bit field.
This integer should equal the sum of the corresponding value for each
of the following keys present:
1 - Home
2 - Back
4 - Menu
8 - Assistant (search)
16 - App switch
32 - Camera
64 - Volume rocker
For example, a device with Home, Back and Menu keys would set this
config to 7. -->
<integer name="config_deviceHardwareWakeKeys">64</integer>
<!-- All the capabilities of the LEDs on this device, stored as a bit field.
This integer should equal the sum of the corresponding value for each
of the following capabilities present:
// Device has a color adjustable battery light.
LIGHTS_RGB_NOTIFICATION_LED = 1
// Device has a color adjustable notification light.
LIGHTS_RGB_BATTERY_LED = 2
LIGHTS_MULTIPLE_NOTIFICATION_LED = 4 (deprecated)
// The notification light has adjustable pulsing capability.
LIGHTS_PULSATING_LED = 8
// Device has a multi-segment battery light that is able to
// use the light brightness value to determine how many
// segments to show (in order to represent battery level).
LIGHTS_SEGMENTED_BATTERY_LED = 16
// The notification light supports HAL adjustable brightness
// via the alpha channel.
// Note: if a device notification light supports LIGHTS_RGB_NOTIFICATION_LED
// then HAL support is not necessary for brightness control. In this case,
// brightness support will be provided by lineage-sdk through the scaling of
// RGB color values.
LIGHTS_ADJUSTABLE_NOTIFICATION_LED_BRIGHTNESS = 32
// Device has a battery light.
LIGHTS_BATTERY_LED = 64
// The battery light supports HAL adjustable brightness via
// the alpha channel.
// Note: if a device battery light supports LIGHTS_RGB_BATTERY_LED then HAL
// support is not necessary for brightness control. In this case,
// brightness support will be provided by lineage-sdk through the scaling of
// RGB color values.
LIGHTS_ADJUSTABLE_BATTERY_LED_BRIGHTNESS = 128
For example, a device with notification and battery lights that supports
pulsating and RGB control would set this config to 75. -->
<integer name="config_deviceLightCapabilities">67</integer>
</resources>

View File

@@ -0,0 +1,14 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_IS_RUNTIME_RESOURCE_OVERLAY := true
LOCAL_CERTIFICATE := platform
LOCAL_PACKAGE_NAME := FrameworkResOverlay
LOCAL_SDK_VERSION := current
LOCAL_MODULE_PATH := $(TARGET_OUT_PRODUCT)/vendor_overlay/$(PRODUCT_TARGET_VNDK_VERSION)/overlay/FrameworkResOverlay/
include $(BUILD_PACKAGE)

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" android:compileSdkVersion="29" android:compileSdkVersionCodename="10" package="com.mediatek.frameworkresoverlay" platformBuildVersionCode="29" platformBuildVersionName="10">
<overlay android:isStatic="true" android:priority="1" android:targetPackage="android"/>
<application android:extractNativeLibs="false" android:hasCode="false"/>
</manifest>

View File

@@ -0,0 +1,173 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
** Copyright 2012, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- List of regexpressions describing the interface (if any) that represent tetherable
USB interfaces. If the device doesn't want to support tething over USB this should
be empty. An example would be "usb.*" -->
<string-array translatable="false" name="config_tether_usb_regexs">
<item>"usb\\d"</item>
<item>"rndis\\d"</item>
</string-array>
<!-- List of regexpressions describing the interface (if any) that represent tetherable
Wifi interfaces. If the device doesn't want to support tethering over Wifi this
should be empty. An example would be "softap.*" -->
<string-array translatable="false" name="config_tether_wifi_regexs">
<item>"wlan0"</item>
<item>"softap.*"</item>
<item>"wifi_br0"</item>
<item>"wigig0"</item>
</string-array>
<!-- List of regexpressions describing the interface (if any) that represent tetherable
bluetooth interfaces. If the device doesn't want to support tethering over bluetooth this
should be empty. -->
<string-array translatable="false" name="config_tether_bluetooth_regexs">
<item>bnep\\d</item>
<item>"bt-pan"</item>
</string-array>
<!-- This string array should be overridden by the device to present a list of network
attributes. This is used by the connectivity manager to decide which networks can coexist
based on the hardware -->
<!-- An Array of "[Connection name],[ConnectivityManager.TYPE_xxxx],
[associated radio-type],[priority],[restoral-timer(ms)],[dependencyMet] -->
<!-- the 5th element "resore-time" indicates the number of milliseconds to delay
before automatically restore the default connection. Set -1 if the connection
does not require auto-restore. -->
<!-- the 6th element indicates boot-time dependency-met value. -->
<string-array name="networkAttributes">
<item>wifi,1,1,1,-1,true</item>
<item>mobile,0,0,0,-1,true</item>
<item>mobile_mms,2,0,2,60000,true</item>
<item>mobile_supl,3,0,2,60000,true</item>
<item>mobile_dun,4,0,2,60000,true</item>
<item>mobile_hipri,5,0,3,60000,true</item>
<item>mobile_fota,10,0,2,60000,true</item>
<item>mobile_ims,11,0,-1,-1,true</item>
<item>mobile_cbs,12,0,2,60000,true</item>
<item>wifi_p2p,13,1,0,-1,true</item>
<item>mobile_ia,14,0,2,-1,true</item>
<item>mobile_emergency,15,0,2,-1,true</item>
<item>mobile_wap,21,0,3,60000,true</item>
<item>mobile_xcap,25,0,3,60000,true</item>
<item>mobile_rcs,26,0,3,60000,true</item>
<item>mobile_bip,27,0,3,60000,true</item>
<item>mobile_vsim,28,0,-1,60000,true</item>
<item>mobile_preempt,29,0,9,60000,true</item>
</string-array>
<!-- When true use the linux /dev/input/event subsystem to detect the switch changes
on the headphone/microphone jack. When false use the older uevent framework. -->
<bool name="config_useDevInputEventForAudioJack">true</bool>
<!-- Is the notification LED intrusive? Used to decide if there should be a disable option -->
<bool name="config_intrusiveNotificationLed">true</bool>
<!-- Set to true to add links to Cell Broadcast app from Settings and MMS app. -->
<bool name="config_cellBroadcastAppLinks">true</bool>
<!-- Flag indicating whether we should enable the automatic brightness.
Software implementation will be used if config_hardware_auto_brightness_available is not set -->
<bool name="config_automatic_brightness_available">true</bool>
<!-- Whether a software navigation bar should be shown. NOTE: in the future this may be
autodetected from the Configuration. -->
<bool name="config_showNavigationBar">false</bool>
<!-- Indicate whether to allow the device to suspend when the screen is off
due to the proximity sensor. This resource should only be set to true
if the sensor HAL correctly handles the proximity sensor as a wake-up source.
Otherwise, the device may fail to wake out of suspend reliably.
The default is false. -->
<bool name="config_suspendWhenScreenOffDueToProximity">true</bool>
<!-- Boolean indicating whether the wifi chipset has dual frequency band support -->
<bool name="config_wifi_dual_band_support">true</bool>
<!-- Wifi driver supports IEEE80211AC for softap -->
<bool name="config_wifi_softap_ieee80211ac_supported">true</bool>
<!-- Flag specifying whether VoLTE is available on device -->
<bool name="config_device_volte_available">true</bool>
<!-- Flag specifying whether VT is available on device -->
<bool name="config_device_vt_available">true</bool>
<!-- Flag specifying whether or not IMS will use the ImsResolver dynamically -->
<bool name="config_dynamic_bind_ims">true</bool>
<!-- ImsService package name to bind to by default, if config_dynamic_bind_ims is true -->
<string name="config_ims_package">com.mediatek.ims</string>
<!-- Max number of connected audio devices supported by Bluetooth stack -->
<integer name="config_bluetooth_max_connected_audio_devices">1</integer>
<integer name="config_defaultPeakRefreshRate">130</integer>
<!-- Array of output values for LCD backlight corresponding to the lux values
in the config_autoBrightnessLevels array. This array should have size one greater
than the size of the config_autoBrightnessLevels array.
The brightness values must be between 0 and 255 and be non-decreasing.
This must be overridden in platform specific overlays -->
<integer-array name="config_autoBrightnessLcdBacklightValues">
<item>8</item>
<item>64</item>
<item>98</item>
<item>104</item>
<item>110</item>
<item>116</item>
<item>122</item>
<item>128</item>
<item>134</item>
<item>182</item>
<item>255</item>
<item>255</item>
<item>255</item>
<item>255</item>
<item>255</item>
<item>255</item>
<item>255</item>
<item>255</item>
</integer-array>
<!-- Array of light sensor lux values to define our levels for auto backlight brightness support.
The N entries of this array define N + 1 control points as follows:
(1-based arrays)
Point 1: (0, value[1]): lux <= 0
Point 2: (level[1], value[2]): 0 < lux <= level[1]
Point 3: (level[2], value[3]): level[2] < lux <= level[3]
...
Point N+1: (level[N], value[N+1]): level[N] < lux
The control points must be strictly increasing. Each control point
corresponds to an entry in the brightness backlight values arrays.
For example, if lux == level[1] (first element of the levels array)
then the brightness will be determined by value[2] (second element
of the brightness values array).
Spline interpolation is used to determine the auto-brightness
backlight values for lux levels between these control points.
Must be overridden in platform specific overlays -->
<integer-array name="config_autoBrightnessLevels">
<item>128</item>
<item>256</item>
<item>384</item>
<item>512</item>
<item>640</item>
<item>768</item>
<item>896</item>
<item>1024</item>
<item>2048</item>
<item>4096</item>
<item>6144</item>
<item>8192</item>
<item>10240</item>
<item>12288</item>
<item>14336</item>
<item>16384</item>
<item>18432</item>
</integer-array>
</resources>

View File

@@ -0,0 +1,157 @@
<?xml version="1.0" encoding="utf-8"?>
<device name="Android">
<item name="ambient.on">0.1</item>
<item name="screen.on">70.2</item>
<item name="screen.full">145</item>
<item name="bluetooth.active">30</item>
<item name="bluetooth.on">0.7</item>
<item name="wifi.on">0.3</item>
<item name="wifi.active">200</item>
<item name="wifi.scan">38</item>
<item name="audio">24</item>
<item name="video">35</item>
<item name="camera.flashlight">200</item>
<item name="camera.avg">600</item>
<item name="gps.on">45</item>
<item name="radio.active">662.5</item>
<item name="radio.scanning">5.5</item>
<array name="radio.on">
<value>4.0</value>
<value>4.0</value>
</array>
<array name="cpu.clusters.cores">
<value>4</value>
<value>4</value>
</array>
<array name="cpu.speeds.cluster0">
<value>793000</value>
<value>910000</value>
<value>1014000</value>
<value>1131000</value>
<value>1248000</value>
<value>1326000</value>
<value>1417000</value>
<value>1508000</value>
<value>1586000</value>
<value>1625000</value>
<value>1677000</value>
<value>1716000</value>
<value>1781000</value>
<value>1846000</value>
<value>1924000</value>
<value>1989000</value>
</array>
<array name="cpu.speeds.cluster1">
<value>793000</value>
<value>910000</value>
<value>1014000</value>
<value>1131000</value>
<value>1248000</value>
<value>1326000</value>
<value>1417000</value>
<value>1508000</value>
<value>1586000</value>
<value>1625000</value>
<value>1677000</value>
<value>1716000</value>
<value>1781000</value>
<value>1846000</value>
<value>1924000</value>
<value>1989000</value>
</array>
<array name="cpu.active.cluster0">
<value>415</value>
<value>2012</value>
<value>1818</value>
<value>1709</value>
<value>1368</value>
<value>911</value>
<value>942</value>
<value>793</value>
<value>605</value>
<value>314</value>
<value>458</value>
<value>286</value>
<value>421</value>
<value>399</value>
<value>504</value>
<value>2664</value>
</array>
<array name="cpu.active.cluster1">
<value>2567</value>
<value>4192</value>
<value>2150</value>
<value>1494</value>
<value>892</value>
<value>631</value>
<value>1106</value>
<value>1586</value>
<value>1451</value>
<value>722</value>
<value>888</value>
<value>685</value>
<value>1398</value>
<value>1691</value>
<value>3088</value>
<value>9887</value>
</array>
<item name="cpu.idle">4.5</item>
<item name="cpu.suspend">15</item>
<item name="cpu.active">9.55</item>
<item name="cpu.cluster_power.cluster0">2.11</item>
<item name="cpu.cluster_power.cluster1">2.22</item>
<array name="cpu.core_speeds.cluster0">
<value>300000</value>
<value>1000000</value>
<value>2000000</value>
</array>
<array name="cpu.core_speeds.cluster1">
<value>300000</value>
<value>1000000</value>
<value>2500000</value>
<value>3000000</value>
</array>
<array name="cpu.core_power.cluster0">
<value>10</value>
<value>20</value>
<value>30</value>
</array>
<array name="cpu.core_power.cluster1">
<value>25</value>
<value>35</value>
<value>50</value>
<value>60</value>
</array>
<array name="memory.bandwidths">
<value>22.7</value>
</array>
<item name="battery.capacity">4230</item>
<item name="wifi.controller.idle">3</item>
<item name="wifi.controller.rx">200</item>
<item name="wifi.controller.tx">200</item>
<array name="wifi.controller.tx_levels" />
<item name="wifi.controller.voltage">3.3</item>
<array name="wifi.batchedscan">
<value>.0002</value>
<value>.002</value>
<value>.02</value>
<value>.2</value>
<value>2</value>
</array>
<item name="modem.controller.sleep">0</item>
<item name="modem.controller.idle">0</item>
<item name="modem.controller.rx">0</item>
<array name="modem.controller.tx">
<value>0</value>
<value>0</value>
<value>0</value>
<value>0</value>
<value>0</value>
</array>
<item name="modem.controller.voltage">0</item>
<array name="gps.signalqualitybased">
<value>0</value>
<value>0</value>
</array>
<item name="gps.voltage">0</item>
</device>

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2007 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- Defines the location of the fingerprint sensor on the device
0 = back
1 = front
2 = left side
3 = right side
-->
<integer name="config_fingerprintSensorLocation">1</integer>
</resources>

36
patch/apply.sh Executable file
View File

@@ -0,0 +1,36 @@
#!/bin/bash
MYABSPATH=$(readlink -f "$0")
PATCHBASE=$(dirname "$MYABSPATH")
CMBASE=$(readlink -f "$PATCHBASE/../../../../")
cd "$CMBASE/bootable/recovery"
if git remote -v | grep TeamWin; then
TWRP=true
else
TWRP=false
fi
for i in $(find "$PATCHBASE"/* -type d); do
PATCHNAME=$(basename "$i")
PATCHTARGET=$PATCHNAME
for j in $(seq 4); do
PATCHTARGET=$(echo $PATCHTARGET | sed 's/_/\//')
if [ -d "$CMBASE/$PATCHTARGET" ]; then break; fi
done
echo
echo applying $PATCHNAME to $PATCHTARGET
cd "$CMBASE/$PATCHTARGET" || exit 1
suffix=".patch"
if [ $PATCHNAME = "bootable_recovery" -a $TWRP = true ]; then suffix=".twrp.patch"; fi
if [ $PATCHNAME = "bootable_recovery" -a $TWRP = false ]; then suffix=".cm.patch"; fi
if compgen -G "$PATCHBASE/$PATCHNAME/*${suffix}" > /dev/null; then
if ! git am --ignore-whitespace -3 "$PATCHBASE/$PATCHNAME"/*${suffix}; then
git am --abort
exit 1
fi
fi
done

View File

@@ -0,0 +1,35 @@
From 1e54b3cf486cf942ecb32e294e8cde1c028e4f8b Mon Sep 17 00:00:00 2001
From: gesangtome <gesangtome@foxmail.com>
Date: Tue, 24 Mar 2020 05:47:25 +0800
Subject: [PATCH] releasetools: fix Unicode-objects must be encoded before
hashing
This error occurs when using 'ota_from_target_files' to make an incremental package.
According to the prompt, first encode fp to resolve this error.
build/make/tools/releasetools/common.py", line 448, in LoadInfoDict
d["avb_salt"] = sha256(fp).hexdigest()
TypeError: Unicode-objects must be encoded before hashing
Change-Id: I196b3ae37e1fb92be58c48aa8ab0928b6e6aec69
---
tools/releasetools/common.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py
index 9f57773ba..d54689bd2 100644
--- a/tools/releasetools/common.py
+++ b/tools/releasetools/common.py
@@ -445,7 +445,7 @@ def LoadInfoDict(input_file, repacking=False):
elif "ro.build.thumbprint" in build_prop:
fp = build_prop["ro.build.thumbprint"]
if fp:
- d["avb_salt"] = sha256(fp).hexdigest()
+ d["avb_salt"] = sha256(fp.encode()).hexdigest()
return d
--
2.25.1

View File

@@ -0,0 +1,39 @@
From da764b2424192bdd99ff1e4e28e1daea7ebb75b7 Mon Sep 17 00:00:00 2001
From: Matthias Leitl <a.dead.trousers@gmail.com>
Date: Sat, 28 Nov 2020 11:19:15 +0100
Subject: [PATCH] restart AudioServer to sync with AudioService
Change-Id: Ia6b68c4db4e94252cb0d8d39ed9745adeba069fd
---
media/audioserver/audioserver.rc | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/media/audioserver/audioserver.rc b/media/audioserver/audioserver.rc
index dfb1a3fb9..7dba4b9a1 100644
--- a/media/audioserver/audioserver.rc
+++ b/media/audioserver/audioserver.rc
@@ -2,16 +2,18 @@ service audioserver /system/bin/audioserver
class core
user audioserver
# media gid needed for /dev/fm (radio) and for /data/misc/media (tee)
- group audio camera drmrpc inet media mediadrm net_bt net_bt_admin net_bw_acct wakelock
+ group audio camera drmrpc inet media mediadrm net_bt net_bt_admin net_bw_acct wakelock system sdcard_rw
capabilities BLOCK_SUSPEND
ioprio rt 4
writepid /dev/cpuset/foreground/tasks /dev/stune/foreground/tasks
onrestart restart vendor.audio-hal-2-0
- onrestart restart vendor.audio-hal-4-0-msd
+ #onrestart restart vendor.audio-hal-4-0-msd
# Keep the original service name for backward compatibility when upgrading
# O-MR1 devices with framework-only.
onrestart restart audio-hal-2-0
-
+#[ALPS04217601] restart AudioServer to sync with AudioService
+on property:vold.decrypt=trigger_reset_main
+ restart audioserver
on property:vts.native_server.on=1
stop audioserver
on property:vts.native_server.on=0
--
2.25.1

View File

@@ -0,0 +1,25 @@
From e805786430c48841dc8a3ff98da165c79e24cac4 Mon Sep 17 00:00:00 2001
From: Matthias Leitl <a.dead.trousers@gmail.com>
Date: Sat, 28 Nov 2020 11:22:06 +0100
Subject: [PATCH] Add drmserver access sdcard and internal storage permission
Change-Id: I7caf72d6f106b773c03fd16d891a59e026e4f022
---
drm/drmserver/drmserver.rc | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drm/drmserver/drmserver.rc b/drm/drmserver/drmserver.rc
index de46fb92e..5d9442c4b 100644
--- a/drm/drmserver/drmserver.rc
+++ b/drm/drmserver/drmserver.rc
@@ -1,5 +1,6 @@
service drm /system/bin/drmserver
class main
user drm
- group drm system inet drmrpc readproc
+ # Add drmserver access sdcard and internal storage permission
+ group drm system inet drmrpc readproc sdcard_rw media_rw
writepid /dev/cpuset/foreground/tasks
--
2.25.1

View File

@@ -0,0 +1,25 @@
From 3b4353d9e456c6f63ae4c8396a4e4b1cece9066f Mon Sep 17 00:00:00 2001
From: Matthias Leitl <a.dead.trousers@gmail.com>
Date: Sat, 28 Nov 2020 11:24:46 +0100
Subject: [PATCH] Add mediaextractor permission to read properties
Change-Id: I1c61e25c9a3201a2375cb4ceb1f61353a7a994e2
---
services/mediaextractor/mediaextractor.rc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/services/mediaextractor/mediaextractor.rc b/services/mediaextractor/mediaextractor.rc
index 5fc294111..0f93f41c7 100644
--- a/services/mediaextractor/mediaextractor.rc
+++ b/services/mediaextractor/mediaextractor.rc
@@ -1,6 +1,6 @@
service mediaextractor /system/bin/mediaextractor
class main
user mediaex
- group drmrpc mediadrm
+ group drmrpc mediadrm readproc
ioprio rt 4
writepid /dev/cpuset/foreground/tasks
--
2.25.1

View File

@@ -0,0 +1,25 @@
From d3c40dc5e167223fc5cd32a01570c4617e3c7932 Mon Sep 17 00:00:00 2001
From: Matthias Leitl <a.dead.trousers@gmail.com>
Date: Sat, 28 Nov 2020 11:26:54 +0100
Subject: [PATCH] Add mediaserver permission to read properties
Change-Id: I31a8c8b83ee80703aba071f7f235997b071ac38d
---
media/mediaserver/mediaserver.rc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/media/mediaserver/mediaserver.rc b/media/mediaserver/mediaserver.rc
index f6c325c98..c7c7ce063 100644
--- a/media/mediaserver/mediaserver.rc
+++ b/media/mediaserver/mediaserver.rc
@@ -1,6 +1,6 @@
service media /system/bin/mediaserver
class main
user media
- group audio camera inet net_bt net_bt_admin net_bw_acct drmrpc mediadrm
+ group audio camera inet net_bt net_bt_admin net_bw_acct drmrpc mediadrm readproc
ioprio rt 4
writepid /dev/cpuset/foreground/tasks /dev/stune/foreground/tasks
--
2.25.1

View File

@@ -0,0 +1,26 @@
From 733ccd059ca157826aae4fbbae4550dd1a232f05 Mon Sep 17 00:00:00 2001
From: Matthias Leitl <a.dead.trousers@gmail.com>
Date: Tue, 26 Jan 2021 20:58:37 +0100
Subject: [PATCH] Deactivate unused error messages
Change-Id: I544b709c49b983e0c02a0fbf9572ce7d0d6d3c68
---
jni/fmr/Android.mk | 2 ++
1 file changed, 2 insertions(+)
diff --git a/jni/fmr/Android.mk b/jni/fmr/Android.mk
index 90cf5c3..e7027a2 100644
--- a/jni/fmr/Android.mk
+++ b/jni/fmr/Android.mk
@@ -34,6 +34,8 @@ LOCAL_SHARED_LIBRARIES := \
libdl \
libmedia \
liblog
+
+LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function
LOCAL_MODULE := libfmjni
LOCAL_MODULE_TAGS := optional
--
2.25.1

View File

@@ -0,0 +1,27 @@
From 926741ab6bba20f287714847bf977b3127797cbd Mon Sep 17 00:00:00 2001
From: Matthias Leitl <a.dead.trousers@gmail.com>
Date: Sat, 28 Nov 2020 11:08:33 +0100
Subject: [PATCH] Change vendor in bt_did.conf
Change-Id: Ie1053c409766f3ec4935a88532b829dd34f3be57
---
conf/bt_did.conf | 3 +++
1 file changed, 3 insertions(+)
diff --git a/conf/bt_did.conf b/conf/bt_did.conf
index 631cc6df3..942a854f5 100644
--- a/conf/bt_did.conf
+++ b/conf/bt_did.conf
@@ -9,6 +9,9 @@ primaryRecord = true
# 0x000F = Broadcom Corporation (default)
#vendorId = 0x000F
+# Set right vendorId
+vendorId = 0x0046
+
# Vendor ID Source
# 0x0001 = Bluetooth SIG assigned Device ID Vendor ID value (default)
# 0x0002 = USB Implementer's Forum assigned Device ID Vendor ID value
--
2.25.1

View File

@@ -0,0 +1,26 @@
From 43cab1c60bccc73bd75114bc9f20cabdfbef05d8 Mon Sep 17 00:00:00 2001
From: David Trpchevski <trpcevski.david@gmail.com>
Date: Mon, 22 Jun 2020 11:19:21 +0200
Subject: [PATCH] Allow Google Calendar to override Etar
Etar is used in LineageOS 17.1+
https://review.lineageos.org/c/LineageOS/cm_crowdin/+/276904
Signed-off-by: David Trpchevski <trpcevski.david@gmail.com>
---
modules/CalendarGooglePrebuilt/Android.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules/CalendarGooglePrebuilt/Android.mk b/modules/CalendarGooglePrebuilt/Android.mk
index 4d05572..ad2c457 100644
--- a/modules/CalendarGooglePrebuilt/Android.mk
+++ b/modules/CalendarGooglePrebuilt/Android.mk
@@ -7,6 +7,6 @@ LOCAL_PACKAGE_NAME := com.google.android.calendar
LOCAL_OVERRIDES_PACKAGES := GoogleCalendarSyncAdapter
GAPPS_LOCAL_OVERRIDES_MIN_VARIANT :=
-GAPPS_LOCAL_OVERRIDES_PACKAGES := Calendar
+GAPPS_LOCAL_OVERRIDES_PACKAGES := Calendar Etar
include $(BUILD_GAPPS_PREBUILT_APK)

View File

@@ -0,0 +1,38 @@
From 65b673bf9bcbc6aea6af9de2d5a1f0f0ec318e74 Mon Sep 17 00:00:00 2001
From: Matthias Leitl <a.dead.trousers@gmail.com>
Date: Sat, 7 Nov 2020 14:48:42 +0100
Subject: [PATCH 1/1] Additional overrides
Signed-off-by: Matthias Leitl <a.dead.trousers@gmail.com>
---
modules/PrebuiltBugle/Android.mk | 2 +-
modules/PrebuiltExchange3Google/Android.mk | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules/PrebuiltBugle/Android.mk b/modules/PrebuiltBugle/Android.mk
index 0489fcf..14b4fa5 100644
--- a/modules/PrebuiltBugle/Android.mk
+++ b/modules/PrebuiltBugle/Android.mk
@@ -5,6 +5,6 @@ LOCAL_MODULE := PrebuiltBugle
LOCAL_PACKAGE_NAME := com.google.android.apps.messaging
GAPPS_LOCAL_OVERRIDES_MIN_VARIANT :=
-GAPPS_LOCAL_OVERRIDES_PACKAGES := messaging Mms
+GAPPS_LOCAL_OVERRIDES_PACKAGES := messaging Mms Messaging
include $(BUILD_GAPPS_PREBUILT_APK)
diff --git a/modules/PrebuiltExchange3Google/Android.mk b/modules/PrebuiltExchange3Google/Android.mk
index f493523..774eb53 100644
--- a/modules/PrebuiltExchange3Google/Android.mk
+++ b/modules/PrebuiltExchange3Google/Android.mk
@@ -4,6 +4,6 @@ include $(GAPPS_CLEAR_VARS)
LOCAL_MODULE := PrebuiltExchange3Google
LOCAL_PACKAGE_NAME := com.google.android.gm.exchange
-LOCAL_OVERRIDES_PACKAGES := Exchange2
+LOCAL_OVERRIDES_PACKAGES := Exchange Exchange2
include $(BUILD_GAPPS_PREBUILT_APK)
--
2.25.1

View File

@@ -0,0 +1,51 @@
From 189bbf5700ab455c2698e1a3da85ff3041e058dc Mon Sep 17 00:00:00 2001
From: Matthias Leitl <a.dead.trousers@gmail.com>
Date: Sat, 7 Nov 2020 14:54:14 +0100
Subject: [PATCH 1/1] Temporary workaround for failing during first time
installation
Signed-off-by: Matthias Leitl <a.dead.trousers@gmail.com>
---
modules/PixelLauncher/Android.mk | 1 +
modules/StorageManagerGoogle/Android.mk | 1 +
modules/Velvet/Android.mk | 1 +
3 files changed, 3 insertions(+)
diff --git a/modules/PixelLauncher/Android.mk b/modules/PixelLauncher/Android.mk
index bf624db..3af6f2e 100644
--- a/modules/PixelLauncher/Android.mk
+++ b/modules/PixelLauncher/Android.mk
@@ -4,6 +4,7 @@ include $(GAPPS_CLEAR_VARS)
LOCAL_MODULE := PixelLauncher
LOCAL_PACKAGE_NAME := com.google.android.apps.nexuslauncher
LOCAL_PRIVILEGED_MODULE := true
+LOCAL_UNCOMPRESS_DEX := false
GAPPS_LOCAL_OVERRIDES_PACKAGES := Home GoogleNow Launcher2 Launcher3 Launcher3Go Launcher3QuickStep Launcher3QuickStepGo Fluctuation Trebuchet TrebuchetQuickStep
diff --git a/modules/StorageManagerGoogle/Android.mk b/modules/StorageManagerGoogle/Android.mk
index d4c7cad..4959d32 100644
--- a/modules/StorageManagerGoogle/Android.mk
+++ b/modules/StorageManagerGoogle/Android.mk
@@ -4,5 +4,6 @@ include $(GAPPS_CLEAR_VARS)
LOCAL_MODULE := StorageManagerGoogle
LOCAL_PACKAGE_NAME := com.google.android.storagemanager
LOCAL_PRIVILEGED_MODULE := true
+LOCAL_UNCOMPRESS_DEX := false
include $(BUILD_GAPPS_PREBUILT_APK)
diff --git a/modules/Velvet/Android.mk b/modules/Velvet/Android.mk
index ae7e06f..c27bbaf 100644
--- a/modules/Velvet/Android.mk
+++ b/modules/Velvet/Android.mk
@@ -4,6 +4,7 @@ include $(GAPPS_CLEAR_VARS)
LOCAL_MODULE := Velvet
LOCAL_PACKAGE_NAME := com.google.android.googlequicksearchbox
LOCAL_PRIVILEGED_MODULE := true
+LOCAL_UNCOMPRESS_DEX := false
LOCAL_OVERRIDES_PACKAGES := QuickSearchBox
--
2.25.1

17
product.prop Normal file
View File

@@ -0,0 +1,17 @@
persist.dbg.volte_avail_ovr=1
persist.dbg.vt_avail_ovr=1
persist.dbg.wfc_avail_ovr=1
telephony.lteOnCdmaDevice=1
ro.LED_KEYLIGHT_TEST=yes
ro.agui.single.mic=yes
ro.LED_COLOR_TEST=yes
ro.low_battery_led=yes
ro.battery_charging_led=yes
ro.miss_call_ledcolor=Red
ro.other_notifi_ledcolor=Green
ro.unread_notifi_ledcolor=Red
ro.incoming_ledcolor=Blue
ro.scridle_ledcolor=None

View File

@@ -0,0 +1,378 @@
# APNs
etc/apns-conf.xml:product/etc/apns-conf.xml
# MTK-IMS
-framework/mediatek-common.jar
-framework/mediatek-framework.jar
-framework/mediatek-ims-base.jar
-framework/mediatek-ims-common.jar
-framework/mediatek-telecom-common.jar
-framework/mediatek-telephony-base.jar
-framework/mediatek-telephony-common.jar
-priv-app/ImsService/ImsService.apk
bin/vtservice
etc/init/init.vtservice.rc
etc/permissions/privapp-permissions-mediatek.xml
-framework/mediatek-ims-extension-plugin.jar
-framework/mediatek-ims-legacy.jar
lib/libcomutils.so
lib/libimsma.so
lib/libimsma_adapt.so
lib/libimsma_rtp.so
lib/libimsma_socketwrapper.so
lib/libmtk_vt_service.so
lib/libmtk_vt_wrapper.so
lib/libmtkaudio_utils.so
lib/libmtkavenhancements.so
lib/libmtklimiter.so
lib/libmtkperf_client.so
lib/libmtkshifter.so
lib/libsignal.so
lib/libsink.so
lib/libsource.so
lib/libvcodec_cap.so
lib/libvcodec_capenc.so
lib/libvt_avsync.so
lib/vendor.mediatek.hardware.videotelephony@1.0.so
lib64/libmtk_vt_wrapper.so
lib64/libmtkaudio_utils.so
lib64/libmtkavenhancements.so
lib64/libmtklimiter.so
lib64/libmtkperf_client.so
lib64/libmtkshifter.so
lib64/libvcodec_cap.so
lib64/libvcodec_capenc.so
lib64/vendor.mediatek.hardware.videotelephony@1.0.so
-framework/OPCommonTelephony.jar
framework/arm/boot-OPCommonTelephony.art
framework/arm/boot-OPCommonTelephony.oat
framework/arm64/boot-OPCommonTelephony.art
framework/arm64/boot-OPCommonTelephony.oat
bin/aee
bin/aee_aed
bin/aee_aed64
bin/aee_core_forwarder
bin/aee_dumpstate
bin/aee_archive
etc/init/aee_aed.rc
etc/init/aee_aed64.rc
etc/init/hw/init.aee.rc
etc/aee-config
lib/libaed.so
lib/libdirect-coredump.so
lib/vendor.mediatek.hardware.log@1.0.so
lib64/libaed.so
lib64/libdirect-coredump.so
lib64/vendor.mediatek.hardware.log@1.0.so
bin/mdlogger
bin/emdlogger1
bin/emdlogger2
bin/emdlogger3
bin/emdlogger5
bin/sspm_log_writer
etc/init/mdlogger.rc
etc/init/emdlogger1.rc
etc/init/emdlogger2.rc
etc/init/emdlogger3.rc
etc/init/emdlogger5.rc
etc/emdlogger_usb_config.prop
etc/mtklog-config.prop
lib/libmdloggerrecycle.so
lib/libsysenv_system.so
lib64/libccci_util_sys.so
lib64/libmdloggerrecycle.so
lib64/libsysenv_system.so
bin/loghidlsysservice
bin/AudioSetParam
bin/auto_update
bin/lbs_dbg
bin/lcdc_screen_cap
bin/memtester
bin/met-cmd
bin/move_widevine_data.sh
bin/notify_traceur.override.sh
bin/oem-iptables-init.sh
bin/rtt
etc/init/hw/vendor_init_as_system.rc
etc/init/init.connectivity.rc
bin/connsyslogger
etc/init/consyslogger.rc
bin/batterywarning
etc/init/batterywarning.rc
bin/kpoc_charger
etc/init/kpoc_charger.rc
bin/mobile_log_d
etc/init/mobile_log_d.rc
bin/modemdbfilter_client
etc/init/modemdbfilter_client.rc
lib64/vendor.mediatek.hardware.modemdbfilter@1.0.so
bin/netdiag
etc/init/netdiag.rc
lib64/libpcap_bak.so
bin/boot_logo_updater
etc/init/bootlogoupdater.rc
lib/libshowlogo.so
bin/usp_service
etc/init/usp_service.rc
bin/terservice
etc/init/terserver.rc
lib64/libterservice.so
bin/thermald
etc/init/init.thermald.rc
bin/camerapostalgo
etc/init/camerapostalgo.rc
lib/libcamalgo_sys.autorama.so
lib/libcamalgo_sys.cfb.so
lib/libcamalgo_sys.hdr.so
lib/libcampostalgo.so
lib/libcampostalgo_featurepipe.so
lib/libcampostalgo_interface.so
lib/libpostalgo.plugin.autorama.so
lib/libpostalgo.plugin.fb.so
lib/libpostalgo.plugin.hdr.so
lib/libpostalgo_3rdparty.core.so
lib/libpostalgo_3rdparty.customer.so
lib/libpostalgo_3rdparty.mtk.so
lib/libpostalgo_3rdparty.plugin.features.so
lib/libpostalgo_3rdparty.so
lib/libpostalgo_grallocutils.so
lib/libpostalgo_imgbuf.so
lib/libpostalgo_metadata.so
lib/libpostalgo_stdutils.so
lib64/libcamalgo_sys.autorama.so
lib64/libcamalgo_sys.cfb.so
lib64/libcamalgo_sys.hdr.so
lib64/libcampostalgo.so
lib64/libcampostalgo_featurepipe.so
lib64/libcampostalgo_interface.so
lib64/libpostalgo.plugin.autorama.so
lib64/libpostalgo.plugin.fb.so
lib64/libpostalgo.plugin.hdr.so
lib64/libpostalgo_3rdparty.core.so
lib64/libpostalgo_3rdparty.customer.so
lib64/libpostalgo_3rdparty.mtk.so
lib64/libpostalgo_3rdparty.plugin.features.so
lib64/libpostalgo_3rdparty.so
lib64/libpostalgo_grallocutils.so
lib64/libpostalgo_imgbuf.so
lib64/libpostalgo_metadata.so
lib64/libpostalgo_stdutils.so
bin/met_log_d
usr/idc/mtk-pad.idc
etc/ams_aal_config.xml
etc/custom.conf
etc/ixitdata.xml
etc/resolution_tuner_app_list.xml
etc/sysconfig/a-framework-sysconfig.xml
ro.prop
rw.prop
etc/bluetooth/mtk_bt_fw.conf
etc/bluetooth/mtk_bt_stack.conf
lib64/vendor.mediatek.hardware.agolddaemon@1.0.so
lib64/vendor.mediatek.hardware.audio@5.1.so
lib64/vendor.mediatek.hardware.dfps@1.0.so
lib64/vendor.mediatek.hardware.gpu@1.0.so
lib64/vendor.mediatek.hardware.lbs@1.0.so
lib64/vendor.mediatek.hardware.mms@1.0.so
lib64/vendor.mediatek.hardware.mms@1.1.so
lib64/vendor.mediatek.hardware.mms@1.2.so
lib64/vendor.mediatek.hardware.mms@1.3.so
lib64/vendor.mediatek.hardware.mtkpower@1.0.so
lib64/vendor.mediatek.hardware.mtkradioex@1.0.so
lib64/vendor.mediatek.hardware.nwk_opt@1.0.so
lib64/vendor.mediatek.hardware.power@2.0.so
lib64/vendor.mediatek.hardware.power@2.1.so
lib64/vendor.mediatek.hardware.pq@2.0.so
lib64/vendor.mediatek.hardware.pq@2.1.so
lib64/vendor.mediatek.hardware.pq@2.2.so
lib64/vendor.mediatek.hardware.pq@2.3.so
lib64/vendor.mediatek.hardware.camera.device@1.1.so
lib64/vendor.trustonic.teeregistry@1.0.so
lib/vendor.mediatek.hardware.agolddaemon@1.0.so
lib/vendor.mediatek.hardware.audio@5.1.so
lib/vendor.mediatek.hardware.dfps@1.0.so
lib/vendor.mediatek.hardware.gpu@1.0.so
lib/vendor.mediatek.hardware.mms@1.0.so
lib/vendor.mediatek.hardware.mms@1.1.so
lib/vendor.mediatek.hardware.mms@1.2.so
lib/vendor.mediatek.hardware.mms@1.3.so
lib/vendor.mediatek.hardware.mtkpower@1.0.so
lib/vendor.mediatek.hardware.mtkradioex@1.0.so
lib/vendor.mediatek.hardware.nwk_opt@1.0.so
lib/vendor.mediatek.hardware.power@2.0.so
lib/vendor.mediatek.hardware.power@2.1.so
lib/vendor.mediatek.hardware.pq@2.0.so
lib/vendor.mediatek.hardware.pq@2.1.so
lib/vendor.mediatek.hardware.pq@2.2.so
lib/vendor.mediatek.hardware.pq@2.3.so
lib/vendor.mediatek.hardware.camera.device@1.1.so
lib/vendor.trustonic.teeregistry@1.0.so
-framework/mediatek-framework-net.jar
-framework/mediatek-services.jar
-framework/mediatek-wfo-legacy.jar
-framework/mtk-wifi-service.jar
lib/libaudioutilmtk.so
lib/libbessound_hd_mtk.so
lib/libdrmmtkutil.so
lib/libmediatek_exceptionlog.so
lib/libstagefright_wfd_mtk.so
lib/libaudio_param_parser-sys.so
lib/libaudiocompensationfilter.so
lib/libaudiocomponentengine.so
lib/libaudiotoolkit.so
lib64/libaudioutilmtk.so
lib64/libbessound_hd_mtk.so
lib64/libdrmmtkutil.so
lib64/libdrmmtkwhitelist.so
lib64/libmediatek_exceptionlog.so
lib64/libmtkbluetooth_jni.so
lib64/libaudio_param_parser-sys.so
lib64/libaudiocompensationfilter.so
lib64/libaudiocomponentengine.so
lib64/libaudiopolicycustomextensions.so
lib64/libaudiotoolkit.so
etc/permissions/com.mediatek.wfo.legacy.xml
etc/permissions/com.nxp.mifare.xml
etc/permissions/com.verizon.remoteSimlock.remotesimlockservicelibrary.xml
etc/permissions/verizon.net.sip.xml
framework/verizon.net.sip.jar
framework/via-plugin.jar
framework/log-handler.jar
framework/CapCtrlInterface.jar
framework/CustomPropInterface.jar
xbin/trace
lib/libMcRegistry.so
lib/libPQDCjni.so
lib/libPQjni.so
lib/lib_remote_simlock.so
lib/libblisrc.so
lib/libc2kutils_sys.so
lib/libcompress.so
lib/libcustom_jni.so
lib/libcustom_prop.so
lib/libdcfdecoderjni.so
lib/libdisp_dejitter.so
lib/libdtaNfaProvider.so
lib/libeap-aka.so
lib/libem_audio_jni.so
lib/libem_support_jni.so
lib/libem_usb_jni.so
lib/libem_wifi_jni.so
lib/libfpspolicy_fw.so
lib/libged_kpi.so
lib/libged_sys.so
lib/libgpud_sys.so
lib/libgralloc_extra_sys.so
lib/libgraphics2d_ext.so
lib/libgui_debug.so
lib/libgui_ext.so
lib/libjni_pq.so
lib/libjpeg-alpha-oal.so
lib/libjpeg-alpha.so
lib/liblepton_module.so
lib/liblepton_module_aging.so
lib/libmemoryDumpEncoder.so
lib/libnativecheck-jni.so
lib/libneuropilot.so
lib/libneuropilot_hal_utils.so
lib/libnwk_opt_halwrap.so
lib/libperfctl.so
lib/libpowerhalwrap.so
lib/libpowerhalwrap_jni.so
lib/libsf_debug.so
lib/libteec.so
lib/libteeservice_client.trustonic.so
lib/libtouchfilter.so
lib/libudf.so
lib/libui_ext.so
lib/libvsync_enhance.so
lib/libvsync_hint.so
lib/libwapi_cert_jni.so
lib/libdrmmtkwhitelist.so
lib64/libMcRegistry.so
lib64/libPQDCjni.so
lib64/libPQjni.so
lib64/lib_remote_simlock.so
lib64/libblisrc.so
lib64/libc2kutils_sys.so
lib64/libcompress.so
lib64/libcustom_jni.so
lib64/libcustom_prop.so
lib64/libdcfdecoderjni.so
lib64/libdisp_dejitter.so
lib64/libdtaNfaProvider.so
lib64/libeap-aka.so
lib64/libem_audio_jni.so
lib64/libem_support_jni.so
lib64/libem_usb_jni.so
lib64/libem_wifi_jni.so
lib64/libfpspolicy_fw.so
lib64/libged_kpi.so
lib64/libged_sys.so
lib64/libgpud_sys.so
lib64/libgralloc_extra_sys.so
lib64/libgraphics2d_ext.so
lib64/libgui_debug.so
lib64/libgui_ext.so
lib64/libjni_pq.so
lib64/libjpeg-alpha-oal.so
lib64/libjpeg-alpha.so
lib64/liblepton_module.so
lib64/liblepton_module_aging.so
lib64/libmemoryDumpEncoder.so
lib64/libnativecheck-jni.so
lib64/libneuropilot.so
lib64/libneuropilot_hal_utils.so
lib64/libnwk_opt_halwrap.so
lib64/libperfctl.so
lib64/libpowerhalwrap.so
lib64/libpowerhalwrap_jni.so
lib64/libqcs-jni-100.100.103.so
lib64/libsf_debug.so
lib64/libteec.so
lib64/libteeservice_client.trustonic.so
lib64/libtouchfilter.so
lib64/libtsf-jni-103.100.101.so
lib64/libudf.so
lib64/libui_ext.so
lib64/libupdate-jni-1.0.1.2002.so
lib64/libvsync_enhance.so
lib64/libvsync_hint.so
lib64/libwapi_cert_jni.so
-framework/com.st.android.nfc_extensions.jar
etc/init/hw/init.stnfc.rc
etc/nfcee_access.xml
etc/permissions/com.st.android.nfc_extensions.xml
bin/nfcstackp
bin/st_factorytests
lib/libnfc_st_dta.so
lib/libnfc_st_dta_jni.so
lib/libstnfc-nci.so
lib/libstnfc_nci_jni.so
lib64/libnfc_st_dta.so
lib64/libnfc_st_dta_jni.so
lib64/libstnfc-nci.so
lib64/libstnfc_nci_jni.so

View File

@@ -0,0 +1,23 @@
on init
setprop sys.usb.configfs 1
setprop sys.usb.ffs.aio_compat 1
on fs && property:ro.debuggable=0
# distinguish USB shoulde connect or not, i.e. CDP vs SDP
write /sys/class/udc/musb-hdrc/device/cmode 2
# set charging free due to it wait for USB activation
start adbd
on post-fs
# Support A/B feature for EMMC and UFS boot region
symlink /dev/block/sda /dev/block/mmcblk0boot0
symlink /dev/block/sdb /dev/block/mmcblk0boot1
symlink /dev/block/mmcblk0boot0 /dev/block/platform/bootdevice/by-name/preloader_a
symlink /dev/block/mmcblk0boot1 /dev/block/platform/bootdevice/by-name/preloader_b
# Support A/B feature for combo emmc and ufs OTA update
symlink /dev/block/platform/bootdevice/by-name/preloader_a /dev/block/platform/bootdevice/by-name/preloader_emmc_a
symlink /dev/block/platform/bootdevice/by-name/preloader_b /dev/block/platform/bootdevice/by-name/preloader_emmc_b
symlink /dev/block/platform/bootdevice/by-name/preloader_a /dev/block/platform/bootdevice/by-name/preloader_ufs_a
symlink /dev/block/platform/bootdevice/by-name/preloader_b /dev/block/platform/bootdevice/by-name/preloader_ufs_b

37
rootdir/Android.mk Normal file
View File

@@ -0,0 +1,37 @@
# Copyright (C) 2020 The LineageOS Project
#
# SPDX-License-Identifier: Apache-2.0
#
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := init.mt6771.rc
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := ETC
LOCAL_SRC_FILES := etc/init.mt6771.rc
LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/init
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := fstab.mt6771
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := ETC
LOCAL_SRC_FILES := etc/fstab.mt6771
LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := libfmcust
LOCAL_MODULE_SUFFIX := .so
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
LOCAL_MODULE_TAGS := optional
LOCAL_PRELINK_MODULE := false
ifdef TARGET_2ND_ARCH
LOCAL_MULTILIB := both
LOCAL_SRC_FILES_64 := lib64/libfmcust.so
LOCAL_SRC_FILES_32 := lib/libfmcust.so
else
LOCAL_SRC_FILES := lib/libfmcust.so
endif
include $(BUILD_PREBUILT)

106
rootdir/etc/fstab.mt6771 Normal file
View File

@@ -0,0 +1,106 @@
# 1 "vendor/mediatek/proprietary/hardware/fstab/mt6771/fstab.in.mt6771"
# 1 "<built-in>" 1
# 1 "<built-in>" 3
# 350 "<built-in>" 3
# 1 "<command line>" 1
# 1 "<built-in>" 2
# 1 "vendor/mediatek/proprietary/hardware/fstab/mt6771/fstab.in.mt6771" 2
# 125 "vendor/mediatek/proprietary/hardware/fstab/mt6771/fstab.in.mt6771"
system /system ext4 ro wait,logical,first_stage_mount
vendor /vendor ext4 ro wait,logical,first_stage_mount
product /product ext4 ro wait,logical,first_stage_mount
/dev/block/platform/bootdevice/by-name/md_udc /metadata ext4 noatime,nosuid,nodev,discard wait,formattable,first_stage_mount
/dev/block/platform/bootdevice/by-name/userdata /data ext4 noatime,nosuid,nodev,noauto_da_alloc,errors=panic wait,check,formattable,quota,resize,reservedsize=128m,checkpoint=block,fileencryption=aes-256-xts
/dev/block/platform/bootdevice/by-name/cache /cache ext4 noatime,nosuid,nodev,noauto_da_alloc,discard wait,check,formattable
/dev/block/platform/bootdevice/by-name/protect1 /mnt/vendor/protect_f ext4 noatime,nosuid,nodev,noauto_da_alloc,commit=1,nodelalloc wait,check,formattable
/dev/block/platform/bootdevice/by-name/protect2 /mnt/vendor/protect_s ext4 noatime,nosuid,nodev,noauto_da_alloc,commit=1,nodelalloc wait,check,formattable
/dev/block/platform/bootdevice/by-name/nvdata /mnt/vendor/nvdata ext4 noatime,nosuid,nodev,noauto_da_alloc,commit=1,nodelalloc wait,check,formattable
/dev/block/platform/bootdevice/by-name/nvcfg /mnt/vendor/nvcfg ext4 noatime,nosuid,nodev,noauto_da_alloc,commit=1,nodelalloc wait,check,formattable
/dev/block/platform/bootdevice/by-name/persist /mnt/vendor/persist ext4 noatime,nosuid,nodev,noauto_da_alloc,commit=1,nodelalloc wait,check,formattable
/dev/block/platform/bootdevice/by-name/apd /mnt/vendor/apd ext4 noatime,nosuid,nodev,noauto_da_alloc,commit=1,nodelalloc wait,check,formattable
/devices/platform/externdevice* auto auto defaults voldmanaged=sdcard1:auto,encryptable=userdata
/devices/platform/11200000.usb3_xhci* auto vfat defaults voldmanaged=usbotg:auto
/dev/block/platform/bootdevice/by-name/frp /persistent emmc defaults defaults
/dev/block/platform/bootdevice/by-name/nvram /nvram emmc defaults defaults
/dev/block/platform/bootdevice/by-name/proinfo /proinfo emmc defaults defaults
/dev/block/platform/bootdevice/by-name/lk /bootloader emmc defaults defaults
/dev/block/platform/bootdevice/by-name/lk2 /bootloader2 emmc defaults defaults
/dev/block/platform/bootdevice/by-name/para /misc emmc defaults defaults
/dev/block/platform/bootdevice/by-name/recovery /recovery emmc defaults first_stage_mount,nofail,
/dev/block/platform/bootdevice/by-name/boot /boot emmc defaults first_stage_mount,nofail,
/dev/block/platform/bootdevice/by-name/vbmeta_vendor /vbmeta_vendor emmc defaults first_stage_mount,nofail,
/dev/block/platform/bootdevice/by-name/vbmeta_system /vbmeta_system emmc defaults first_stage_mount,nofail,,avb=vbmeta
/dev/block/platform/bootdevice/by-name/logo /logo emmc defaults defaults
/dev/block/platform/bootdevice/by-name/expdb /expdb emmc defaults defaults
/dev/block/platform/bootdevice/by-name/seccfg /seccfg emmc defaults defaults
/dev/block/platform/bootdevice/by-name/tee1 /tee1 emmc defaults defaults
/dev/block/platform/bootdevice/by-name/tee2 /tee2 emmc defaults defaults
/dev/block/platform/bootdevice/by-name/scp1 /scp1 emmc defaults defaults
/dev/block/platform/bootdevice/by-name/scp2 /scp2 emmc defaults defaults
/dev/block/platform/bootdevice/by-name/sspm_1 /sspm_1 emmc defaults defaults
/dev/block/platform/bootdevice/by-name/sspm_2 /sspm_2 emmc defaults defaults
/dev/block/platform/bootdevice/by-name/md1img /md1img emmc defaults defaults
/dev/block/platform/bootdevice/by-name/md1dsp /md1dsp emmc defaults defaults
/dev/block/platform/bootdevice/by-name/md1arm7 /md1arm7 emmc defaults defaults
/dev/block/platform/bootdevice/by-name/md3img /md3img emmc defaults defaults
/dev/block/platform/bootdevice/by-name/cam_vpu1 /cam_vpu1 emmc defaults defaults
/dev/block/platform/bootdevice/by-name/cam_vpu2 /cam_vpu2 emmc defaults defaults
/dev/block/platform/bootdevice/by-name/cam_vpu3 /cam_vpu3 emmc defaults defaults
/dev/block/platform/bootdevice/by-name/gz1 /gz1 emmc defaults defaults
/dev/block/platform/bootdevice/by-name/gz2 /gz2 emmc defaults defaults
/dev/block/platform/bootdevice/by-name/spmfw /spmfw emmc defaults defaults
/dev/block/platform/bootdevice/by-name/boot_para /boot_para emmc defaults defaults
/dev/block/platform/bootdevice/by-name/odmdtbo /odmdtbo emmc defaults defaults
/dev/block/platform/bootdevice/by-name/dtbo /dtbo emmc defaults defaults
/dev/block/platform/bootdevice/by-name/otp /otp emmc defaults defaults
/dev/block/platform/bootdevice/by-name/vbmeta /vbmeta emmc defaults defaults

View File

@@ -0,0 +1,14 @@
on init
setprop sys.usb.ffs.aio_compat 1
# Custom overrides that need to happen right on boot
# Override vendor fstab
# We only need it to be overridden before things are mounted
mount none /system/etc/fstab.mt6771 /vendor/etc/fstab.mt6771 bind
on post-fs
# Unmount the overridden fstab because the SELinux label is incorrect
# and some MTK daemons can crash because of that
# (at post-fs, the fstab has already been used to mount the partitions,
# so it is fine to just revert back)
umount /vendor/etc/fstab.mt6771

BIN
rootdir/lib/libfmcust.so Normal file
View File

Binary file not shown.

BIN
rootdir/lib64/libfmcust.so Normal file
View File

Binary file not shown.

View File

@@ -0,0 +1,2 @@
type GoogleOtaBinder, domain, binderservicedomain, coredomain;
type ota_agent_service, service_manager_type;

View File

@@ -0,0 +1 @@
type aee_aed, domain, mlstrustedsubject, coredomain;

View File

@@ -0,0 +1 @@
type init_svc_aee_aedv_prop, property_type;

View File

@@ -0,0 +1 @@
type aee_core_forwarder, domain, coredomain;

1
sepolicy/public/atci.te Normal file
View File

@@ -0,0 +1 @@
type atci_service_sys, domain, coredomain;

View File

@@ -0,0 +1,14 @@
attribute mtk_hal_apm;
attribute mtk_hal_apm_client;
attribute mtk_hal_apm_server;
attribute mtk_hal_dmc;
attribute mtk_hal_dmc_client;
attribute mtk_hal_dmc_server;
attribute mtk_hal_lbs;
attribute mtk_hal_lbs_client;
attribute mtk_hal_lbs_server;
attribute mtk_hal_md_dbfilter;
attribute mtk_hal_md_dbfilter_client;
attribute hal_gpu;
attribute hal_gpu_client;
attribute hal_gpu_server;

View File

@@ -0,0 +1 @@
type boot_logo_updater, domain, coredomain;

View File

@@ -0,0 +1 @@
type camerapostalgo, domain, binderservicedomain, coredomain;

View File

@@ -0,0 +1 @@
type cmddumper, domain, coredomain;

View File

@@ -0,0 +1 @@
type connsyslogger, domain, coredomain;

View File

@@ -0,0 +1 @@
type dm_agent_binder_service, service_manager_type;

View File

@@ -0,0 +1 @@
type ctl_dualmdlogger_prop, property_type;

View File

@@ -0,0 +1 @@
type em_svr, domain, coredomain;

View File

@@ -0,0 +1,5 @@
type emdlogger, domain, binderservicedomain, coredomain;
type ctl_emdlogger1_prop, property_type;
type ctl_emdlogger2_prop, property_type;
type ctl_emdlogger3_prop, property_type;
type init_svc_emdlogger1_prop, property_type;

View File

@@ -0,0 +1 @@
type fpspolicy-server_service, service_manager_type;

View File

@@ -0,0 +1 @@
type gas_srv_service, service_manager_type;

View File

@@ -0,0 +1 @@
type kpoc_charger, domain, coredomain, halclientdomain, hal_health_client, hal_light_client;

View File

@@ -0,0 +1 @@
type loghidlsysservice, domain, coredomain;

View File

@@ -0,0 +1 @@
type lbs_dbg_data_file, file_type, data_file_type, core_data_file_type;

1
sepolicy/public/mcupm.te Normal file
View File

@@ -0,0 +1 @@
type mcupm_device, dev_type;

View File

@@ -0,0 +1 @@
type init_svc_md_monitor_prop, property_type;

View File

@@ -0,0 +1,2 @@
type mdlogger, domain, binderservicedomain, coredomain;
type ctl_mdlogger_prop, property_type;

View File

@@ -0,0 +1 @@
type met_log_d, domain, coredomain;

View File

@@ -0,0 +1 @@
type mobile_log_d, domain, coredomain;

View File

@@ -0,0 +1 @@
type modemdbfilter_client, domain, coredomain, halclientdomain, mtk_hal_md_dbfilter_client;

1
sepolicy/public/mtd.te Normal file
View File

@@ -0,0 +1 @@
type mtd_device, dev_type;

View File

@@ -0,0 +1,2 @@
type mtk_advcamserver, domain, binderservicedomain, coredomain;
type mtk_advcamserver_service, service_manager_type;

View File

@@ -0,0 +1 @@
type mtkbootanimation, domain, coredomain, halclientdomain, hal_configstore_client, hal_graphics_allocator_client, hal_graphics_composer_client;

View File

@@ -0,0 +1 @@
type mtk_permrecords_service, system_server_service, app_api_service, service_manager_type;

View File

@@ -0,0 +1 @@
type mtk_pkm_init_prop, property_type;

View File

@@ -0,0 +1 @@
type mtk_dmc_prop, property_type;

View File

@@ -0,0 +1,25 @@
type mtk_anrmanager_service, system_server_service, app_api_service, service_manager_type;
type mtk_appdetection_service, system_server_service, app_api_service, service_manager_type;
type mtk_autoboot_service, system_server_service, app_api_service, service_manager_type;
type mtk_carrierexpress_service, app_api_service, service_manager_type;
type mtk_data_shaping_service, system_server_service, app_api_service, service_manager_type;
type mtk_duraspeed_service, system_server_service, app_api_service, service_manager_type;
type mtk_epdg_service, system_server_service, app_api_service, service_manager_type;
type mtk_fm_radio_service, system_server_service, app_api_service, service_manager_type;
type mtk_fullscreen_switch_service, system_server_service, app_api_service, service_manager_type;
type mtk_gwsd_service, service_manager_type;
type mtk_hdmi_service, service_manager_type;
type mtk_mobile_service, system_server_service, app_api_service, service_manager_type;
type mtk_msg_monitor_service, system_server_service, app_api_service, service_manager_type;
type mtk_omadm_service, system_server_service, app_api_service, service_manager_type;
type mtk_perf_service, system_server_service, app_api_service, service_manager_type;
type mtk_phonesubinfo_service, app_api_service, service_manager_type;
type mtk_power_hal_mgr_service, system_server_service, app_api_service, service_manager_type;
type mtk_presence_service, service_manager_type;
type mtk_radio_service, service_manager_type;
type mtk_registry_service, app_api_service, service_manager_type;
type mtk_rns_service, system_server_service, app_api_service, service_manager_type;
type mtk_search_engine_service, system_server_service, app_api_service, service_manager_type;
type mtk_simphonebook_service, app_api_service, service_manager_type;
type mtk_telecom_service, system_server_service, app_api_service, service_manager_type;
type mtk_vowbridge_service, system_server_service, app_api_service, service_manager_type;

View File

@@ -0,0 +1 @@
type netdiag, domain, mlstrustedsubject, coredomain;

View File

@@ -0,0 +1 @@
type nvram_agent_service, service_manager_type;

View File

@@ -0,0 +1 @@
type ppl_agent_service, service_manager_type;

2
sepolicy/public/tee.te Normal file
View File

@@ -0,0 +1,2 @@
type tee_service, service_manager_type;
type teeregistry_service, service_manager_type;

View File

@@ -0,0 +1 @@
type terservice, domain, binderservicedomain, coredomain;

View File

@@ -0,0 +1 @@
type thermald, domain, coredomain;

View File

@@ -0,0 +1 @@
type usp_service, domain, coredomain;

View File

@@ -0,0 +1,2 @@
type vtservice_service, service_manager_type;
type vtservice_hidl_service, service_manager_type;

6
sepolicy/vendor/aee_aedv.te vendored Normal file
View File

@@ -0,0 +1,6 @@
type aee_aedv, domain, mlstrustedsubject, halclientdomain, hal_camera_client;
type aee_aedv_exec, file_type, exec_type, vendor_file_type;
init_daemon_domain(aee_aedv);
allow aee_aedv proc_ppm:dir {search};

3
sepolicy/vendor/agold.te vendored Normal file
View File

@@ -0,0 +1,3 @@
type proc_agold, fs_type, proc_type;
type sysfs_agold, fs_type, sysfs_type;
type agold_service, system_server_service, service_manager_type;

5
sepolicy/vendor/attributes vendored Normal file
View File

@@ -0,0 +1,5 @@
attribute mtkimsapdomain;
attribute hal_pq_client;
attribute mtk_hal_bgs;
attribute mtk_hal_bgs_server;
attribute hal_mtkcodecservice_client;

10
sepolicy/vendor/ccci_mdinit.te vendored Normal file
View File

@@ -0,0 +1,10 @@
type ccci_mdinit, domain, mtkimsapdomain, data_between_core_and_vendor_violators;
type ccci_mdinit_exec, file_type, exec_type, vendor_file_type;
init_daemon_domain(ccci_mdinit);
allow ccci_mdinit sysfs_dt_firmware_android:dir {read search open};
allow ccci_mdinit sysfs_dt_firmware_android:file {read getattr open};
allow ccci_mdinit mdlog_data_file:dir {ioctl read write create getattr setattr lock relabelto rename add_name remove_name reparent search rmdir open};
allow ccci_mdinit mdlog_data_file:fifo_file {ioctl read write create getattr setattr lock append map unlink rename open};
allow ccci_mdinit mdlog_data_file:file {ioctl read write create getattr setattr lock append map unlink rename open};

44
sepolicy/vendor/extmodule.te vendored Normal file
View File

@@ -0,0 +1,44 @@
type extmodule_device, dev_type;
type extmodule, domain, mlstrustedsubject, binderservicedomain, coredomain;
type extmodule_exec, file_type, exec_type, system_file_type;
type extmodule_service, service_manager_type;
init_daemon_domain(extmodule);
add_service(extmodule,extmodule_service);
binder_use(extmodule);
allow extmodule system_file:file {execute_no_trans};
allow extmodule system_data_file:dir {write create add_name};
allow extmodule system_data_file:file {read open};
allow extmodule self:capability {chown fowner fsetid net_raw};
allow extmodule self:capability2 {wake_alarm};
allow extmodule property_socket:sock_file {write};
allow extmodule init:unix_stream_socket {connectto};
allow extmodule system_prop:property_service {set};
allow extmodule system_prop:file {read getattr map open};
allow extmodule extmodule:tcp_socket {read write create getattr bind connect listen accept getopt setopt};
allow extmodule port:tcp_socket {name_bind};
allow extmodule node:tcp_socket {node_bind};
allow extmodule fwmarkd_socket:sock_file {write};
allow extmodule netd:unix_stream_socket {connectto};
allow extmodule sysfs_agold:file {read write getattr open};
allow extmodule shell_exec:file {read getattr map execute execute_no_trans open};
allow extmodule extmodule_device:dir {read write add_name open};
allow extmodule extmodule_device:file {read write create open};
allow extmodule extmodule_device:chr_file {read write open};
allow extmodule audio_device:dir {search};
allow extmodule audio_device:chr_file {ioctl read write getattr setattr map open};
allow extmodule ttyACM_device:chr_file {ioctl read write getattr setattr open};
allow extmodule storage_file:lnk_file {read};
allow extmodule tmpfs:dir {search};
allow extmodule sdcardfs:dir {search};
allow extmodule sdcardfs:file {read write getattr open};
allow extmodule mnt_user_file:dir {search};
allow extmodule mnt_user_file:lnk_file {read write};
allow extmodule media_rw_data_file:dir {read search open};
allow extmodule media_rw_data_file:file {read write getattr open};
allow extmodule usb_device:dir {read write search open};
allow extmodule usb_device:chr_file {ioctl read write open};
allow extmodule sysfs:dir {read open};
allow extmodule toolbox_exec:file {read getattr map execute execute_no_trans open};
allow extmodule extmodule_exec:file {getattr execute execute_no_trans};

35
sepolicy/vendor/file_contexts vendored Normal file
View File

@@ -0,0 +1,35 @@
/(system\/vendor|vendor)/bin/aee_aedv u:object_r:aee_aedv_exec:s0
/(system\/vendor|vendor)/bin/aee_aedv64 u:object_r:aee_aedv_exec:s0
/vendor/bin/aeev u:object_r:aee_aedv_exec:s0
/(system\/vendor|vendor)/bin/mtk_agpsd u:object_r:mtk_agpsd_exec:s0
/dev/socket/vendor.bip(/.*)? u:object_r:vendor_bip_socket:s0
/(system\/vendor|vendor)/bin/ccci_mdinit u:object_r:ccci_mdinit_exec:s0
/(system\/vendor|vendor)/bin/hw/vendor.chipsailing.fingerprint@1.0-service u:object_r:hal_fingerprint_default_exec:s0
/(vendor|system/vendor)/bin/hw/vendor.sw.swfingerprint@1.0-service u:object_r:hal_fingerprint_default_exec:s0
/(system\/vendor|vendor)/bin/fuelgauged_nvram u:object_r:fuelgauged_nvram_exec:s0
/(system\/vendor|vendor)/bin/nvram_daemon u:object_r:nvram_daemon_exec:s0
/vendor/bin/AguiNvramProximity u:object_r:nvram_daemon_exec:s0
/(system\/vendor|vendor)/bin/hw/android\.hardware\.audio@5\.0-service-mediatek u:object_r:mtk_hal_audio_exec:s0
/dev/socket/wfca(/.*)? u:object_r:wfca_socket:s0
/dev/socket/volte_imsa2(/.*)? u:object_r:volte_imsa2_socket:s0
/dev/socket/volte_ut(/.*)? u:object_r:volte_ut_socket:s0
/data/mdl(/.*)? u:object_r:mdlog_data_file:s0
/data/mdl3(/.*)? u:object_r:mdlog_data_file:s0
/data/mdlog(/.*)? u:object_r:mdlog_data_file:s0
/data/extmdl(/.*)? u:object_r:mdlog_data_file:s0
/(system\/vendor|vendor)/bin/mnld u:object_r:mnld_exec:s0
/(system\/vendor|vendor)/bin/hw/vtservice_hidl u:object_r:vtservice_hidl_exec:s0
/system/bin/vtservice u:object_r:vtservice_exec:s0
/vendor/bin/teed u:object_r:tkcore_exec:s0
/vendor/app/t6(/.*)? u:object_r:tkcore_systa_file:s0
/dev/stmcu u:object_r:extmodule_device:s0
/dev/ttyTTCMD u:object_r:extmodule_device:s0
/system/bin/dfu-util u:object_r:extmodule_exec:s0
/system/bin/extmodule u:object_r:extmodule_exec:s0
/dev/ttyACM0 u:object_r:ttyACM_device:s0
/dev/lepton u:object_r:lepton_device:s0
/dev/lepton_drv u:object_r:lepton_device:s0
/dev/lepton_i2c u:object_r:lepton_device:s0
/system/bin/apdServer u:object_r:lepton_exec:s0
/system/bin/leptonServer u:object_r:lepton_exec:s0
/(system\/vendor|vendor)/bin/hw/camerahalserver u:object_r:mtk_hal_camera_exec:s0

8
sepolicy/vendor/fuelgauged_nvram.te vendored Normal file
View File

@@ -0,0 +1,8 @@
type fuelgauged_nvram, domain;
type fuelgauged_nvram_exec, file_type, exec_type, vendor_file_type;
init_daemon_domain(fuelgauged_nvram);
allow fuelgauged_nvram sysfs_dt_firmware_android:dir {read search open};
allow fuelgauged_nvram sysfs_dt_firmware_android:file {read getattr open};
allow fuelgauged_nvram metadata_file:dir {search};

47
sepolicy/vendor/genfs_contexts vendored Normal file
View File

@@ -0,0 +1,47 @@
genfscon proc /agold_battery_temperature u:object_r:proc_agold:s0
genfscon proc /agold_camboard_id u:object_r:proc_agold:s0
genfscon proc /agold_lcmcam_info u:object_r:proc_agold:s0
genfscon proc /agold_otg_smt u:object_r:proc_agold:s0
genfscon proc /agold_tpd_info u:object_r:proc_agold:s0
genfscon proc /agold_typec_smt u:object_r:proc_agold:s0
genfscon proc /agold_wireless_firmware u:object_r:proc_agold:s0
genfscon proc /driver/agold_mem_info u:object_r:proc_agold:s0
genfscon proc /driver/agold_tpd_info u:object_r:proc_agold:s0
genfscon proc /driver/camera_lens u:object_r:proc_agold:s0
genfscon proc /driver/camera_lens_driver u:object_r:proc_agold:s0
genfscon proc /ppm u:object_r:proc_ppm:s0
genfscon sysfs /devices/platform/battery/power_supply/battery/BatteryAverageCurrent u:object_r:sysfs_agold:s0
genfscon sysfs /devices/platform/battery/power_supply/battery/PMICBATAverageCurrent u:object_r:sysfs_agold:s0
genfscon sysfs /devices/platform/mt_usb/musb-hdrc/usb[0-9]+/bConfigurationValue u:object_r:sysfs_agold:s0
genfscon sysfs /devices/platform/battery/power_supply/battery/ChargerVoltage u:object_r:sysfs_agold:s0
genfscon sysfs /devices/platform/mt_usb/musb-hdrc/usb[0-9]+/descriptors u:object_r:sysfs_agold:s0
genfscon sysfs /devices/platform/mt_usb/musb-hdrc/usb[0-9]+/1-1/busnum u:object_r:sysfs_agold:s0
genfscon sysfs /devices/platform/11200000.usb3_xhci/usb[0-9]+/devnum u:object_r:sysfs_agold:s0
genfscon sysfs /devices/platform/11200000.usb3_xhci/usb[0-9]+/busnum u:object_r:sysfs_agold:s0
genfscon sysfs /bus/platform/drivers/flashlights-mt6370/ledtimeout u:object_r:sysfs_agold:s0
genfscon sysfs /devices/platform/mt_usb/musb-hdrc/usb[0-9]+/busnum u:object_r:sysfs_agold:s0
genfscon sysfs /devices/platform/mt_usb/musb-hdrc/usb[0-9]+/devnum u:object_r:sysfs_agold:s0
genfscon sysfs /bus/platform/drivers/flashlights-mt6370/flashtest u:object_r:sysfs_agold:s0
genfscon sysfs /devices/platform/mt_usb/musb-hdrc/usb[0-9]+/speed u:object_r:sysfs_agold:s0
genfscon sysfs /bus/platform/drivers/flashlights-mt6370/agingtest u:object_r:sysfs_agold:s0
genfscon sysfs /bus/platform/drivers/flashlights-mt6370/ledduty u:object_r:sysfs_agold:s0
genfscon sysfs /bus/platform/drivers/agold_meta_card/agold_pad u:object_r:sysfs_agold:s0
genfscon sysfs /bus/platform/drivers/agold_meta_card/agold_tpd u:object_r:sysfs_agold:s0
genfscon sysfs /bus/platform/drivers/flashlights-mt6370/leden u:object_r:sysfs_agold:s0
genfscon sysfs /module/pad_setting/parameters/pad_load_status u:object_r:sysfs_agold:s0
genfscon sysfs /module/tpd_setting/parameters/tpd_load_status u:object_r:sysfs_agold:s0
genfscon sysfs /sys/devices/virtual/misc/sunwave_fp/irq u:object_r:sysfs_agold:s0
genfscon sysfs /devices/platform/mt_usb/musb-hdrc/mode u:object_r:sysfs_agold:s0
genfscon sysfs /bus/platform/drivers/gsensor/chipinfo u:object_r:sysfs_agold:s0
genfscon sysfs /agold_main2_yuv_value/main2_yuv_value u:object_r:sysfs_agold:s0
genfscon sysfs /bus/platform/drivers/als_ps/chipinfo u:object_r:sysfs_agold:s0
genfscon sysfs /bus/platform/drivers/mcu/handle_ptt u:object_r:sysfs_agold:s0
genfscon sysfs /sys/bus/platform/devices/cs_spi/irq u:object_r:sysfs_agold:s0
genfscon sysfs /bus/platform/drivers/mcu/mcu_power u:object_r:sysfs_agold:s0
genfscon sysfs /bus/platform/drivers/mcu/usb_path u:object_r:sysfs_agold:s0
genfscon sysfs /bus/platform/drivers/mcu/rstmcu u:object_r:sysfs_agold:s0
genfscon sysfs /class/switch/otg_state/state u:object_r:sysfs_agold:s0
genfscon sysfs /class/misc/pixart_ppg/enable u:object_r:sysfs_agold:s0
genfscon sysfs /board_version/modem_version u:object_r:sysfs_agold:s0
genfscon sysfs /hall_status/hall_status u:object_r:sysfs_agold:s0
genfscon sysfs /charger_sys/charger_sys u:object_r:sysfs_agold:s0

4
sepolicy/vendor/init.te vendored Normal file
View File

@@ -0,0 +1,4 @@
allow init vendor_bip_socket:sock_file {write create unlink};
allow init wfca_socket:sock_file {write create unlink};
allow init volte_imsa2_socket:sock_file {write create unlink};
allow init volte_ut_socket:sock_file {write create unlink};

26
sepolicy/vendor/lepton.te vendored Normal file
View File

@@ -0,0 +1,26 @@
type lepton_device, dev_type;
type lepton, domain, binderservicedomain, coredomain;
type lepton_exec, file_type, exec_type, system_file_type;
type lepton_service, service_manager_type;
init_daemon_domain(lepton);
add_service(lepton,lepton_service);
binder_use(lepton);
allow lepton init:unix_stream_socket {connectto};
allow lepton lepton_device:chr_file {ioctl read write open};
allow lepton lepton_device:dir {read write add_name open};
allow lepton lepton_device:file {read write create open};
allow lepton media_rw_data_file:dir {read write add_name search open};
allow lepton media_rw_data_file:file {read write create getattr setattr open};
allow lepton mnt_user_file:dir {search};
allow lepton mnt_user_file:lnk_file {read write};
allow lepton property_socket:sock_file {write};
allow lepton sdcardfs:dir {write add_name search};
allow lepton sdcardfs:file {read write create getattr open};
allow lepton storage_file:lnk_file {read write};
allow lepton sysfs_leds:dir {search};
allow lepton system_data_file:dir {write create add_name};
allow lepton system_data_file:file {read open};
allow lepton system_file:file {execute_no_trans};
allow lepton tmpfs:lnk_file {read};

1
sepolicy/vendor/mdlog.te vendored Normal file
View File

@@ -0,0 +1 @@
type mdlog_data_file, file_type, data_file_type, core_data_file_type;

9
sepolicy/vendor/mnld.te vendored Normal file
View File

@@ -0,0 +1,9 @@
type mnld, domain, mlstrustedsubject, netdomain;
type mnld_exec, file_type, exec_type, vendor_file_type;
init_daemon_domain(mnld);
allow mnld sysfs_dt_firmware_android:dir {read search open};
allow mnld sysfs_dt_firmware_android:file {read getattr open};
allow mnld proc_cmdline:file {ioctl read getattr lock map open};
allow mnld metadata_file:dir {search};

7
sepolicy/vendor/mtk_agpsd.te vendored Normal file
View File

@@ -0,0 +1,7 @@
type mtk_agpsd, domain, netdomain, halclientdomain, mtk_hal_apm_client;
type mtk_agpsd_exec, file_type, exec_type, vendor_file_type;
init_daemon_domain(mtk_agpsd);
binder_call(mtk_agpsd,system_suspend_server)
allow mtk_agpsd system_suspend_hwservice:hwservice_manager {find};

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