Compare commits

...
Author SHA1 Message Date
Nicholas Andrew
a738783cdd Merge legacy Forgejo history into current rtwo recovery tree 2026-09-09 04:50:44 -04:00
Nicholas Andrew
362b70d84d rtwo: fix logical partition mounts and recovery signing 2026-07-18 20:55:09 -04:00
Nicholas Andrew
736ed51710 recovery: derive KeyMint identity from installed ROM 2026-07-18 15:29:10 -04:00
Nicholas Andrew
97fb7344d5 recovery: validate stock KeyMint identity 2026-07-18 14:39:42 -04:00
BOBtheBlinker
0dd03ca6d6
rtwo: twrp.flags fix for OFRP OTG storage 2026-06-28 22:15:39 -04:00
Nicholas Andrew
b4574510b7 Thanks Everyonegit add README.md! 2026-06-28 20:38:15 -04:00
Nicholas Andrew
5439e444a0 rtwo: finalize Virtual A/B recovery support
Enable A/B OTA handling, add the QTI boot-control stack, correct slotted recovery partitions, and sanitize empty Virtual A/B state that blocks Format Data.
2026-06-28 19:58:01 -04:00
Nicholas Andrew
77e620c438 rtwo: correct maintainer avatar permissions 2026-06-26 22:21:24 -04:00
Nicholas Andrew
e82ccbd3e7 rtwo: update device documentation 2026-06-26 22:20:13 -04:00
Nicholas Andrew
3a05113aad rtwo: add OrangeFox maintainer metadata 2026-06-26 22:20:07 -04:00
Nicholas Andrew
91fa430546 rtwo: initialize recovery battery asynchronously 2026-06-26 22:03:45 -04:00
Nicholas Andrew
40f7488ea6 rtwo: clean recovery partition flags 2026-06-26 22:03:37 -04:00
Nicholas Andrew
32cdbdb12d rtwo: fix recovery reboot targets 2026-06-26 15:58:50 -04:00
Nicholas Andrew
6cfb382895 rtwo: resolve slotted dynamic partitions in recovery 2026-06-26 15:39:36 -04:00
Nicholas Andrew
40ac1fb59b rtwo: remove nonexistent cache partition 2026-06-26 13:43:59 -04:00
Nicholas Andrew
f6d2493460 rtwo: port QTI FBE decryption stack 2026-06-26 13:16:49 -04:00
Nicholas Andrew
18132065b6 rtwo: recovery: mount metadata as f2fs
Match the stock Android 13 fstab so recovery can mount the metadata partition and access the metadata encryption key directory.
2026-06-25 20:12:59 -04:00
Nicholas Andrew
29d008ba34 rtwo: recovery: enable AIDL haptics
Add the official Android 13 rtwo QTI/RichTap vibrator service, libraries, calibration data, init service, and VINTF manifest. Enable TWRP input AIDL haptics with the fix-off workaround.
2026-06-25 19:42:47 -04:00
Nicholas Andrew
f7308b21d0 rtwo: defer crypto startup until secure services are ready 2026-06-25 02:31:17 -04:00
Nicholas Andrew
59e954f646 rtwo: defer metadata decryption services 2026-06-25 01:39:29 -04:00
Nicholas Andrew
abb6561403 rtwo: enable generic FBE support without QCOM services 2026-06-25 01:32:36 -04:00
TheSithLordDarthImperivious
2de1dc9639 Delete unnecessary files 2025-01-10 20:33:37 -05:00
Darth Imperivious
b658207216
Delete recovery/root/system/etc/ueventd.rtwo.rc
It is probably not needed, and ueventd.rc already has everything it has anyways.
2025-01-10 19:46:55 -05:00
TheSithLordDarthImperivious
4d9c705acf Add ueventd for rtwo (not sure if this is even needed) 2025-01-10 19:34:19 -05:00
TheSithLordDarthImperivious
1e2f94ed51 Working USB and auto-generate working recovery.img 2025-01-10 19:32:51 -05:00
Darth Imperivious
789855a4fa
Update README.md 2025-01-09 21:43:53 -05:00
Darth Imperivious
17fbc8233b
Add warning 2025-01-09 21:32:38 -05:00
Darth Imperivious
7a9f38b495
Update README.md 2025-01-09 21:21:52 -05:00
Darth Imperivious
92d359f0ae
Update available featureset 2025-01-09 21:11:16 -05:00
Darth Imperivious
d048d8f8b4
Add the rest (90 modules) 2025-01-09 20:58:14 -05:00
Darth Imperivious
2b20a1bcdf
Add another 100 kernel modules/modules data 2025-01-09 20:55:16 -05:00
Darth Imperivious
6dd95c37dc
Add 100 kernel modules 2025-01-09 20:52:22 -05:00
Darth Imperivious
46185faaa3
Delete recovery/root/temp 2025-01-09 20:46:28 -05:00
Darth Imperivious
1be0d01a6e
Create modules structure 2025-01-09 20:46:00 -05:00
Darth Imperivious
653fd0fb85
Add some recovery/root files 2025-01-09 20:39:03 -05:00
Darth Imperivious
03f9f35a7f
Create recovery tree folder structure 2025-01-09 20:37:10 -05:00
Darth Imperivious
80396baa27
Add everything except the recovery folder 2025-01-09 20:33:19 -05:00
Darth Imperivious
509dc6c64a
Update README.md for more info 2025-01-09 20:12:49 -05:00
Darth Imperivious
2b2b94715c
Update README.md
Add basic readme
2025-01-09 16:08:53 -05:00
Darth Imperivious
71991bb7ed
Initial commit 2025-01-09 16:01:32 -05:00
397 changed files with 5618 additions and 311 deletions

View file

@ -1,6 +0,0 @@
// Copyright (C) 2024 The Android Open Source Project
// Copyright (C) 2024 SebaUbuntu's TWRP device tree generator
// Copyright (C) 2019 - Current | A-Team Digital Solutions
soong_namespace {
}

View file

@ -1,6 +1,8 @@
# Copyright (C) 2024 The Android Open Source Project
# Copyright (C) 2024 SebaUbuntu's TWRP device tree generator
# Copyright (C) 2019 - Current | A-Team Digital Solutions
#
# Copyright (C) 2023 The Android Open Source Project
#
# SPDX-License-Identifier: Apache-2.0
#
LOCAL_PATH := $(call my-dir)

View file

@ -1,11 +1,11 @@
# Copyright (C) 2024 The Android Open Source Project
# Copyright (C) 2024 SebaUbuntu's TWRP device tree generator
# Copyright (C) 2019 - Current | A-Team Digital Solutions
#
# Copyright (C) 2023 The Android Open Source Project
#
# SPDX-License-Identifier: Apache-2.0
#
PRODUCT_MAKEFILES := \
$(LOCAL_DIR)/twrp_rtwo.mk
COMMON_LUNCH_CHOICES := \
twrp_rtwo-user \
twrp_rtwo-userdebug \
twrp_rtwo-eng

File diff suppressed because one or more lines are too long

View file

@ -1,7 +1,7 @@
Device configuration for Moto Edge+ (2023) (codenamed "rtwo")
=========================================
The Motorola Moto Edge+ (2023) (codenamed _"rtwo"_) is a upper-range smartphone from Motorola Mobility announced in May 2023.
The Motorola Moto Edge+ (2023) (codenamed _"rtwo"_) is an upper-range smartphone from Motorola Mobility announced in May 2023.
## Device specifications
@ -14,42 +14,48 @@ Memory | 8 GB RAM (LPDDR4X)
Shipped Android Version | 13.0, My UX 3.0 (Global)
Storage | 512 GB (UFS 4.0)
Battery | Non-removable Li-Po 5100 mAh battery
Display | OLED, 165 Hz, 2400 x 1080 pixels, 6.67 inches (~395 ppi density)
Camera | 50MP (Wide) + 50MP (Ultra-wide) + 12MP (Telephoto) + 60MP (Selfie)
Display | LTPS, 120 Hz, 2400 x 1080 pixels, 6.67 inches (~403 ppi density)
Camera | 50MP (Wide) + 12MP (Telephoto) + 50MP (Ultra-wide) + 60MP (Selfie)
## Device picture
![Motorola Moto Edge+ (2023)](https://fdn2.gsmarena.com/vv/bigpic/motorola-edge-plus-2023.jpg)
# Status
Current state of features:
- [ ] Correct screen/recovery size
- [ ] Working touch, display
- [ ] Screen goes off and on
- [ ] Backup/restore to/from internal/external storage and adb
- [ ] Poweroff
- [ ] Reboot to system, bootloader, recovery, fastboot, edl
- [ ] ADB (including sideload)
- [ ] Support EROFS/F2FS/EXT4/exFAT/FAT32/NTFS
- [ ] Decrypt /data
- [ ] Flashing zip/images
- [ ] MTP export
- [ ] All important partitions listed in wipe/mount/backup lists
- [ ] Input devices via USB-OTG
- [ ] USB mass storage export
- [ ] Correct date
- [ ] Battery level
- [ ] Set brightness
- [ ] Vibrate and set vibration
- [ ] Screenshot
- [ ] Advanced features
- [X] Correct screen/recovery size
- [X] Working touch, display
- [x] Screen goes off and on
- [X] Backup/restore to/from internal/external storage and adb
- [X] Poweroff
- [X] Reboot to system, bootloader, recovery, fastboot, edl
- [X] ADB (including sideload)
- [X] Support EROFS/F2FS/EXT4/exFAT/FAT32/NTFS
- [X] Decrypt /data
- [X] Flashing zip/images
- [X] MTP export
- [X] All important partitions listed in wipe/mount/backup lists
- [X] Input devices via USB-OTG
- [X] USB mass storage export
- [X] Correct date
- [X] Battery level
- [X] Set brightness
- [X] Vibrate and set vibration
- [X] Screenshot
- [X] Advanced features
# Building
```bash
export ALLOW_MISSING_DEPENDENCIES=true
source build/envsetup.sh
lunch twrp_rtwo-eng
mka recoveryimage -j$(nproc --all)
m recoveryimage -j$(nproc --all)
```
**Copyright (C) 2023 Team Win Recovery Project**<br>
**Copyright (C) 2025 A-Team Digital Solutions**
**Copyright (C) 2025 A-Team Digital Solutions**<br><br>
<sub>Special thanks to TheSithLordDarthImperivious for the tree base, and to TRWSTE for inspiring me to take a shot at cracking decryption.</sub><br><br>
<sub>Thanks also to everyone in the Brazilian RTWO DEV's Telegram group for the testing, motivation, and support.</sub><br><br>
<sub>And, as always, thanks to our fearless leader, PizzaG98! For he taught me most of what I know!</sub>

14
bootimg.mk Normal file
View file

@ -0,0 +1,14 @@
#MKBOOTIMG := device/motorola/rtwo/mkbootimg
FLASH_IMAGE_TARGET ?= $(PRODUCT_OUT)/recovery.tar
$(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_FILES) $(BOOTIMAGE_EXTRA_DEPS)
$(call pretty,"Target boot image: $@")
$(hide) $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $@
$(hide) echo -n "SEANDROIDENFORCE" >> $@
@echo "Made boot image: $@"
$(INSTALLED_RECOVERYIMAGE_TARGET): $(MKBOOTIMG) $(recovery_ramdisk) $(recovery_kernel) $(RECOVERYIMAGE_EXTRA_DEPS)
@echo "----- Making bootable recovery image for rtwo ------"
$(MKBOOTIMG) --ramdisk $(PRODUCT_OUT)/ramdisk-recovery.img --base $(BOARD_KERNEL_BASE) --pagesize $(BOARD_KERNEL_PAGESIZE) --dtb $(TARGET_PREBUILT_DTB) --os_version 14 --os_patch_level 2024-12-01 --header_version $(BOARD_BOOT_HEADER_VERSION) --output $@
@echo "DONE! You can now flash the image using fastboot flash."

View file

@ -1,32 +1,50 @@
# Copyright (C) 2024 The Android Open Source Project
# Copyright (C) 2024 SebaUbuntu's TWRP device tree generator
# Copyright (C) 2019 - Current | A-Team Digital Solutions
#
# Copyright (C) 2023 The Android Open Source Project
# Copyright (C) 2019-Present A-Team Digital Solutions
# 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.
#
LOCAL_PATH := device/motorola/rtwo
# A/B
AB_OTA_POSTINSTALL_CONFIG += \
RUN_POSTINSTALL_system=true \
POSTINSTALL_PATH_system=system/bin/otapreopt_script \
FILESYSTEM_TYPE_system=ext4 \
POSTINSTALL_OPTIONAL_system=true
# Boot control HAL
# Dynamic partitions
PRODUCT_USE_DYNAMIC_PARTITIONS := true
# fastbootd
PRODUCT_PACKAGES += \
android.hardware.boot@1.0-impl \
android.hardware.boot@1.0-service
android.hardware.fastboot@1.0-impl-mock \
fastbootd
# qcom decryption
PRODUCT_PACKAGES += \
bootctrl.kalama
qcom_decrypt \
qcom_decrypt_fbe
PRODUCT_STATIC_BOOT_CONTROL_HAL := \
bootctrl.kalama \
libgptutils \
libz \
libcutils
# Dependencies
TARGET_RECOVERY_DEVICE_MODULES += \
android.hidl.allocator@1.0 \
android.hidl.memory@1.0 \
android.hidl.memory.token@1.0 \
libhidlmemory \
libion \
libdmabufheap
PRODUCT_PACKAGES += \
otapreopt_script \
cppreopts.sh \
update_engine \
update_verifier \
update_engine_sideload
RECOVERY_LIBRARY_SOURCE_FILES += \
$(TARGET_OUT_SHARED_LIBRARIES)/android.hidl.allocator@1.0.so \
$(TARGET_OUT_SHARED_LIBRARIES)/android.hidl.memory@1.0.so \
$(TARGET_OUT_SHARED_LIBRARIES)/android.hidl.memory.token@1.0.so \
$(TARGET_OUT_SHARED_LIBRARIES)/libhidlmemory.so \
$(TARGET_OUT_SHARED_LIBRARIES)/libion.so \
$(TARGET_OUT_SHARED_LIBRARIES)/libdmabufheap.so
# Enable Fuse Passthrough
PRODUCT_PROPERTY_OVERRIDES += persist.sys.fuse.passthrough.enable=true

View file

@ -1,61 +0,0 @@
#!/bin/bash
#
# Copyright (C) 2016 The CyanogenMod Project
# Copyright (C) 2017-2020 The LineageOS Project
#
# SPDX-License-Identifier: Apache-2.0
#
set -e
DEVICE=rtwo
VENDOR=motorola
# Load extract_utils and do some sanity checks
MY_DIR="${BASH_SOURCE%/*}"
if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi
ANDROID_ROOT="${MY_DIR}/../../.."
HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh"
if [ ! -f "${HELPER}" ]; then
echo "Unable to find helper script at ${HELPER}"
exit 1
fi
source "${HELPER}"
# Default to sanitizing the vendor folder before extraction
CLEAN_VENDOR=true
KANG=
SECTION=
while [ "${#}" -gt 0 ]; do
case "${1}" in
-n | --no-cleanup )
CLEAN_VENDOR=false
;;
-k | --kang )
KANG="--kang"
;;
-s | --section )
SECTION="${2}"; shift
CLEAN_VENDOR=false
;;
* )
SRC="${1}"
;;
esac
shift
done
if [ -z "${SRC}" ]; then
SRC="adb"
fi
# Initialize the helper
setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" false "${CLEAN_VENDOR}"
extract "${MY_DIR}/proprietary-files.txt" "${SRC}" "${KANG}" --section "${SECTION}"
"${MY_DIR}/setup-makefiles.sh"

BIN
maintainer.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

View file

@ -1,70 +0,0 @@
# Copyright (C) 2019 - Current | A-Team Digital Solutions
/system ext4 system flags=display=system;logical;slotselect
/system_ext ext4 system_ext flags=display=system_ext;logical;slotselect
/product ext4 product flags=display=product;logical;slotselect
/vendor ext4 vendor flags=display=vendor;logical;slotselect
/vendor_dlkm ext4 vendor_dlkm flags=display=vendor_dlkm;logical;slotselect
/system_dlkm ext4 system_dlkm flags=display=system_dlkm;logical;slotselect
/metadata f2fs /dev/block/by-name/metadata flags=display=metadata
/mnt/vendor/persist ext4 /dev/block/bootdevice/by-name/persist flags=display=persist
/mnt/product/persist ext4 /dev/block/bootdevice/by-name/prodpersist flags=display=persist
/data f2fs /dev/block/bootdevice/by-name/userdata flags=display=data
/misc emmc /dev/block/bootdevice/by-name/misc flags=display=misc
/storage/usbotg vfat /devices/platform/soc/*.ssusb/*.dwc3/xhci-hcd.*.auto* flags=display=usbotg
/vendor/firmware_mnt ext4 /dev/block/bootdevice/by-name/modem flags=display=firmware_mnt;slotselect
/vendor/dsp ext4 /dev/block/bootdevice/by-name/dsp flags=display=dsp;slotselect
/vendor/bt_firmware ext4 /dev/block/bootdevice/by-name/bluetooth flags=display=bt_firmware;slotselect
/vendor/fsg ext4 /dev/block/bootdevice/by-name/fsg flags=display=fsg;slotselect
########### stock recovery.fstab from vanFirmware #######################################################################################
#/system erofs system flags=display=system;logical;slotselect
#/system ext4 system flags=display=system;logical;slotselect
#/system_ext erofs system_ext flags=display=system_ext;logical;slotselect
#/product erofs product flags=display=product;logical;slotselect
#/vendor erofs vendor flags=display=vendor;logical;slotselect
#/metadata f2fs /dev/block/bootdevice/by-name#/metadata flags=display=metadata
#/data f2fs /dev/block/bootdevice/by-name/userdata flags=display=data
#/sdcard vfat /dev/block#/mmcblk0p1 flags=display=sdcard
#/boot emmc /dev/block/bootdevice/by-name/boot flags=display=boot
#/misc emmc /dev/block/bootdevice/by-name#/misc flags=display=misc
########### recovery.fstab from PizzaG's milanf #######################################################################################
#system /system ext4 rw,discard wait,slotselect,logical,first_stage_mount
#system_ext /system_ext ext4 rw,discard wait,slotselect,logical,first_stage_mount
#product /product ext4 rw,discard wait,slotselect,logical,first_stage_mount
#vendor /vendor ext4 rw,discard wait,slotselect,logical,first_stage_mount
#/dev/block/by-name/metadata /metadata ext4 noatime,nosuid,nodev,discard,data=ordered,barrier=1 wait,check,formattable,first_stage_mount
#/dev/block/bootdevice/by-name/persist /mnt/vendor/persist ext4 noatime,nosuid,nodev,data=ordered,barrier=1 wait
#/dev/block/bootdevice/by-name/prodpersist /mnt/product/persist ext4 noatime,nosuid,nodev,data=ordered,barrier=1 wait,formattable,nofail
#/dev/block/bootdevice/by-name/userdata /data f2fs noatime,nosuid,nodev,discard,inlinecrypt,reserve_root=32768,resgid=1065,fsync_mode=nobarrier latemount,wait,check,formattable,encryptable=aes-256-#xts:aes-256-cts:v2+inlinecrypt_optimized+wrappedkey_v0,keydirectory=/metadata/vold/metadata_encryption,metadata_encryption=aes-256-xts:wrappedkey_v0,quota,sysfs_path=/sys/devices/platform/soc/4804000.ufshc,reservedsize=128M,checkpoint=fs
#/dev/block/bootdevice/by-name/misc /misc emmc defaults defaults
##/devices/platform/soc/4784000.sdhci/mmc_host* /storage/sdcard1 vfat nosuid,nodev wait,voldmanaged=sdcard1:auto
##/devices/platform/soc/*.ssusb/*.dwc3/xhci-hcd.*.auto* /storage/usbotg vfat nosuid,nodev wait,voldmanaged=usbotg:auto
#/dev/block/bootdevice/by-name/modem /vendor/firmware_mnt ext4 ro,nosuid,nodev,context=u:object_r:firmware_file:s0 wait,slotselect
#/dev/block/bootdevice/by-name/dsp /vendor/dsp ext4 ro,nosuid,nodev,barrier=1 wait,slotselect
#/dev/block/bootdevice/by-name/bluetooth /vendor/bt_firmware ext4 ro,nosuid,nodev,context=u:object_r:bt_firmware_file:s0 wait,slotselect
#/dev/block/bootdevice/by-name/fsg /vendor/fsg ext4 ro,nosuid,nodev,context=u:object_r:fsg_file:s0 wait,slotselect
#/dev/block/zram0 none swap defaults zramsize=75%
########### genevn working decryption recovery.fstab from teamwin #######################################################################################
#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
#system /system ext4 ro,barrier=1,discard wait,slotselect,avb=vbmeta_system,logical,first_stage_mount,avb_keys=/avb/q-gsi.avbpubkey:/avb/r-gsi.avbpubkey:/avb/s-#gsi.avbpubkey
#system /system erofs ro wait,slotselect,avb=vbmeta_system,logical,first_stage_mount,avb_keys=/avb/q-gsi.avbpubkey:/avb/r-gsi.avbpubkey:/avb/s-#gsi.a>
#system_ext /system_ext ext4 ro,barrier=1,discard wait,slotselect,avb=vbmeta_system,logical,first_stage_mount
#system_ext /system_ext erofs ro wait,slotselect,avb=vbmeta_system,logical,first_stage_mount
#product /product ext4 ro,barrier=1,discard wait,slotselect,avb=vbmeta_system,logical,first_stage_mount
#product /product erofs ro wait,slotselect,avb=vbmeta_system,logical,first_stage_mount
#vendor /vendor ext4 ro,barrier=1,discard wait,slotselect,avb,logical,first_stage_mount
#vendor /vendor erofs ro wait,slotselect,avb,logical,first_stage_mount
#vendor_dlkm /vendor_dlkm ext4 ro,barrier=1,discard wait,slotselect,avb,logical,first_stage_mount
#vendor_dlkm /vendor_dlkm erofs ro wait,slotselect,avb,logical,first_stage_mount
#/dev/block/by-name/metadata /metadata ext4 noatime,nosuid,nodev,discard wait,check,formattable,first_stage_mount
#/dev/block/bootdevice/by-name/userdata /data f2fs noatime,nosuid,nodev,discard,reserve_root=32768,resgid=1065,fsync_mode=nobarrier,inlinecrypt latemount,wait,check,formattable,fileencryption=aes-256-#xts:aes-256-cts:v2+inlinecrypt_optimized+wrappedkey_v0,keydirectory=/metadata/vold/metadata_encryption,metadata_encryption=aes-256-xts:wrappedkey_v0,quota,reservedsize=128M,sysfs_path=/sys/devices/platform/soc/1d84000.ufshc,checkpoint=fs
#/dev/block/bootdevice/by-name/misc /misc emmc defaults defaults

15
recovery/root/dsms.rc Normal file
View file

@ -0,0 +1,15 @@
on post-fs-data
mkdir /efs/dsms 0310 vendor_dsms vendor_dsms
chown vendor_dsms vendor_dsms /efs/dsms/recovery.log
chmod 0660 /efs/dsms/recovery.log
chown vendor_dsms vendor_dsms /efs/dsms/factory.log
chmod 0660 /efs/dsms/factory.log
restorecon_recursive /efs/dsms
on post-fs-data && property:ro.boot.boot_recovery=0
mkdir /data/local/dsms 0110 vendor_dsms vendor_dsms
rm /data/local/dsms/preboot.log
write /data/local/dsms/preboot.log ""
chown vendor_dsms vendor_dsms /data/local/dsms/preboot.log
chmod 0660 /data/local/dsms/preboot.log
restorecon_recursive /data/local/dsms

View file

@ -0,0 +1,9 @@
service dsmsd /system/bin/dsms
class core
user vendor_dsms
group vendor_dsms
disabled
oneshot
on boot
start dsmsd

View file

@ -0,0 +1,17 @@
# set up the global environment
on early-init
export ANDROID_BOOTLOGO 1
export ANDROID_ROOT /system
export ANDROID_ASSETS /system/app
export ANDROID_DATA /data
export ANDROID_STORAGE /storage
export ANDROID_ART_ROOT /apex/com.android.art
export ANDROID_I18N_ROOT /apex/com.android.i18n
export ANDROID_TZDATA_ROOT /apex/com.android.tzdata
export EXTERNAL_STORAGE /sdcard
export ASEC_MOUNTPOINT /mnt/asec

View file

@ -1,5 +1,5 @@
# Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
#
# Copyright (c) 2017-2018,2020 The Linux Foundation. All rights reserved.
# Copyright (C) 2019-Present A-Team Digital Solutions
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
@ -25,13 +25,78 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
import /init.recovery.qcom_decrypt.rc
import /vendor/etc/init/init.spdaemon.rc
import /vendor/etc/init/init.vendor.qti.spu@1.1-service.rc
import /vendor/etc/init/init.spuservice.rc
import /init.recovery.rtwo.gatekeeper.rc
service rtwo-crypto-identity /system/bin/rtwo-crypto-identity.sh
user root
group root
disabled
oneshot
seclabel u:r:recovery:s0
on init
setprop twrp.defer.decrypt false
# to cut charging battery path
write /sys/class/power_supply/battery/siop_level 0
setprop prepdecrypt.setpatch false
setprop sys.usb.configfs 1
on early-init
start rtwo-crypto-identity
on fs
wait /dev/block/platform/soc/${ro.boot.bootdevice}
symlink /dev/block/platform/soc/${ro.boot.bootdevice} /dev/block/bootdevice
mkdir /dev/block/mapper 0755 root root
symlink /dev/block/mapper/system${ro.boot.slot_suffix} /dev/block/mapper/system
symlink /dev/block/mapper/vendor${ro.boot.slot_suffix} /dev/block/mapper/vendor
symlink /dev/block/mapper/product${ro.boot.slot_suffix} /dev/block/mapper/product
symlink /dev/block/mapper/system_ext${ro.boot.slot_suffix} /dev/block/mapper/system_ext
symlink /dev/block/mapper/system_dlkm${ro.boot.slot_suffix} /dev/block/mapper/system_dlkm
symlink /dev/block/mapper/vendor_dlkm${ro.boot.slot_suffix} /dev/block/mapper/vendor_dlkm
mkdir /persist 0771 root system
mkdir /mnt/vendor 0755 root root
mkdir /mnt/vendor/persist 0771 root system
mount ext4 /dev/block/bootdevice/by-name/persist /persist
mount none /persist /mnt/vendor/persist bind
# Mount slot-selected modem firmware for ADSP, PMIC, and USB-C
mkdir /vendor/firmware_mnt 0755 root root
mount ext4 /dev/block/bootdevice/by-name/modem${ro.boot.slot_suffix} /vendor/firmware_mnt ro
write /proc/sys/kernel/firmware_config/force_sysfs_fallback 1
export ANDROID_ROOT /system_root
# Mount bootdevice
service rtwo-battery-bootstrap /system/bin/rtwo-battery-bootstrap.sh
class core
user root
group root
disabled
oneshot
seclabel u:r:recovery:s0
on boot
start health-hal-2-1
start rtwo-battery-bootstrap
on property:ro.boot.usbcontroller=*
setprop sys.usb.controller ${ro.boot.usbcontroller}
write /sys/class/udc/${ro.boot.usbcontroller}/device/../mode peripheral
on fs
wait /dev/block/platform/soc/${ro.boot.bootdevice}
symlink /dev/block/platform/soc/${ro.boot.bootdevice} /dev/block/bootdevice
service rtwo-vab-state-sanitize /system/bin/rtwo-vab-state-sanitize.sh
class core
user root
group root
disabled
oneshot
seclabel u:r:recovery:s0
on boot
start rtwo-vab-state-sanitize

View file

@ -0,0 +1,20 @@
service gatekeeper-rtwo /system/bin/android.hardware.gatekeeper@1.0-service-qti
class early_hal
user system
group system
setenv LD_LIBRARY_PATH /vendor/lib64:/vendor/lib:/system/lib64:/system/lib:/sbin
disabled
seclabel u:r:recovery:s0
on property:vendor.sys.listeners.registered=true
stop gatekeeper-1-0
stop gatekeeper-1-0-qti
stop qseecomd
setprop vendor.gatekeeper.is_security_level_spu 0
start vendor.spdaemon
start vendor.sec_nvm
start spu_service
start spuservice
on property:init.svc.vendor.spdaemon=running && property:init.svc.vendor.sec_nvm=running && property:init.svc.spu_service=running && property:init.svc.spuservice=running && property:vendor.sys.listeners.registered=true
start gatekeeper-rtwo

View file

@ -0,0 +1,97 @@
# Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of The Linux Foundation nor
# the names of its contributors may be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
on property:ro.boot.usbcontroller=*
setprop sys.usb.controller ${ro.boot.usbcontroller}
on fs
mount configfs none /config
mkdir /config/usb_gadget/g1 0770 shell shell
write /config/usb_gadget/g1/idVendor 0x18D1
mkdir /config/usb_gadget/g1/strings/0x409 0770
write /config/usb_gadget/g1/strings/0x409/serialnumber ${ro.serialno}
write /config/usb_gadget/g1/strings/0x409/manufacturer ${ro.product.manufacturer}
write /config/usb_gadget/g1/strings/0x409/product ${ro.product.model}
mkdir /config/usb_gadget/g1/functions/ffs.adb
mkdir /config/usb_gadget/g1/functions/ffs.fastboot
mkdir /config/usb_gadget/g1/functions/ffs.mtp
mkdir /config/usb_gadget/g1/configs/b.1 0777 shell shell
mkdir /config/usb_gadget/g1/configs/b.1/strings/0x409 0770 shell shell
mkdir /dev/usb-ffs 0775 shell shell
mkdir /dev/usb-ffs/adb 0770 shell shell
mkdir /dev/usb-ffs/mtp 0770 mtp mtp
mount functionfs adb /dev/usb-ffs/adb uid=2000,gid=2000
mkdir /dev/usb-ffs/fastboot 0770 system system
mount functionfs fastboot /dev/usb-ffs/fastboot rmode=0770,fmode=0660,uid=1000,gid=1000
mount functionfs mtp /dev/usb-ffs/mtp uid=2000,gid=2000
on property:sys.usb.config=adb
start adbd
on property:sys.usb.config=mtp,adb
start adbd
on property:sys.usb.config=fastboot
start fastbootd
on property:sys.usb.config=none
write /config/usb_gadget/g1/UDC "none"
stop adbd
stop fastbootd
setprop sys.usb.ffs.ready 0
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/ffs.mtp
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=sideload && property:sys.usb.ffs.ready=1
write /config/usb_gadget/g1/idProduct 0xD001
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "adb"
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f1
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=adb && property:sys.usb.ffs.ready=1
write /config/usb_gadget/g1/idProduct 0xD001
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "adb"
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f1
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=mtp,adb && property:sys.usb.ffs.ready=1
write /config/usb_gadget/g1/idProduct 0x6860
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "mtp,adb"
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/ffs.mtp /config/usb_gadget/g1/configs/b.1/ffs.mtp
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=fastboot && property:sys.usb.ffs.ready=1
write /config/usb_gadget/g1/idProduct 0xD001
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "fastboot"
symlink /config/usb_gadget/g1/functions/ffs.fastboot /config/usb_gadget/g1/configs/b.1/f1
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

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