Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8373cfe2 authored by Ethan Yonker's avatar Ethan Yonker
Browse files

Update to AOSP 8.0 base

Change-Id: I29fe722b4eb9718765327902779046840a01433e
parents 95e80075 43348a62
Loading
Loading
Loading
Loading

.clang-format

0 → 100644
+15 −0
Original line number Diff line number Diff line
BasedOnStyle: Google
AllowShortBlocksOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: true

ColumnLimit: 100
CommentPragmas: NOLINT:.*
DerivePointerAlignment: false
IndentWidth: 2
PointerAlignment: Left
TabWidth: 2
UseTab: Never
PenaltyExcessCharacter: 32

Cpp11BracedListStyle: false
+73 −19
Original line number Diff line number Diff line
@@ -104,24 +104,25 @@ LOCAL_CLANG := true

LOCAL_C_INCLUDES += \
    system/vold \
    system/extras/ext4_utils \
    system/extras \
    system/core/adb \
    system/core/libsparse \
    external/zlib
    external/zlib \
    $(LOCAL_PATH)/bootloader_message_twrp/include

LOCAL_C_INCLUDES += bionic
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23; echo $$?),0)
    LOCAL_C_INCLUDES += external/stlport/stlport external/openssl/include
else
    LOCAL_C_INCLUDES += external/boringssl/include
    LOCAL_C_INCLUDES += external/boringssl/include external/libcxx/include
endif

LOCAL_STATIC_LIBRARIES :=
LOCAL_SHARED_LIBRARIES :=

LOCAL_STATIC_LIBRARIES += libguitwrp
LOCAL_SHARED_LIBRARIES += libaosprecovery libz libc libcutils libstdc++ libtar libblkid libminuitwrp libminadbd libmtdutils libminzip libtwadbbu libbootloader_message
LOCAL_SHARED_LIBRARIES += libcrecovery libtwadbbu libtwrpdigest
LOCAL_SHARED_LIBRARIES += libaosprecovery libz libc libcutils libstdc++ libtar libblkid libminuitwrp libminadbd libmtdutils libtwadbbu libbootloader_message_twrp
LOCAL_SHARED_LIBRARIES += libcrecovery libtwadbbu libtwrpdigest libc++

ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23; echo $$?),0)
    LOCAL_SHARED_LIBRARIES += libstlport
@@ -132,13 +133,20 @@ ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 24; echo $$?),0)
    LOCAL_C_INCLUDES += $(LOCAL_PATH)/libmincrypt/includes
    LOCAL_CFLAGS += -DUSE_OLD_VERIFIER
else
    LOCAL_SHARED_LIBRARIES += libc++ libcrypto
    LOCAL_SHARED_LIBRARIES += libcrypto
endif

ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 24; echo $$?),0)
    LOCAL_SHARED_LIBRARIES += libbase
endif

ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 26; echo $$?),0)
   LOCAL_SHARED_LIBRARIES += libziparchive
else
    LOCAL_SHARED_LIBRARIES += libminzip
    LOCAL_CFLAGS += -DUSE_MINZIP
endif

ifneq ($(wildcard system/core/libsparse/Android.mk),)
LOCAL_SHARED_LIBRARIES += libsparse
endif
@@ -161,14 +169,14 @@ ifeq ($(TARGET_USERIMAGES_USE_EXT4), true)
endif
LOCAL_C_INCLUDES += external/libselinux/include
LOCAL_SHARED_LIBRARIES += libselinux
ifneq ($(TARGET_USERIMAGES_USE_EXT4), true)
    LOCAL_CFLAGS += -DUSE_EXT4
    LOCAL_C_INCLUDES += system/extras/ext4_utils
    LOCAL_SHARED_LIBRARIES += libext4_utils
    ifneq ($(wildcard external/lz4/Android.mk),)
        LOCAL_STATIC_LIBRARIES += liblz4
    endif
endif
#ifneq ($(TARGET_USERIMAGES_USE_EXT4), true)
#    LOCAL_CFLAGS += -DUSE_EXT4
#    LOCAL_C_INCLUDES += system/extras/ext4_utils
#    LOCAL_SHARED_LIBRARIES += libext4_utils
#    ifneq ($(wildcard external/lz4/Android.mk),)
#        LOCAL_STATIC_LIBRARIES += liblz4
#    endif
#endif

ifeq ($(AB_OTA_UPDATER),true)
    LOCAL_CFLAGS += -DAB_OTA_UPDATER=1
@@ -304,7 +312,7 @@ ifeq ($(TW_INCLUDE_CRYPTO), true)
    endif
endif
WITH_CRYPTO_UTILS := \
    $(if $(wildcard system/core/libcrypto_utils/Android.mk),true)
    $(if $(wildcard system/core/libcrypto_utils/android_pubkey.c),true)
ifeq ($(TW_USE_MODEL_HARDWARE_ID_FOR_DEVICE_ID), true)
    LOCAL_CFLAGS += -DTW_USE_MODEL_HARDWARE_ID_FOR_DEVICE_ID
endif
@@ -370,7 +378,8 @@ LOCAL_ADDITIONAL_DEPENDENCIES += \
    mkfs.fat \
    permissive.sh \
    simg2img_twrp \
    libbootloader_message \
    libbootloader_message_twrp \
    init.recovery.hlthchrg.rc \
    init.recovery.service.rc

ifneq ($(TARGET_ARCH), arm64)
@@ -589,6 +598,37 @@ else
endif
include $(BUILD_SHARED_LIBRARY)

# libmounts (static library)
# ===============================
include $(CLEAR_VARS)
LOCAL_SRC_FILES := mounts.cpp
LOCAL_CLANG := true
LOCAL_CFLAGS := -Wall -Wno-unused-parameter -Werror
LOCAL_MODULE := libmounts
include $(BUILD_STATIC_LIBRARY)

# librecovery (static library)
# ===============================
include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
    install.cpp
LOCAL_CFLAGS := -Wno-unused-parameter -Werror
LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION)

ifeq ($(AB_OTA_UPDATER),true)
    LOCAL_CFLAGS += -DAB_OTA_UPDATER=1
endif

LOCAL_MODULE := librecovery
LOCAL_STATIC_LIBRARIES := \
    libminui \
    libvintf_recovery \
    libcrypto_utils \
    libcrypto \
    libbase

include $(BUILD_STATIC_LIBRARY)

# shared libaosprecovery for Apache code
# ===============================
include $(CLEAR_VARS)
@@ -596,7 +636,7 @@ include $(CLEAR_VARS)
LOCAL_MODULE := libaosprecovery
LOCAL_MODULE_TAGS := eng optional
LOCAL_CFLAGS := -std=gnu++0x
LOCAL_SRC_FILES := adb_install.cpp asn1_decoder.cpp legacy_property_service.cpp set_metadata.cpp tw_atomic.cpp installcommand.cpp
LOCAL_SRC_FILES := adb_install.cpp legacy_property_service.cpp set_metadata.cpp tw_atomic.cpp installcommand.cpp zipwrap.cpp
LOCAL_SHARED_LIBRARIES += libc liblog libcutils libmtdutils libfusesideload libselinux libminzip
LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION)
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23; echo $$?),0)
@@ -608,15 +648,23 @@ 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 += verifier24/verifier.cpp
    LOCAL_SRC_FILES += verifier24/verifier.cpp verifier24/asn1_decoder.cpp
    LOCAL_CFLAGS += -DUSE_OLD_VERIFIER
else
    LOCAL_SHARED_LIBRARIES += libcrypto libbase
    LOCAL_SRC_FILES += verifier.cpp
    LOCAL_SRC_FILES += verifier.cpp asn1_decoder.cpp
endif
ifeq ($(AB_OTA_UPDATER),true)
    LOCAL_CFLAGS += -DAB_OTA_UPDATER=1
endif
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 26; echo $$?),0)
    LOCAL_SRC_FILES += otautil/ZipUtil.cpp otautil/SysUtil.cpp
    LOCAL_SHARED_LIBRARIES += libziparchive libext4_utils libcrypto libcrypto_utils
    LOCAL_STATIC_LIBRARIES += libvintf_recovery libfs_mgr liblogwrap libavb libvintf libtinyxml2 libz
    LOCAL_WHOLE_STATIC_LIBRARIES +=
else
    LOCAL_CFLAGS += -DUSE_MINZIP
endif

include $(BUILD_SHARED_LIBRARY)

@@ -638,6 +686,7 @@ include $(LOCAL_PATH)/tests/Android.mk \
    $(LOCAL_PATH)/edify/Android.mk \
    $(LOCAL_PATH)/otafault/Android.mk \
    $(LOCAL_PATH)/bootloader_message/Android.mk \
    $(LOCAL_PATH)/bootloader_message_twrp/Android.mk \
    $(LOCAL_PATH)/updater/Android.mk \
    $(LOCAL_PATH)/update_verifier/Android.mk \
    $(LOCAL_PATH)/applypatch/Android.mk
@@ -647,6 +696,10 @@ ifeq ($(wildcard system/core/uncrypt/Android.mk),)
endif

ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 22; echo $$?),0)
    ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 26; echo $$?),0)
        TARGET_GLOBAL_CFLAGS += -DTW_USE_MINUI_WITH_DATA
        CLANG_TARGET_GLOBAL_CFLAGS += -DTW_USE_MINUI_WITH_DATA
    endif
    include $(commands_recovery_local_path)/minadbd/Android.mk \
        $(commands_recovery_local_path)/minui/Android.mk
else
@@ -669,6 +722,7 @@ include $(commands_recovery_local_path)/injecttwrp/Android.mk \
    $(commands_recovery_local_path)/libcrecovery/Android.mk \
    $(commands_recovery_local_path)/libblkid/Android.mk \
    $(commands_recovery_local_path)/minuitwrp/Android.mk \
    $(commands_recovery_local_path)/otautil/Android.mk \
    $(commands_recovery_local_path)/openaes/Android.mk \
    $(commands_recovery_local_path)/toolbox/Android.mk \
    $(commands_recovery_local_path)/twrpTarMain/Android.mk \
+0 −1
Original line number Diff line number Diff line
**Team Win Recovery Project (TWRP)**

You can find a compiling guide [here](http://forum.xda-developers.com/showthread.php?t=1943625 "Guide").
+13 −10
Original line number Diff line number Diff line
@@ -28,6 +28,8 @@

#include "ui.h"
#include "cutils/properties.h"
#include "install.h"
#include "common.h"
#include "adb_install.h"
#include "minadbd/fuse_adb_provider.h"
#include "fuse_sideload.h"
@@ -37,10 +39,7 @@
#include "verifier.h"
#endif

static RecoveryUI* ui = NULL;

void
set_usb_driver(bool enabled) {
static void set_usb_driver(bool enabled) {
    int fd = open("/sys/class/android_usb/android0/enable", O_WRONLY);
    if (fd < 0) {
/* These error messages show when built in older Android branches (e.g. Gingerbread)
@@ -65,20 +64,18 @@ set_usb_driver(bool enabled) {
    }
}

static void
stop_adbd() {
static void stop_adbd() {
    printf("Stopping adbd...\n");
    property_set("ctl.stop", "adbd");
    set_usb_driver(false);
}

bool is_ro_debuggable() {
static bool is_ro_debuggable() {
    char value[PROPERTY_VALUE_MAX+1];
    return (property_get("ro.debuggable", value, NULL) == 1 && value[0] == '1');
}

void
maybe_restart_adbd() {
    char value[PROPERTY_VALUE_MAX+1];
static void maybe_restart_adbd() {
    if (is_ro_debuggable()) {
        printf("Restarting adbd...\n");
        set_usb_driver(true);
@@ -96,6 +93,12 @@ apply_from_adb(const char* install_file, pid_t* child_pid) {
    stop_adbd();
    set_usb_driver(true);
/*
int apply_from_adb(RecoveryUI* ui, bool* wipe_cache, const char* install_file) {
    modified_flash = true;

    stop_adbd(ui);
    set_usb_driver(ui, true);

    ui->Print("\n\nNow send the package you want to apply\n"
              "to the device with \"adb sideload <filename>\"...\n");
*/
+2 −2
Original line number Diff line number Diff line
@@ -19,8 +19,8 @@

//class RecoveryUI;

void set_usb_driver(bool enabled);
void maybe_restart_adbd();
static void set_usb_driver(bool enabled);
static void maybe_restart_adbd();
int apply_from_adb(const char* install_file, pid_t* child_pid);

#endif
Loading