mirror of
https://github.com/meizu-m86/twrp_multirom_m86
synced 2025-11-04 06:15:41 +08:00
Fix compatibility across the board
Change-Id: I6376920775ddabb4d4af505fffd86e404403a64a
This commit is contained in:
19
Android.mk
19
Android.mk
@@ -119,7 +119,10 @@ LOCAL_SHARED_LIBRARIES += libaosprecovery libz libc libcutils libstdc++ libtar l
|
||||
LOCAL_SHARED_LIBRARIES += libcrecovery
|
||||
|
||||
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23; echo $$?),0)
|
||||
LOCAL_SHARED_LIBRARIES += libstlport libmincrypttwrp
|
||||
LOCAL_SHARED_LIBRARIES += libstlport
|
||||
endif
|
||||
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 24; echo $$?),0)
|
||||
LOCAL_SHARED_LIBRARIES += libmincrypttwrp
|
||||
LOCAL_C_INCLUDES += $(LOCAL_PATH)/libmincrypt/includes
|
||||
LOCAL_CFLAGS += -DUSE_OLD_VERIFIER
|
||||
else
|
||||
@@ -563,12 +566,18 @@ LOCAL_CFLAGS := -std=gnu++0x
|
||||
LOCAL_SRC_FILES := adb_install.cpp asn1_decoder.cpp bootloader.cpp legacy_property_service.cpp set_metadata.cpp tw_atomic.cpp
|
||||
LOCAL_SHARED_LIBRARIES += libc liblog libcutils libmtdutils libfusesideload libselinux
|
||||
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23; echo $$?),0)
|
||||
LOCAL_SHARED_LIBRARIES += libstdc++ libstlport libmincrypttwrp
|
||||
LOCAL_C_INCLUDES := bionic external/stlport/stlport $(LOCAL_PATH)/libmincrypt/includes
|
||||
LOCAL_SHARED_LIBRARIES += libstdc++ libstlport
|
||||
LOCAL_C_INCLUDES := bionic external/stlport/stlport
|
||||
else
|
||||
LOCAL_SHARED_LIBRARIES += libc++
|
||||
endif
|
||||
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 24; echo $$?),0)
|
||||
LOCAL_SHARED_LIBRARIES += libmincrypttwrp
|
||||
LOCAL_C_INCLUDES := $(LOCAL_PATH)/libmincrypt/includes
|
||||
LOCAL_SRC_FILES += oldverifier/verifier.cpp
|
||||
LOCAL_CFLAGS += -DUSE_OLD_VERIFIER
|
||||
else
|
||||
LOCAL_SHARED_LIBRARIES += libc++ libcrypto
|
||||
LOCAL_SHARED_LIBRARIES += libcrypto
|
||||
LOCAL_SRC_FILES += verifier.cpp
|
||||
endif
|
||||
|
||||
@@ -638,7 +647,7 @@ include $(commands_recovery_local_path)/injecttwrp/Android.mk \
|
||||
$(commands_recovery_local_path)/adbbu/Android.mk \
|
||||
$(commands_recovery_local_path)/libpixelflinger/Android.mk
|
||||
|
||||
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23; echo $$?),0)
|
||||
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 24; echo $$?),0)
|
||||
include $(commands_recovery_local_path)/libmincrypt/Android.mk
|
||||
endif
|
||||
|
||||
|
||||
@@ -29,6 +29,9 @@ LOCAL_CFLAGS = -D_FILE_OFFSET_BITS=64 -fno-strict-aliasing
|
||||
LOCAL_C_INCLUDES += bionic external/zlib
|
||||
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23; echo $$?),0)
|
||||
LOCAL_C_INCLUDES += external/stlport/stlport
|
||||
LOCAL_SHARED_LIBRARIES += libstlport
|
||||
else
|
||||
LOCAL_SHARED_LIBRARIES += libc++
|
||||
endif
|
||||
|
||||
LOCAL_SRC_FILES = \
|
||||
@@ -36,10 +39,4 @@ LOCAL_SRC_FILES = \
|
||||
|
||||
LOCAL_SHARED_LIBRARIES += libz libc libstdc++
|
||||
|
||||
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23; echo $$?),0)
|
||||
LOCAL_SHARED_LIBRARIES += libstlport
|
||||
else
|
||||
LOCAL_SHARED_LIBRARIES += libc++
|
||||
endif
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
@@ -7,6 +7,7 @@ minadbd_cflags := \
|
||||
-Wno-unused-parameter \
|
||||
-Wno-missing-field-initializers \
|
||||
-DADB_HOST=0 \
|
||||
-DPLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ int adb_server_main(int is_daemon, int server_port, int /* reply_fd */) {
|
||||
init_transport_registration();
|
||||
usb_init();
|
||||
|
||||
VLOG(ADB) << "Event loop starting";
|
||||
//VLOG(ADB) << "Event loop starting";
|
||||
fdevent_loop();
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -73,7 +73,12 @@ static int create_service_thread(void (*func)(int, void *), void *cookie) {
|
||||
sti->cookie = cookie;
|
||||
sti->fd = s[1];
|
||||
|
||||
#if PLATFORM_SDK_VERSION == 23
|
||||
adb_thread_t t;
|
||||
if (adb_thread_create( &t, (adb_thread_func_t)service_bootstrap_func, sti)){
|
||||
#else
|
||||
if (!adb_thread_create(service_bootstrap_func, sti)) {
|
||||
#endif
|
||||
free(sti);
|
||||
adb_close(s[0]);
|
||||
adb_close(s[1]);
|
||||
@@ -81,7 +86,7 @@ static int create_service_thread(void (*func)(int, void *), void *cookie) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
VLOG(SERVICES) << "service thread started, " << s[0] << ":" << s[1];
|
||||
//VLOG(SERVICES) << "service thread started, " << s[0] << ":" << s[1];
|
||||
return s[0];
|
||||
}
|
||||
|
||||
@@ -102,3 +107,10 @@ int service_to_fd(const char* name, const atransport* transport) {
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
#if PLATFORM_SDK_VERSION == 23
|
||||
int service_to_fd(const char* name) {
|
||||
atransport transport;
|
||||
return service_to_fd(name, &transport);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -108,6 +108,8 @@ int res_create_display_surface(const char* name, GRSurface** pSurface);
|
||||
// by row.
|
||||
int res_create_multi_display_surface(const char* name, int* frames,
|
||||
int* fps, GRSurface*** pSurface);
|
||||
int res_create_multi_display_surface(const char* name, int* frames,
|
||||
GRSurface*** pSurface);
|
||||
|
||||
// Load a single alpha surface from a grayscale PNG image.
|
||||
int res_create_alpha_surface(const char* name, GRSurface** pSurface);
|
||||
|
||||
@@ -323,6 +323,12 @@ exit:
|
||||
return result;
|
||||
}
|
||||
|
||||
int res_create_multi_display_surface(const char* name, int* frames,
|
||||
GRSurface*** pSurface) {
|
||||
int fps = 0;
|
||||
return res_create_multi_display_surface(name, frames, &fps, pSurface);
|
||||
}
|
||||
|
||||
int res_create_alpha_surface(const char* name, GRSurface** pSurface) {
|
||||
GRSurface* surface = NULL;
|
||||
int result = 0;
|
||||
|
||||
@@ -9,6 +9,9 @@ LOCAL_CFLAGS = -D_FILE_OFFSET_BITS=64 -DMTP_DEVICE -DMTP_HOST -fno-strict-aliasi
|
||||
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
|
||||
LOCAL_SHARED_LIBRARIES += libstlport
|
||||
else
|
||||
LOCAL_SHARED_LIBRARIES += libc++
|
||||
endif
|
||||
|
||||
LOCAL_SRC_FILES = \
|
||||
@@ -34,12 +37,6 @@ LOCAL_SRC_FILES = \
|
||||
node.cpp
|
||||
LOCAL_SHARED_LIBRARIES += libz libc libusbhost libstdc++ libdl libcutils libutils libaosprecovery libselinux
|
||||
|
||||
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
|
||||
|
||||
@@ -91,7 +91,7 @@ ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23; echo $$?),0)
|
||||
RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libstlport.so
|
||||
RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libgccdemangle.so
|
||||
endif
|
||||
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 23; echo $$?),0)
|
||||
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 23; echo $$?),0)
|
||||
RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libcrypto.so
|
||||
RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libpackagelistparser.so
|
||||
RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/liblzma.so
|
||||
@@ -233,6 +233,9 @@ ifeq ($(TWRP_INCLUDE_LOGCAT), true)
|
||||
RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libsysutils.so
|
||||
RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libnl.so
|
||||
endif
|
||||
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 24; echo $$?),0)
|
||||
RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libpcrecpp.so
|
||||
endif
|
||||
endif
|
||||
TWRP_AUTOGEN := $(intermediates)/teamwin
|
||||
GEN := $(intermediates)/teamwin
|
||||
|
||||
2
twrp.cpp
2
twrp.cpp
@@ -59,6 +59,8 @@ extern "C" {
|
||||
struct selabel_handle *selinux_handle;
|
||||
#endif
|
||||
|
||||
extern int adb_server_main(int is_daemon, int server_port, int /* reply_fd */);
|
||||
|
||||
TWPartitionManager PartitionManager;
|
||||
int Log_Offset;
|
||||
bool datamedia;
|
||||
|
||||
@@ -14,12 +14,10 @@ LOCAL_SRC_FILES:= \
|
||||
LOCAL_CFLAGS:= -g -c -W -DBUILD_TWRPTAR_MAIN
|
||||
|
||||
LOCAL_C_INCLUDES += bionic
|
||||
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23; echo $$?),0)
|
||||
LOCAL_C_INCLUDES += external/stlport/stlport bionic/libstdc++/include
|
||||
endif
|
||||
|
||||
LOCAL_STATIC_LIBRARIES := libc libtar_static
|
||||
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23; echo $$?),0)
|
||||
LOCAL_C_INCLUDES += external/stlport/stlport bionic/libstdc++/include
|
||||
LOCAL_STATIC_LIBRARIES += libstlport_static
|
||||
endif
|
||||
LOCAL_STATIC_LIBRARIES += libstdc++
|
||||
@@ -59,8 +57,13 @@ LOCAL_SRC_FILES:= \
|
||||
../gui/twmsg.cpp
|
||||
LOCAL_CFLAGS:= -g -c -W -DBUILD_TWRPTAR_MAIN
|
||||
|
||||
LOCAL_C_INCLUDES += bionic external/stlport/stlport
|
||||
LOCAL_SHARED_LIBRARIES := libc libtar libstlport libstdc++
|
||||
LOCAL_C_INCLUDES += bionic
|
||||
LOCAL_SHARED_LIBRARIES := libc libtar
|
||||
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23; echo $$?),0)
|
||||
LOCAL_C_INCLUDES += external/stlport/stlport bionic/libstdc++/include
|
||||
LOCAL_SHARED_LIBRARIES += libstlport_static
|
||||
endif
|
||||
LOCAL_SHARED_LIBRARIES += libstdc++
|
||||
|
||||
ifeq ($(TWHAVE_SELINUX), true)
|
||||
LOCAL_C_INCLUDES += external/libselinux/include
|
||||
|
||||
Reference in New Issue
Block a user