From 6e3689adfb20f59bf2726f53fcb6364eab1474d2 Mon Sep 17 00:00:00 2001 From: ragarcia87 <70825623+juic3b0x@users.noreply.github.com> Date: Mon, 26 Sep 2022 11:59:55 -0500 Subject: [PATCH 1/2] Delete twrp.dependencies --- twrp.dependencies | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 twrp.dependencies diff --git a/twrp.dependencies b/twrp.dependencies deleted file mode 100644 index 7d92806..0000000 --- a/twrp.dependencies +++ /dev/null @@ -1,14 +0,0 @@ -[ - { - "remote": "LineageOS", - "repository": "android_hardware_qcom_bootctrl", - "target_path": "hardware/qcom-caf/bootctrl", - "branch": "lineage-19.1-caf" - } - { - "remote": "TeamWin", - "repository": "android_device_qcom_twrp-common", - "target_path": "device/qcom/twrp-common", - "branch": "android-12.1" - }, -] From 0b9ac8a7f05646f7542c4537fcd33678953da646 Mon Sep 17 00:00:00 2001 From: ragarcia87 Date: Sun, 2 Oct 2022 13:32:56 -0500 Subject: [PATCH 2/2] WIP -- testing fastbootd fix --- device.mk | 15 ++++- ...android.hardware.fastboot@1.0-impl-mock.so | Bin 15984 -> 0 bytes recovery/root/init.recovery.qcom.rc | 1 + recovery/root/init.recovery.usb.rc | 60 ++++++++++++------ system.prop | 2 + 5 files changed, 57 insertions(+), 21 deletions(-) delete mode 100644 prebuilt/android.hardware.fastboot@1.0-impl-mock.so diff --git a/device.mk b/device.mk index bfa6f43..2837422 100644 --- a/device.mk +++ b/device.mk @@ -89,6 +89,17 @@ TARGET_USES_MKE2FS := true TW_NO_SCREEN_BLANK := true TW_EXCLUDE_APEX := true +# TWRP Debug Flags +TARGET_USES_LOGD := true +TWRP_EVENT_LOGGING := false +TWRP_INCLUDE_LOGCAT := true +TARGET_RECOVERY_DEVICE_MODULES += debuggerd +TW_RECOVERY_ADDITIONAL_RELINK_FILES += $(TARGET_OUT_EXECUTABLES)/debuggerd + +# TWRP Installer +RECOVERY_INSTALLER_PATH := bootable/recovery/installer +USE_RECOVERY_INSTALLER := true + # Crypto TW_USE_FSCRYPT_POLICY := 1 TW_INCLUDE_CRYPTO := true @@ -119,9 +130,7 @@ PRODUCT_COPY_FILES += \ $(LOCAL_PATH)/prebuilt/libandroidicu.so:$(TARGET_COPY_OUT_RECOVERY)/root/system/lib64/libandroidicu.so \ $(LOCAL_PATH)/prebuilt/android.hardware.boot@1.0-impl-1.1-qti.so:$(TARGET_COPY_OUT_RECOVERY)/root/system/lib64/hw/android.hardware.boot@1.0-impl-1.1-qti.so \ $(LOCAL_PATH)/prebuilt/librecovery_updater_msm.so:$(TARGET_COPY_OUT_RECOVERY)/root/system/lib64/librecovery_updater_msm.so \ - $(LOCAL_PATH)/prebuilt/libboot_control_qti.so:$(TARGET_COPY_OUT_RECOVERY)/root/system/lib64/libboot_control_qti.so \ - $(LOCAL_PATH)/prebuilt/android.hardware.fastboot@1.0-impl-mock.so:$(TARGET_COPY_OUT_RECOVERY)/root/system/lib64/hw/android.hardware.fastboot@1.0-impl-mock.so - + $(LOCAL_PATH)/prebuilt/libboot_control_qti.so:$(TARGET_COPY_OUT_RECOVERY)/root/system/lib64/libboot_control_qti.so PRODUCT_PACKAGES += \ qcom_decrypt \ qcom_decrypt_fbe diff --git a/prebuilt/android.hardware.fastboot@1.0-impl-mock.so b/prebuilt/android.hardware.fastboot@1.0-impl-mock.so deleted file mode 100644 index f0afb94ccaec4b0ce4b2929a16170445e3d60881..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15984 zcmeHOd2keE7XRi52@oJaKu{rrXFQmlNkT}x$Zdi#L$y%-Xf3W$*o=^Jcn#>u?c?>)0_x+D z!P{{ZazoVp(fxpF12 z!xpqNDoo9}I{Z~S{M|bI+2A0Y{mnZ3WXMN2`H&9(Jso}wBqE%h$vXUdb@(so@b~EO zW1%C$`Ayg1m+0^-b@+Gb@Mpz__xpkl|2!B-;o|(e4nJ;ic=>uA{`Wfk)FI*R)ame_ z(cx#uhqqIx!!Oa{3p#wi4!;a0`zSV?C7z{Bno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y9X7<=~<3}Zp`Q-Zji+>C}zP-Hgi&*=Mar-6P8(X)gT>jdg zC+>^g_;SnWq08R-?@O;_-g0BbV;4QL>4ACv#qBYhHq6f)kubbs`S;f3clPePeRbM& z^8ugdwjJl@y>a)Q=}TRo|FV4dV}(8bEq}h?qH6Jn7k{z!-gG*9*fS)R8Frbrz}jV7 z+S+)9ZP;pgwi~X4Za>L_>jX|+T6eU+ccXQL+?eTvfa6ZxMq=m zTE_@8xB~jXkxlC+#dRz2aLploT9*hZL$r>P9N}!x$2E*-TE_@2P>+TDYvX?q>V8t` z(>h96Dr+mh|HD&?pR*Y}t7aG*`KNW7kk)CEr~QrSrHXDj>C-+%Nc$AEpZt@Z8$lnx zFCu-~w+JcE6}e+&^JF8RiBkezJ$#DEg;;m|1uY$1IIQ4aqJ6akaj7-)rIK z2xuQB+Qs#$f9d-(!mPduMME1u`od3cBjJ5GN_Nke0j=t0d-j^Q5!}{mb M6{%k}3L29A51g^sI{*Lx diff --git a/recovery/root/init.recovery.qcom.rc b/recovery/root/init.recovery.qcom.rc index 5fce2a2..9bc99b0 100644 --- a/recovery/root/init.recovery.qcom.rc +++ b/recovery/root/init.recovery.qcom.rc @@ -1,4 +1,5 @@ import /init.recovery.qcom_decrypt.rc +import /init.recovery.usb.rc on init write /sys/class/backlight/panel0-backlight/brightness 200 diff --git a/recovery/root/init.recovery.usb.rc b/recovery/root/init.recovery.usb.rc index d185f52..5eee014 100644 --- a/recovery/root/init.recovery.usb.rc +++ b/recovery/root/init.recovery.usb.rc @@ -25,26 +25,27 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # -on early-init - setprop sys.usb.configfs 0 - on init mkdir /config mount configfs none /config mkdir /config/usb_gadget/g1 0770 shell shell write /config/usb_gadget/g1/bcdUSB 0x0200 - write /config/usb_gadget/g1/idVendor 0x18d1 - write /config/usb_gadget/g1/idProduct 0xd001 + write /config/usb_gadget/g1/idVendor 0x22b8 + write /config/usb_gadget/g1/idProduct 0x2e81 mkdir /config/usb_gadget/g1/strings/0x409 0770 shell shell 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/mass_storage.0 mkdir /config/usb_gadget/g1/functions/mtp.gs0 write /config/usb_gadget/g1/os_desc/use 1 write /config/usb_gadget/g1/os_desc/b_vendor_code 0x1 write /config/usb_gadget/g1/os_desc/qw_sign "MSFT100" + mkdir /config/usb_gadget/g1/configs/b.1 0777 shell shell + symlink /config/usb_gadget/g1/configs/b.1 /config/usb_gadget/g1/os_desc/b.1 + mkdir /config/usb_gadget/g1/configs/b.1/strings/0x409 0770 shell shell setprop sys.usb.configfs 1 on boot @@ -77,21 +78,23 @@ on property:sys.usb.ffs.ready=1 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} -on property:sys.usb.config=mtp && property:vendor.usb.use_ffs_mtp=1 && property:sys.usb.configfs=1 +on property:sys.usb.config=none && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/UDC "none" + stop adbd + setprop sys.usb.ffs.ready 0 + write /config/usb_gadget/g1/bDeviceClass 0 + write /config/usb_gadget/g1/bDeviceSubClass 0 + write /config/usb_gadget/g1/bDeviceProtocol 0 rm /config/usb_gadget/g1/configs/b.1/f1 - symlink /config/usb_gadget/g1/functions/ffs.mtp /config/usb_gadget/g1/configs/b.1/f1 - -on property:sys.usb.config=mtp && property:sys.usb.configfs=1 - write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "mtp" rm /config/usb_gadget/g1/configs/b.1/f2 rm /config/usb_gadget/g1/configs/b.1/f3 - rm /config/usb_gadget/g1/configs/b.1/f4 - rm /config/usb_gadget/g1/configs/b.1/f5 - write /config/usb_gadget/g1/idVendor 0x0B05 - write /config/usb_gadget/g1/idProduct 0x7772 - write /config/usb_gadget/g1/UDC ${sys.usb.controller} + rmdir /config/usb_gadget/g1/functions/rndis.gs4 setprop sys.usb.state ${sys.usb.config} +on property:init.svc.adbd=stopped + setprop sys.usb.ffs.ready 0 + +# Recovery Mode- ADB & MTP on property:sys.usb.config=mtp,adb && property:sys.usb.configfs=1 start adbd @@ -111,6 +114,7 @@ on property:sys.usb.ffs.ready=1 && property:sys.usb.config=mtp,adb && property:s write /config/usb_gadget/g1/UDC ${sys.usb.controller} setprop sys.usb.state ${sys.usb.config} +# Mass Storage USB Mode on property:sys.usb.config=mass_storage && property:sys.usb.configfs=1 write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "msc" rm /config/usb_gadget/g1/configs/b.1/f1 @@ -128,6 +132,7 @@ on property:sys.usb.config=mass_storage && property:sys.usb.configfs=1 write /config/usb_gadget/g1/UDC ${sys.usb.controller} setprop sys.usb.state ${sys.usb.config} +# Mass Storage & ADB USB Mode on property:sys.usb.config=mass_storage,adb && property:sys.usb.configfs=1 start adbd @@ -149,6 +154,25 @@ on property:sys.usb.ffs.ready=1 && property:sys.usb.config=mass_storage,adb && p write /config/usb_gadget/g1/UDC ${sys.usb.controller} setprop sys.usb.state ${sys.usb.config} -on property:ro.boot.usbcontroller=* - setprop sys.usb.controller ${ro.boot.usbcontroller} - write /sys/class/udc/${ro.boot.usbcontroller}/device/../mode peripheral +# FastbootD ADB Functionality +on property:sys.usb.config=adb && property:sys.usb.configfs=1 + start adbd + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=adb && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "Motorola Recovery 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} + +# FastbootD fastboot Functionality +on property:sys.usb.config=fastboot && property:sys.usb.ffs.ready=1 && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/UDC "none" + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "Motorola Recovery Fastboot" + rm /config/usb_gadget/g1/configs/b.1/f1 + rm /config/usb_gadget/g1/configs/b.1/f2 + rm /config/usb_gadget/g1/configs/b.1/f3 + write /config/usb_gadget/g1/idVendor 0x22b8 + write /config/usb_gadget/g1/idProduct 0x2e80 + 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} diff --git a/system.prop b/system.prop index 862e4ad..57e4997 100644 --- a/system.prop +++ b/system.prop @@ -1,3 +1,5 @@ +ro.adb.secure=0 + # Audio audio.offload.min.duration.secs=30 persist.vendor.audio.hac.enable=false