-Detects, decrypts, and mounts an adopted SD card if a secondary block device is defined (usually mmcblk1) -Handles unified storage -Displays the adopted storage in MTP along with internal -Factory Reset - wiped just like a data media device, we retain the keys folder and the storage.xml during a factory reset -Backup / Restore -Disable mass storage when adopted storage is present -Read storage nickname from storage.xml and apply it to display names in the GUI -Read storage.xml and determine what storage location is in use for /sdcard and remap accordingly libgpt_twrp is source code mostly kanged from an efimanager project. It is GPL v2 or higher, so we will opt for GPL v3. Change-Id: Ieda0030bec5155ba8d2b9167dc0016cebbf39d55
80 lines
2.1 KiB
Makefile
Executable File
80 lines
2.1 KiB
Makefile
Executable File
LOCAL_PATH := $(call my-dir)
|
|
|
|
# Build libtwrpmtp library
|
|
|
|
include $(CLEAR_VARS)
|
|
LOCAL_MODULE := libtwrpmtp
|
|
LOCAL_MODULE_TAGS := optional
|
|
LOCAL_CFLAGS = -D_FILE_OFFSET_BITS=64 -DMTP_DEVICE -DMTP_HOST -fno-strict-aliasing
|
|
LOCAL_C_INCLUDES += $(LOCAL_PATH) bionic frameworks/base/include system/core/include bionic/libc/private/
|
|
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23; echo $$?),0)
|
|
LOCAL_C_INCLUDES += external/stlport/stlport
|
|
endif
|
|
|
|
LOCAL_SRC_FILES = \
|
|
btree.cpp \
|
|
MtpDataPacket.cpp \
|
|
MtpDebug.cpp \
|
|
MtpDevice.cpp \
|
|
MtpDeviceInfo.cpp \
|
|
MtpEventPacket.cpp \
|
|
MtpObjectInfo.cpp \
|
|
MtpPacket.cpp \
|
|
MtpProperty.cpp \
|
|
MtpRequestPacket.cpp \
|
|
MtpResponsePacket.cpp \
|
|
MtpServer.cpp \
|
|
MtpStorage.cpp \
|
|
MtpStorageInfo.cpp \
|
|
MtpStringBuffer.cpp \
|
|
MtpUtils.cpp \
|
|
mtp_MtpServer.cpp \
|
|
twrpMtp.cpp \
|
|
mtp_MtpDatabase.cpp \
|
|
node.cpp
|
|
LOCAL_SHARED_LIBRARIES += libz libc libusbhost libstdc++ libdl libcutils libutils libaosprecovery
|
|
|
|
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23; echo $$?),0)
|
|
LOCAL_SHARED_LIBRARIES += libstlport
|
|
else
|
|
LOCAL_SHARED_LIBRARIES += libc++
|
|
endif
|
|
|
|
ifneq ($(TW_MTP_DEVICE),)
|
|
LOCAL_CFLAGS += -DUSB_MTP_DEVICE=$(TW_MTP_DEVICE)
|
|
endif
|
|
|
|
include $(BUILD_SHARED_LIBRARY)
|
|
|
|
# Build twrpmtp binary / executable
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
LOCAL_MODULE := twrpmtp
|
|
LOCAL_MODULE_TAGS := optional
|
|
LOCAL_CFLAGS = -D_FILE_OFFSET_BITS=64 -DMTP_DEVICE -DMTP_HOST -DTWRPMTP
|
|
LOCAL_C_INCLUDES += $(LOCAL_PATH) bionic frameworks/base/include system/core/include bionic/libc/private/
|
|
LOCAL_SRC_FILES = \
|
|
btree.cpp \
|
|
MtpDataPacket.cpp \
|
|
MtpDebug.cpp \
|
|
MtpDevice.cpp \
|
|
MtpDeviceInfo.cpp \
|
|
MtpEventPacket.cpp \
|
|
MtpObjectInfo.cpp \
|
|
MtpPacket.cpp \
|
|
MtpProperty.cpp \
|
|
MtpRequestPacket.cpp \
|
|
MtpResponsePacket.cpp \
|
|
MtpServer.cpp \
|
|
MtpStorage.cpp \
|
|
MtpStorageInfo.cpp \
|
|
MtpStringBuffer.cpp \
|
|
MtpUtils.cpp \
|
|
mtp_MtpServer.cpp \
|
|
twrpMtp.cpp \
|
|
mtp_MtpDatabase.cpp \
|
|
node.cpp
|
|
LOCAL_SHARED_LIBRARIES += libz libc libusbhost libstdc++ libdl libcutils libutils libaosprecovery
|
|
include $(BUILD_EXECUTABLE)
|