├── .gitignore ├── README.md ├── android10_debug_init.diff ├── blobs.sh ├── blobutil ├── .gitignore ├── Android.mk.disabled ├── Example_Usage.txt ├── LICENSE ├── Makefile ├── README.md ├── android-blob-utility.c ├── android-blob-utility.h └── emulator_systems │ ├── sdk_14.txt │ ├── sdk_15.txt │ ├── sdk_16.txt │ ├── sdk_17.txt │ ├── sdk_18.txt │ ├── sdk_19.txt │ ├── sdk_20.txt │ ├── sdk_21.txt │ └── sdk_22.txt ├── build_prepare.sh ├── cherrypicker.py ├── codereview ├── bracechecker.c ├── bracechecker.py └── bracechecker.sh ├── gen_simple_dl-stats.sh ├── jenkins └── build.sh ├── kernel-upstreaming ├── README.md └── linux-stable.sh ├── memcheck.sh ├── mkbootimg_tools ├── ARM │ ├── README.md │ ├── bash │ ├── cpio │ ├── file │ ├── grep │ ├── gzip │ ├── lz4 │ ├── lzma │ ├── lzop │ ├── magic.mgc │ ├── mkboot │ ├── mkbootfs │ ├── mkbootimg │ ├── od │ ├── wrapper │ └── xz ├── README.md ├── dtbTool ├── dtbToolCM ├── dtbtool.txt ├── dtc ├── lz4 ├── mkboot ├── mkbootfs └── mkbootimg ├── print-bootloader-id.sh ├── raw_resources.bin ├── rawresources.py ├── sign ├── README.md ├── make_key ├── sign_generate_keys.sh └── sign_set_keysdir.sh ├── start_android_env.sh ├── strace.bin ├── twrp_bench.sh ├── universalbuilder.sh └── xtrasforcherrypicker.py /.gitignore: -------------------------------------------------------------------------------- 1 | *.log 2 | out/ 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # android_buildtools 2 | My build tools for developing android 3 | 4 | ### sign/ 5 | 6 | check the [README](https://github.com/sfX-android/android_buildtools/tree/main/sign) in that directory 7 | 8 | ### blobs.sh 9 | 10 | THE tool to find blob dependencies! Ever tried to bring-up a custom ROM for a device? you WILL get trouble to get everything working without proprietary (aka blobs) binaries from the STOCK ROM. as these have dependencies with libraries you can easily come into a situation where you need to grab 10 libs for 1 blob. finding these is always annoying as you either need to grab the logs again and again or using strace again and again. 11 | 12 | -> not needed anymore as blobs.sh will do that all for you - right from your linux system - so even before including them in your next build :) 13 | 14 | ### memcheck.sh 15 | 16 | Simple RAM watcher for manually optimizing RAM usage. It was created to monitor the RAM usage during a ROM build in order to find the max used RAM amount during building Android. 17 | 18 | ### twrp_bench.sh 19 | 20 | an incredible cool benchmark tool which runs a TWRP backup and measures its speed and performance. 21 | 22 | Things you can adjust are: 23 | 24 | * read_ahead_kb 25 | * cpu governor 26 | * I/O scheduler 27 | 28 | It was written to get an idea which combination of the above would be best and it was used on several file systems as well (f2fs, ext4 etc) 29 | 30 | ### print-bootloader-id.sh 31 | 32 | example: 33 | ``` 34 | BOOTLOADER minimal ID 35 | AC2F6121 36 | 37 | BOOTLOADER full ID: 38 | AC2F6121652F3607 39 | 71EEB5510F6DB2D2 40 | 9CB444CE23F8A64E 41 | 9D1FDB7175432C32 42 | ``` 43 | 44 | ### cherrypicker.py (+xtrasforcherrypicker.py) 45 | 46 | generates a list of repopicks from a gerrit server. mandatory part of ASB patching in e.g. my [build automation](https://github.com/sfX-android/automation_scripts/blob/ansible/roles/common/tasks/secpatch.yml). 47 | 48 | forked from https://github.com/GeoZac/android_vendor_unconv 49 | 50 | ``` 51 | python3 cherrypicker.py -R los -B {{ sec_patch_pick_branch }} -Q 'topic:Q_asb_2025-01' 52 | ``` 53 | 54 | # legacy 55 | 56 | ### start_android_env.sh 57 | 58 | Starts a valid Android/TWRP build environment on Arch Linux based on python virtualenv. should be migrated to python3 btw.. but as I stopped using it on my desktop system that might not happen 59 | 60 | ### build_prepare.sh 61 | 62 | made to get a clean state before building. superseeded by Jenkins later .. and now by [Ansible](https://github.com/sfX-android/automation_scripts) 63 | 64 | ### universalbuilder.sh 65 | 66 | made some decades ago to build for several devices which all have their own shit. Parts of it can be found in [extendrom](https://github.com/sfX-android/android_vendor_extendrom) now. 67 | 68 | ### blobutil/ 69 | 70 | superseeded by blobs.sh (see above). it was a way to find dependencies of blobs. 71 | -------------------------------------------------------------------------------- /android10_debug_init.diff: -------------------------------------------------------------------------------- 1 | 2 | project system/core/ 3 | diff --git a/system/core/init/Android.mk b/system/core/init/Android.mk 4 | index c4f7d34..6fea638 100644 5 | --- a/system/core/init/Android.mk 6 | +++ b/system/core/init/Android.mk 7 | @@ -10,7 +10,7 @@ ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT))) 8 | init_options += \ 9 | -DALLOW_LOCAL_PROP_OVERRIDE=1 \ 10 | -DALLOW_PERMISSIVE_SELINUX=1 \ 11 | - -DREBOOT_BOOTLOADER_ON_PANIC=1 \ 12 | + -DREBOOT_BOOTLOADER_ON_PANIC=0 \ 13 | -DWORLD_WRITABLE_KMSG=1 \ 14 | -DDUMP_ON_UMOUNT_FAILURE=1 15 | else 16 | diff --git a/system/core/init/first_stage_init.cpp b/system/core/init/first_stage_init.cpp 17 | index 2b89940..2a03a15 100644 18 | --- a/system/core/init/first_stage_init.cpp 19 | +++ b/system/core/init/first_stage_init.cpp 20 | @@ -130,7 +130,6 @@ int FirstStageMain(int argc, char** argv) { 21 | CHECKCALL(setgroups(arraysize(groups), groups)); 22 | CHECKCALL(mount("sysfs", "/sys", "sysfs", 0, NULL)); 23 | CHECKCALL(mount("selinuxfs", "/sys/fs/selinux", "selinuxfs", 0, NULL)); 24 | - 25 | CHECKCALL(mknod("/dev/kmsg", S_IFCHR | 0600, makedev(1, 11))); 26 | 27 | if constexpr (WORLD_WRITABLE_KMSG) { 28 | @@ -167,6 +166,9 @@ int FirstStageMain(int argc, char** argv) { 29 | "mode=0755,uid=0,gid=0")); 30 | #undef CHECKCALL 31 | 32 | + auto result = WriteFile("/sys/class/leds/green/brightness", "0"); 33 | + result = WriteFile("/sys/class/leds/blue/brightness", "0"); 34 | + result = WriteFile("/sys/class/leds/red/brightness", "0"); 35 | SetStdioToDevNull(argv); 36 | // Now that tmpfs is mounted on /dev and we have /dev/kmsg, we can actually 37 | // talk to the outside world... 38 | @@ -175,20 +177,26 @@ int FirstStageMain(int argc, char** argv) { 39 | if (!errors.empty()) { 40 | for (const auto& [error_string, error_errno] : errors) { 41 | LOG(ERROR) << error_string << " " << strerror(error_errno); 42 | + //char *myerrno = strerror(error_errno); 43 | + //result = WriteFile("/cache/init_error_" + myerrno + ".log", error_string); 44 | + result = WriteFile("/cache/init_error.log", error_string); 45 | } 46 | LOG(FATAL) << "Init encountered errors starting first stage, aborting"; 47 | } 48 | 49 | LOG(INFO) << "init first stage started!"; 50 | + result = WriteFile("/cache/init_start.log", "first stage started"); 51 | 52 | auto old_root_dir = std::unique_ptr{opendir("/"), closedir}; 53 | if (!old_root_dir) { 54 | PLOG(ERROR) << "Could not opendir(\"/\"), not freeing ramdisk"; 55 | + result = WriteFile("/cache/init.old_root_dir.log", "Could not opendir, not freeing ramdisk"); 56 | } 57 | 58 | struct stat old_root_info; 59 | if (stat("/", &old_root_info) != 0) { 60 | PLOG(ERROR) << "Could not stat(\"/\"), not freeing ramdisk"; 61 | + result = WriteFile("/cache/init.old_root_info.log", "1 not freeing ramdisk"); 62 | old_root_dir.reset(); 63 | } 64 | 65 | @@ -209,19 +217,21 @@ int FirstStageMain(int argc, char** argv) { 66 | if (!fs::copy_file("/adb_debug.prop", kDebugRamdiskProp, ec) || 67 | !fs::copy_file("/userdebug_plat_sepolicy.cil", kDebugRamdiskSEPolicy, ec)) { 68 | LOG(ERROR) << "Failed to setup debug ramdisk"; 69 | + result = WriteFile("/cache/init.force_debuggable.log", "Failed to setup debug ramdisk"); 70 | } else { 71 | // setenv for second-stage init to read above kDebugRamdisk* files. 72 | setenv("INIT_FORCE_DEBUGGABLE", "true", 1); 73 | } 74 | } 75 | - 76 | if (!DoFirstStageMount()) { 77 | LOG(FATAL) << "Failed to mount required partitions early ..."; 78 | + result = WriteFile("/cache/init.DoFirstStageMount.log", "Failed to mount required partitions early ..."); 79 | } 80 | 81 | struct stat new_root_info; 82 | if (stat("/", &new_root_info) != 0) { 83 | PLOG(ERROR) << "Could not stat(\"/\"), not freeing ramdisk"; 84 | + result = WriteFile("/cache/init.new_root_info.log", "not freeing ramdisk"); 85 | old_root_dir.reset(); 86 | } 87 | 88 | @@ -235,13 +245,27 @@ int FirstStageMain(int argc, char** argv) { 89 | uint64_t start_ms = start_time.time_since_epoch().count() / kNanosecondsPerMillisecond; 90 | setenv("INIT_STARTED_AT", std::to_string(start_ms).c_str(), 1); 91 | 92 | + result = WriteFile("/sys/class/leds/blue/brightness", "0"); 93 | + result = WriteFile("/sys/class/leds/red/brightness", "0"); 94 | + result = WriteFile("/sys/class/leds/green/brightness", "255"); 95 | + sleep(1); 96 | + result = WriteFile("/cache/init_end.log", "first stage finished, starting selinux_setup"); 97 | + sleep(3); 98 | + // enforce a kernel panic 99 | + //result = WriteFile("/proc/sysrq-trigger", "c"); 100 | + 101 | const char* path = "/system/bin/init"; 102 | + //const char* path = "/init"; 103 | const char* args[] = {path, "selinux_setup", nullptr}; 104 | execv(path, const_cast(args)); 105 | 106 | // execv() only returns if an error happened, in which case we 107 | // panic and never fall through this conditional. 108 | PLOG(FATAL) << "execv(\"" << path << "\") failed"; 109 | + result = WriteFile("/sys/class/leds/blue/brightness", "255"); 110 | + result = WriteFile("/sys/class/leds/red/brightness", "255"); 111 | + result = WriteFile("/sys/class/leds/green/brightness", "255"); 112 | + sleep(3); 113 | 114 | return 1; 115 | } 116 | diff --git a/system/core/init/first_stage_mount.cpp b/system/core/init/first_stage_mount.cpp 117 | index 3e76556..b87f24d 100644 118 | --- a/system/core/init/first_stage_mount.cpp 119 | +++ b/system/core/init/first_stage_mount.cpp 120 | @@ -495,6 +495,10 @@ bool FirstStageMount::MountPartition(const Fstab::iterator& begin, bool erase_sa 121 | // this case, we mount system first then pivot to it. From that point on, 122 | // we are effectively identical to a system-as-root device. 123 | bool FirstStageMount::TrySwitchSystemAsRoot() { 124 | + auto result = WriteFile("/sys/class/leds/green/brightness", "0"); 125 | + result = WriteFile("/sys/class/leds/red/brightness", "255"); 126 | + result = WriteFile("/sys/class/leds/blue/brightness", "0"); 127 | + sleep(3); 128 | auto metadata_partition = std::find_if(fstab_.begin(), fstab_.end(), [](const auto& entry) { 129 | return entry.mount_point == "/metadata"; 130 | }); 131 | @@ -520,7 +524,6 @@ bool FirstStageMount::TrySwitchSystemAsRoot() { 132 | PLOG(ERROR) << "Failed to mount /system"; 133 | return false; 134 | } 135 | - 136 | return true; 137 | } 138 | 139 | diff --git a/system/core/init/main.cpp b/system/core/init/main.cpp 140 | index 2ce46ef..8a68f77 100644 141 | --- a/system/core/init/main.cpp 142 | +++ b/system/core/init/main.cpp 143 | @@ -20,6 +20,7 @@ 144 | #include "selinux.h" 145 | #include "subcontext.h" 146 | #include "ueventd.h" 147 | +#include "util.h" 148 | 149 | #include 150 | 151 | @@ -53,6 +54,11 @@ int main(int argc, char** argv) { 152 | __asan_set_error_report_callback(AsanReportCallback); 153 | #endif 154 | 155 | + auto result = WriteFile("/sys/class/leds/blue/brightness", "0"); 156 | + result = WriteFile("/sys/class/leds/red/brightness", "255"); 157 | + result = WriteFile("/sys/class/leds/green/brightness", "255"); 158 | + sleep(3); 159 | + 160 | if (!strcmp(basename(argv[0]), "ueventd")) { 161 | return ueventd_main(argc, argv); 162 | } 163 | diff --git a/system/core/init/reboot_utils.cpp b/system/core/init/reboot_utils.cpp 164 | index d1a712f..e79b634 100644 165 | --- a/system/core/init/reboot_utils.cpp 166 | +++ b/system/core/init/reboot_utils.cpp 167 | @@ -32,7 +32,7 @@ 168 | namespace android { 169 | namespace init { 170 | 171 | -static std::string init_fatal_reboot_target = "bootloader"; 172 | +static std::string init_fatal_reboot_target = "recovery"; 173 | 174 | void SetFatalRebootTarget() { 175 | std::string cmdline; 176 | diff --git a/system/core/init/selinux.cpp b/system/core/init/selinux.cpp 177 | index 86238b4..9b13063 100644 178 | --- a/system/core/init/selinux.cpp 179 | +++ b/system/core/init/selinux.cpp 180 | @@ -517,6 +517,11 @@ int SelinuxGetVendorAndroidVersion() { 181 | 182 | // This function initializes SELinux then execs init to run in the init SELinux context. 183 | int SetupSelinux(char** argv) { 184 | + auto result = WriteFile("/sys/class/leds/green/brightness", "102"); 185 | + result = WriteFile("/sys/class/leds/blue/brightness", "255"); 186 | + result = WriteFile("/sys/class/leds/red/brightness", "178"); 187 | + sleep(3); 188 | + 189 | InitKernelLogging(argv); 190 | 191 | if (REBOOT_BOOTLOADER_ON_PANIC) { 192 | -------------------------------------------------------------------------------- /blobs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ########################################################################################### 3 | # 4 | # parses a blob and prints all its dependencies - and dependencies of those, too 5 | # 6 | # Copyright 2020-2023: steadfasterX 7 | # 8 | ########################################################################################### 9 | 10 | [ -z "$DEBUG" ] && DEBUG=0 11 | spath="$1" 12 | FOUND="$2" 13 | BLOBS=() 14 | 15 | if [ -z "$spath" ]||[ ! -f "$FOUND" ];then echo "ERROR. usage: $0 "; exit 4;fi 16 | 17 | lib_lookup() { 18 | readelf -d $1 | grep NEEDED | cut -d "[" -f2 | cut -d"]" -f 1 19 | } 20 | 21 | so_search() { 22 | for file in `lib_lookup $1`; do 23 | find $spath -iname "$file" 2>/dev/null 24 | done 25 | } 26 | 27 | global_search() { 28 | RESULT=$(so_search $1 | grep -Ev "^${FOUND}" | grep -v "libc.so\|libdl.so\|libc++.so\|libm.so\|liblog.so\|libcutils.so") 29 | for blob in `echo -n $RESULT`; do 30 | CNT=$((CNT+1)) 31 | echo $blob 32 | FOUND=$1\|$FOUND 33 | BLOBS[1]+="$blob " 34 | global_search $blob 35 | [ $CNT -gt 20 ] && break 36 | done 37 | } 38 | 39 | [ "$DEBUG" -eq 1 ] && echo "starting search on $spath for $FOUND" 40 | global_search "$FOUND" 41 | -------------------------------------------------------------------------------- /blobutil/.gitignore: -------------------------------------------------------------------------------- 1 | # make files created after build 2 | android-blob-utility 3 | android-blob-utility.o 4 | -------------------------------------------------------------------------------- /blobutil/Android.mk.disabled: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2014 JackpotClavin 3 | # 4 | # Android Blob Utility 5 | # 6 | 7 | LOCAL_PATH:= $(call my-dir) 8 | include $(CLEAR_VARS) 9 | 10 | LOCAL_SRC_FILES := android-blob-utility.c 11 | 12 | LOCAL_CFLAGS += -DSYSTEM_DUMP_SDK_VERSION=$(SYSTEM_DUMP_SDK_VERSION) 13 | 14 | LOCAL_MODULE := android-blob-utility 15 | 16 | include $(BUILD_HOST_EXECUTABLE) 17 | -------------------------------------------------------------------------------- /blobutil/Example_Usage.txt: -------------------------------------------------------------------------------- 1 | Example program usage: 2 | JPC@ThinkPad-X220 ~ $ ./android-blob-utility 3 | System dump SDK version? 4 | See: https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels 5 | > 19 6 | System dump root? 7 | > /home/android/dump 8 | How many files? 9 | > 2 10 | Files to go: 2 11 | File name? 12 | > /home/android/dump/bin/mm-qcamera-daemon 13 | vendor/manufacturer/device/proprietary/vendor/lib/liboemcamera.so:system/vendor/lib/liboemcamera.so 14 | vendor/manufacturer/device/proprietary/vendor/lib/libmmcamera2_stats_modules.so:system/vendor/lib/libmmcamera2_stats_modules.so 15 | vendor/manufacturer/device/proprietary/vendor/lib/libmmcamera2_stats_algorithm.so:system/vendor/lib/libmmcamera2_stats_algorithm.so 16 | vendor/manufacturer/device/proprietary/vendor/lib/libsensor1.so:system/vendor/lib/libsensor1.so 17 | vendor/manufacturer/device/proprietary/vendor/lib/libqmi_encdec.so:system/vendor/lib/libqmi_encdec.so 18 | vendor/manufacturer/device/proprietary/vendor/lib/libmmcamera2_iface_modules.so:system/vendor/lib/libmmcamera2_iface_modules.so 19 | vendor/manufacturer/device/proprietary/vendor/lib/libmmcamera2_isp_modules.so:system/vendor/lib/libmmcamera2_isp_modules.so 20 | vendor/manufacturer/device/proprietary/vendor/lib/libmmcamera_tintless_algo.so:system/vendor/lib/libmmcamera_tintless_algo.so 21 | vendor/manufacturer/device/proprietary/vendor/lib/libmmcamera_tintless_bg_pca_algo.so:system/vendor/lib/libmmcamera_tintless_bg_pca_algo.so 22 | vendor/manufacturer/device/proprietary/vendor/lib/libmmcamera2_sensor_modules.so:system/vendor/lib/libmmcamera2_sensor_modules.so 23 | vendor/manufacturer/device/proprietary/vendor/lib/libmmcamera_imx132.so:system/vendor/lib/libmmcamera_imx132.so 24 | vendor/manufacturer/device/proprietary/vendor/lib/libchromatix_imx132_common.so:system/vendor/lib/libchromatix_imx132_common.so 25 | vendor/manufacturer/device/proprietary/vendor/lib/libchromatix_imx132_preview.so:system/vendor/lib/libchromatix_imx132_preview.so 26 | vendor/manufacturer/device/proprietary/vendor/lib/libchromatix_imx132_default_video.so:system/vendor/lib/libchromatix_imx132_default_video.so 27 | vendor/manufacturer/device/proprietary/vendor/lib/libchromatix_imx132_vt.so:system/vendor/lib/libchromatix_imx132_vt.so 28 | vendor/manufacturer/device/proprietary/vendor/lib/libchromatix_imx132_mms_video.so:system/vendor/lib/libchromatix_imx132_mms_video.so 29 | vendor/manufacturer/device/proprietary/vendor/lib/libmmcamera_hdr_gb_lib.so:system/vendor/lib/libmmcamera_hdr_gb_lib.so 30 | vendor/manufacturer/device/proprietary/vendor/lib/libfastcvopt.so:system/vendor/lib/libfastcvopt.so 31 | vendor/manufacturer/device/proprietary/vendor/lib/libOpenCL.so:system/vendor/lib/libOpenCL.so 32 | vendor/manufacturer/device/proprietary/vendor/lib/libllvm-qcom.so:system/vendor/lib/libllvm-qcom.so 33 | vendor/manufacturer/device/proprietary/vendor/lib/libgsl.so:system/vendor/lib/libgsl.so 34 | vendor/manufacturer/device/proprietary/vendor/lib/libCB.so:system/vendor/lib/libCB.so 35 | vendor/manufacturer/device/proprietary/vendor/lib/egl/libGLESv2_adreno.so:system/vendor/lib/egl/libGLESv2_adreno.so 36 | vendor/manufacturer/device/proprietary/vendor/lib/libadreno_utils.so:system/vendor/lib/libadreno_utils.so 37 | vendor/manufacturer/device/proprietary/vendor/lib/egl/libq3dtools_adreno.so:system/vendor/lib/egl/libq3dtools_adreno.so 38 | vendor/manufacturer/device/proprietary/vendor/lib/egl/libGLESv1_CM_adreno.so:system/vendor/lib/egl/libGLESv1_CM_adreno.so 39 | vendor/manufacturer/device/proprietary/vendor/lib/egl/libEGL_adreno.so:system/vendor/lib/egl/libEGL_adreno.so 40 | vendor/manufacturer/device/proprietary/vendor/lib/libOpenVG.so:system/vendor/lib/libOpenVG.so 41 | vendor/manufacturer/device/proprietary/vendor/lib/egl/eglsubAndroid.so:system/vendor/lib/egl/eglsubAndroid.so 42 | warning: blob file libGLESv2S3D_adreno.so missing or broken 43 | vendor/manufacturer/device/proprietary/vendor/lib/libsc-a2xx.so:system/vendor/lib/libsc-a2xx.so 44 | vendor/manufacturer/device/proprietary/vendor/lib/libsc-a3xx.so:system/vendor/lib/libsc-a3xx.so 45 | vendor/manufacturer/device/proprietary/vendor/lib/libadsprpc.so:system/vendor/lib/libadsprpc.so 46 | warning: wildcard lib%s_skel.so missing or broken 47 | vendor/manufacturer/device/proprietary/vendor/lib/libfastcvadsp_stub.so:system/vendor/lib/libfastcvadsp_stub.so 48 | warning: blob file libfcvopt.so missing or broken 49 | vendor/manufacturer/device/proprietary/vendor/lib/libmmcamera_tuning.so:system/vendor/lib/libmmcamera_tuning.so 50 | vendor/manufacturer/device/proprietary/vendor/lib/libmmcamera2_pproc_modules.so:system/vendor/lib/libmmcamera2_pproc_modules.so 51 | vendor/manufacturer/device/proprietary/vendor/lib/libmmcamera2_cpp_module.so:system/vendor/lib/libmmcamera2_cpp_module.so 52 | vendor/manufacturer/device/proprietary/vendor/lib/libmmcamera2_c2d_module.so:system/vendor/lib/libmmcamera2_c2d_module.so 53 | vendor/manufacturer/device/proprietary/vendor/lib/libC2D2.so:system/vendor/lib/libC2D2.so 54 | vendor/manufacturer/device/proprietary/vendor/lib/libc2d30.so:system/vendor/lib/libc2d30.so 55 | vendor/manufacturer/device/proprietary/vendor/lib/libc2d30-a3xx.so:system/vendor/lib/libc2d30-a3xx.so 56 | vendor/manufacturer/device/proprietary/vendor/lib/libc2d30-a4xx.so:system/vendor/lib/libc2d30-a4xx.so 57 | vendor/manufacturer/device/proprietary/vendor/lib/libc2d2_z180.so:system/vendor/lib/libc2d2_z180.so 58 | warning: blob file libc2d2.so missing or broken 59 | vendor/manufacturer/device/proprietary/vendor/lib/libmmcamera2_imglib_modules.so:system/vendor/lib/libmmcamera2_imglib_modules.so 60 | vendor/manufacturer/device/proprietary/vendor/lib/libmmcamera_imglib.so:system/vendor/lib/libmmcamera_imglib.so 61 | vendor/manufacturer/device/proprietary/vendor/lib/libmmcamera_wavelet_lib.so:system/vendor/lib/libmmcamera_wavelet_lib.so 62 | vendor/manufacturer/device/proprietary/vendor/lib/libmmcamera_faceproc.so:system/vendor/lib/libmmcamera_faceproc.so 63 | warning: blob file libmmcamera_cac2_lib.so missing or broken 64 | vendor/manufacturer/device/proprietary/vendor/lib/libmmcamera2_wnr_module.so:system/vendor/lib/libmmcamera2_wnr_module.so 65 | vendor/manufacturer/device/proprietary/vendor/lib/libmmcamera2_vpe_module.so:system/vendor/lib/libmmcamera2_vpe_module.so 66 | vendor/manufacturer/device/proprietary/lib/libmm-qcamera.so:system/lib/libmm-qcamera.so 67 | vendor/manufacturer/device/proprietary/lib/libmmcamera_interface.so:system/lib/libmmcamera_interface.so 68 | vendor/manufacturer/device/proprietary/lib/libHDR.so:system/lib/libHDR.so 69 | vendor/manufacturer/device/proprietary/lib/libmorpho_noise_reduction.so:system/lib/libmorpho_noise_reduction.so 70 | vendor/manufacturer/device/proprietary/lib/libmorpho_image_stab31.so:system/lib/libmorpho_image_stab31.so 71 | vendor/manufacturer/device/proprietary/lib/libmorpho_movie_stabilization.so:system/lib/libmorpho_movie_stabilization.so 72 | vendor/manufacturer/device/proprietary/lib/libmorpho_video_denoiser.so:system/lib/libmorpho_video_denoiser.so 73 | vendor/manufacturer/device/proprietary/lib/libmmjpeg_interface.so:system/lib/libmmjpeg_interface.so 74 | vendor/manufacturer/device/proprietary/lib/libqomx_core.so:system/lib/libqomx_core.so 75 | vendor/manufacturer/device/proprietary/vendor/lib/libqomx_jpegenc.so:system/vendor/lib/libqomx_jpegenc.so 76 | vendor/manufacturer/device/proprietary/vendor/lib/libmmqjpeg_codec.so:system/vendor/lib/libmmqjpeg_codec.so 77 | vendor/manufacturer/device/proprietary/vendor/lib/libmmjpeg.so:system/vendor/lib/libmmjpeg.so 78 | vendor/manufacturer/device/proprietary/vendor/lib/libjpegehw.so:system/vendor/lib/libjpegehw.so 79 | vendor/manufacturer/device/proprietary/vendor/lib/libjpegdhw.so:system/vendor/lib/libjpegdhw.so 80 | vendor/manufacturer/device/proprietary/vendor/lib/libqomx_jpegdec.so:system/vendor/lib/libqomx_jpegdec.so 81 | vendor/manufacturer/device/proprietary/vendor/lib/libmmcamera_imx135.so:system/vendor/lib/libmmcamera_imx135.so 82 | vendor/manufacturer/device/proprietary/vendor/lib/libchromatix_imx135_common.so:system/vendor/lib/libchromatix_imx135_common.so 83 | vendor/manufacturer/device/proprietary/vendor/lib/libchromatix_imx135_snapshot.so:system/vendor/lib/libchromatix_imx135_snapshot.so 84 | vendor/manufacturer/device/proprietary/vendor/lib/libchromatix_imx135_default_video.so:system/vendor/lib/libchromatix_imx135_default_video.so 85 | vendor/manufacturer/device/proprietary/lib/libchromatix_imx135_liveshot.so:system/lib/libchromatix_imx135_liveshot.so 86 | vendor/manufacturer/device/proprietary/vendor/lib/libchromatix_imx135_preview.so:system/vendor/lib/libchromatix_imx135_preview.so 87 | vendor/manufacturer/device/proprietary/vendor/lib/libchromatix_imx135_video_qtr.so:system/vendor/lib/libchromatix_imx135_video_qtr.so 88 | vendor/manufacturer/device/proprietary/vendor/lib/libchromatix_imx135_video_dualrec.so:system/vendor/lib/libchromatix_imx135_video_dualrec.so 89 | vendor/manufacturer/device/proprietary/vendor/lib/libchromatix_imx135_hfr_60.so:system/vendor/lib/libchromatix_imx135_hfr_60.so 90 | vendor/manufacturer/device/proprietary/vendor/lib/libchromatix_imx135_mms_video.so:system/vendor/lib/libchromatix_imx135_mms_video.so 91 | vendor/manufacturer/device/proprietary/vendor/lib/libchromatix_imx135_uhd_video.so:system/vendor/lib/libchromatix_imx135_uhd_video.so 92 | vendor/manufacturer/device/proprietary/vendor/lib/libchromatix_imx135_hfr_120.so:system/vendor/lib/libchromatix_imx135_hfr_120.so 93 | vendor/manufacturer/device/proprietary/vendor/lib/libchromatix_imx135_video_hdr.so:system/vendor/lib/libchromatix_imx135_video_hdr.so 94 | vendor/manufacturer/device/proprietary/vendor/lib/libchromatix_imx135_fuji_common.so:system/vendor/lib/libchromatix_imx135_fuji_common.so 95 | vendor/manufacturer/device/proprietary/vendor/lib/libchromatix_imx135_fuji_snapshot.so:system/vendor/lib/libchromatix_imx135_fuji_snapshot.so 96 | vendor/manufacturer/device/proprietary/vendor/lib/libchromatix_imx135_fuji_default_video.so:system/vendor/lib/libchromatix_imx135_fuji_default_video.so 97 | warning: blob file libchromatix_imx135_fuji_liveshot.so missing or broken 98 | vendor/manufacturer/device/proprietary/vendor/lib/libchromatix_imx135_fuji_preview.so:system/vendor/lib/libchromatix_imx135_fuji_preview.so 99 | vendor/manufacturer/device/proprietary/vendor/lib/libchromatix_imx135_fuji_video_qtr.so:system/vendor/lib/libchromatix_imx135_fuji_video_qtr.so 100 | vendor/manufacturer/device/proprietary/vendor/lib/libchromatix_imx135_fuji_video_dualrec.so:system/vendor/lib/libchromatix_imx135_fuji_video_dualrec.so 101 | vendor/manufacturer/device/proprietary/vendor/lib/libchromatix_imx135_fuji_hfr_60.so:system/vendor/lib/libchromatix_imx135_fuji_hfr_60.so 102 | vendor/manufacturer/device/proprietary/vendor/lib/libchromatix_imx135_fuji_mms_video.so:system/vendor/lib/libchromatix_imx135_fuji_mms_video.so 103 | warning: blob file libchromatix_imx135_fuji_uhd_video.so missing or broken 104 | vendor/manufacturer/device/proprietary/vendor/lib/libchromatix_imx135_fuji_hfr_120.so:system/vendor/lib/libchromatix_imx135_fuji_hfr_120.so 105 | warning: blob file libchromatix_imx135_fuji_video_hdr.so missing or broken 106 | vendor/manufacturer/device/proprietary/vendor/lib/libmmcamera_imx135_eeprom.so:system/vendor/lib/libmmcamera_imx135_eeprom.so 107 | vendor/manufacturer/device/proprietary/vendor/lib/libmmcamera_hdr_lib.so:system/vendor/lib/libmmcamera_hdr_lib.so 108 | vendor/manufacturer/device/proprietary/bin/mm-qcamera-daemon:system/bin/mm-qcamera-daemon 109 | Files to go: 1 110 | File name? 111 | > /home/android/dump/lib/hw/camera.msm8974.so 112 | vendor/manufacturer/device/proprietary/lib/libVDObjectTrackerAPI.so:system/lib/libVDObjectTrackerAPI.so 113 | vendor/manufacturer/device/proprietary/vendor/lib/libthermalclient.so:system/vendor/lib/libthermalclient.so 114 | vendor/manufacturer/device/proprietary/vendor/lib/libdiag.so:system/vendor/lib/libdiag.so 115 | vendor/manufacturer/device/proprietary/lib/hw/camera.msm8974.so:system/lib/hw/camera.msm8974.so 116 | Completed sucessfully. 117 | 118 | -------------------------------------------------------------------------------- /blobutil/Makefile: -------------------------------------------------------------------------------- 1 | 2 | BUILD_WITH_READLINE := false 3 | VARIABLES_PROVIDED := false 4 | 5 | CC = gcc 6 | CFLAGS += -Wall -Wextra 7 | 8 | ifeq ($(BUILD_WITH_READLINE), true) 9 | CFLAGS += -DUSE_READLINE 10 | LDFLAGS += -lreadline 11 | endif 12 | 13 | ifeq ($(VARIABLES_PROVIDED), true) 14 | CFLAGS += -DVARIABLES_PROVIDED 15 | endif 16 | 17 | OBJECTS = android-blob-utility.o 18 | SOURCE = android-blob-utility.c 19 | MODULE = android-blob-utility 20 | 21 | 22 | android-blob-utility: $(OBJECTS) 23 | $(CC) $(CFLAGS) $(OBJECTS) -o $(MODULE) $(LDFLAGS) 24 | 25 | all: android-blob-utility 26 | 27 | clean: 28 | -rm -f $(OBJECTS) $(MODULE) 29 | 30 | -------------------------------------------------------------------------------- /blobutil/README.md: -------------------------------------------------------------------------------- 1 | # Android Blob Utility 2 | 3 | by JackpotClavin 4 | 5 | The Android Blob Utility is a program designed to make developing AOSP-based 6 | ROMs easier to develop. What is does is it allows the developer to pick 7 | proprietary file, type the file's absolute path, and this program will spit 8 | back every library that should be needed in order to get that library or daemon 9 | to run on an AOSP ROM. 10 | 11 | How does it work? First the developer must dump their entire stock ROM's 12 | software to their computer, so that typing the command: 13 | "ls /home/android/dump/build.prop" will yield their device's build.prop. 14 | This is just meant to ensure that you have the correct path it is valid. 15 | Next, you are to compile this program with the 'make' command. Once you run it, 16 | the program will prompt you to enter whatever the sdk version of you /system 17 | dump happens to be (check your /system/build.prop), for instance if your 18 | /system dump is 4.3, type in 18 (use the following site for guidelines: 19 | developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels). 20 | Secondly, the program will ask you for the location of your /system dump so if 21 | the build.prop file is under /home/android/dump/build.prop, you can just type: 22 | /home/android/dump and press enter. For the third step of getting the blobs, 23 | this program will prompt you to enter however many blobs files you want this 24 | program to process. If you want to only process one blob, type 1 and hit enter. 25 | After you enter the amount of blobs you want this program to process, you will 26 | type the absolute path to the actual blob (see the example program usage 27 | below), and this program will print out all of the proprietary blobs that are 28 | mentioned in that particular blob that you entered, that aren't in the 29 | emulator's /system dump. That means that those files are either have to be 30 | built from source, or are proprietary and must be copied into the ROM's build. 31 | This program will also format the blobs such that it is ready to be placed into 32 | a vendor-blobs.mk file in your vendor folder of the ROM's source tree root. 33 | 34 | What makes this program great is that it doesn't just get the shared libraries 35 | necessary to appease the linker, but it takes another step; it also catches the 36 | blobs that may slip past the linker because they are called in the actual code 37 | of the blob. Simply copying the shared libraries just appeases the linker, but 38 | the blob still not run properly as the blob may want additional libraries. 39 | 40 | This program also searches recursively, so each and every blob that is found is 41 | also processed through the searching algorithm, to see which blobs *that* 42 | library also needs to run, so we cover all of the bases in order to get a 43 | proprietary library or daemon to run. 44 | 45 | The following example was used on my LG G2. Running this program with the two 46 | main proprietary files related to the camera (/system/bin/mm-qcamera-daemon and 47 | /system/lib/hw/camera.msm8974.so), this program nicely printed out *every* 48 | proprietary file needed to get the camera working, and formatted it so that one 49 | can easily find and replace "proprietary/vendor/lib/..." with the name and 50 | manufacturer of the device you wish to port AOSP-based ROMs to, instead of 51 | having to keep pushing files until the linker is satisfied, or having to find 52 | libraries that aren't shared libraries, but are called in the actual code of 53 | the proprietary file. 54 | 55 | Example program usage can be found in the Example_Usage.txt in this folder. 56 | 57 | -------------------------------------------------------------------------------- /blobutil/android-blob-utility.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Android blob utility 3 | * 4 | * Copyright (C) 2014 JackpotClavin 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public License 8 | * as published by the Free Software Foundation; either version 2 9 | * of the License, or (at your option) any later version. 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 18 | * MA 02110-1301, USA. 19 | */ 20 | 21 | #ifndef _ANDROID_BLOB_UTILITY_H_ 22 | #define _ANDROID_BLOB_UTILITY_H_ 23 | 24 | #define _GNU_SOURCE 25 | #include 26 | 27 | /* Change value below to match your /system dump's SDK version. */ 28 | /* See: https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels */ 29 | //#define SYSTEM_DUMP_SDK_VERSION 19 /* Android KitKat*/ 30 | 31 | #define SYSTEM_DUMP_SDK_VERSION 17 /* Android JB*/ 32 | 33 | #define SYSTEM_DUMP_ROOT "/home/xdajog/android/fx3q_system_mounted" 34 | #define SYSTEM_VENDOR "lge" 35 | #define SYSTEM_DEVICE "fx3q" 36 | 37 | const char *blob_directories[] = { 38 | "/vendor/lib/egl/", 39 | "/vendor/lib/hw/", 40 | "/vendor/lib/", 41 | "/vendor/bin/", 42 | "/lib/egl/", 43 | "/lib/hw/", 44 | "/lib/", 45 | "/bin/", 46 | NULL 47 | }; 48 | 49 | const char *lib_beginning = "lib"; 50 | const char *egl_beginning = "egl"; 51 | 52 | const char *lib_ending = ".so"; 53 | 54 | #endif /* _ANDROID_BLOB_UTILITY_H_ */ 55 | -------------------------------------------------------------------------------- /blobutil/emulator_systems/sdk_14.txt: -------------------------------------------------------------------------------- 1 | /system/usr/share/zoneinfo/zoneinfo.dat 2 | /system/usr/share/zoneinfo/zoneinfo.idx 3 | /system/usr/share/zoneinfo/zoneinfo.version 4 | /system/usr/share/bmd/RFFspeed_501.bmd 5 | /system/usr/share/bmd/RFFstd_501.bmd 6 | /system/usr/keylayout/Vendor_046d_Product_c294.kl 7 | /system/usr/keylayout/Vendor_046d_Product_c532.kl 8 | /system/usr/keylayout/AVRCP.kl 9 | /system/usr/keylayout/Vendor_05ac_Product_0239.kl 10 | /system/usr/keylayout/Vendor_046d_Product_c216.kl 11 | /system/usr/keylayout/qwerty.kl 12 | /system/usr/keylayout/Vendor_045e_Product_028e.kl 13 | /system/usr/keylayout/Vendor_22b8_Product_093d.kl 14 | /system/usr/keylayout/Vendor_054c_Product_0268.kl 15 | /system/usr/keylayout/Vendor_046d_Product_c299.kl 16 | /system/usr/keylayout/Generic.kl 17 | /system/usr/idc/qwerty2.idc 18 | /system/usr/idc/qwerty.idc 19 | /system/usr/srec/config/en.us/baseline11k.par 20 | /system/usr/srec/config/en.us/grammars/VoiceDialer.g2g 21 | /system/usr/srec/config/en.us/grammars/boolean.g2g 22 | /system/usr/srec/config/en.us/grammars/phone_type_choice.g2g 23 | /system/usr/srec/config/en.us/baseline.par 24 | /system/usr/srec/config/en.us/g2p/en-US-ttp.data 25 | /system/usr/srec/config/en.us/models/generic.swiarb 26 | /system/usr/srec/config/en.us/models/generic8.lda 27 | /system/usr/srec/config/en.us/models/generic11_f.swimdl 28 | /system/usr/srec/config/en.us/models/generic8_m.swimdl 29 | /system/usr/srec/config/en.us/models/generic11.lda 30 | /system/usr/srec/config/en.us/models/generic11_m.swimdl 31 | /system/usr/srec/config/en.us/models/generic8_f.swimdl 32 | /system/usr/srec/config/en.us/dictionary/enroll.ok 33 | /system/usr/srec/config/en.us/dictionary/basic.ok 34 | /system/usr/srec/config/en.us/dictionary/cmu6plus.ok.zip 35 | /system/usr/srec/config/en.us/baseline8k.par 36 | /system/usr/icu/icudt46l.dat 37 | /system/usr/keychars/qwerty.kcm 38 | /system/usr/keychars/Virtual.kcm 39 | /system/usr/keychars/Generic.kcm 40 | /system/usr/keychars/qwerty2.kcm 41 | /system/media/audio/ui/VideoRecord.ogg 42 | /system/media/audio/ui/camera_click.ogg 43 | /system/etc/system_fonts.xml 44 | /system/etc/event-log-tags 45 | /system/etc/vold.fstab 46 | /system/etc/permissions/platform.xml 47 | /system/etc/permissions/android.hardware.camera.autofocus.xml 48 | /system/etc/permissions/com.android.location.provider.xml 49 | /system/etc/security/cacerts/d777342d.0 50 | /system/etc/security/cacerts/ddc328ff.0 51 | /system/etc/security/cacerts/ed524cf5.0 52 | /system/etc/security/cacerts/ee7cd6fb.0 53 | /system/etc/security/cacerts/3ad48a91.0 54 | /system/etc/security/cacerts/2fa87019.0 55 | /system/etc/security/cacerts/5e4e69e7.0 56 | /system/etc/security/cacerts/882de061.0 57 | /system/etc/security/cacerts/399e7759.0 58 | /system/etc/security/cacerts/1eb37bdf.0 59 | /system/etc/security/cacerts/e60bf0c0.0 60 | /system/etc/security/cacerts/81b9768f.0 61 | /system/etc/security/cacerts/c33a80d4.0 62 | /system/etc/security/cacerts/a0bc6fbb.0 63 | /system/etc/security/cacerts/dbc54cab.0 64 | /system/etc/security/cacerts/27af790d.0 65 | /system/etc/security/cacerts/1dcd6f4c.0 66 | /system/etc/security/cacerts/95aff9e3.0 67 | /system/etc/security/cacerts/f61bff45.0 68 | /system/etc/security/cacerts/2fb1850a.0 69 | /system/etc/security/cacerts/3c860d51.0 70 | /system/etc/security/cacerts/895cad1a.0 71 | /system/etc/security/cacerts/ed049835.0 72 | /system/etc/security/cacerts/69105f4f.0 73 | /system/etc/security/cacerts/c215bc69.0 74 | /system/etc/security/cacerts/7999be0d.0 75 | /system/etc/security/cacerts/cf701eeb.0 76 | /system/etc/security/cacerts/87753b0d.0 77 | /system/etc/security/cacerts/9339512a.0 78 | /system/etc/security/cacerts/2afc57aa.0 79 | /system/etc/security/cacerts/add67345.0 80 | /system/etc/security/cacerts/ff783690.0 81 | /system/etc/security/cacerts/7a481e66.0 82 | /system/etc/security/cacerts/7d453d8f.0 83 | /system/etc/security/cacerts/6adf0799.0 84 | /system/etc/security/cacerts/1dbdda5b.0 85 | /system/etc/security/cacerts/418595b9.0 86 | /system/etc/security/cacerts/ea169617.0 87 | /system/etc/security/cacerts/3a3b02ce.0 88 | /system/etc/security/cacerts/08aef7bb.0 89 | /system/etc/security/cacerts/219d9499.0 90 | /system/etc/security/cacerts/7651b327.0 91 | /system/etc/security/cacerts/4fbd6bfa.0 92 | /system/etc/security/cacerts/bcdd5959.0 93 | /system/etc/security/cacerts/cdaebb72.0 94 | /system/etc/security/cacerts/e48193cf.0 95 | /system/etc/security/cacerts/5a3f0ff8.0 96 | /system/etc/security/cacerts/c527e4ab.0 97 | /system/etc/security/cacerts/84cba82f.0 98 | /system/etc/security/cacerts/56b8a0b6.0 99 | /system/etc/security/cacerts/1df5ec47.0 100 | /system/etc/security/cacerts/ab5346f4.0 101 | /system/etc/security/cacerts/23f4c490.0 102 | /system/etc/security/cacerts/1e8e7201.0 103 | /system/etc/security/cacerts/60afe812.0 104 | /system/etc/security/cacerts/524d9b43.0 105 | /system/etc/security/cacerts/facacbc6.0 106 | /system/etc/security/cacerts/1dac3003.0 107 | /system/etc/security/cacerts/b0f3e76e.0 108 | /system/etc/security/cacerts/ccc52f49.0 109 | /system/etc/security/cacerts/fac084d7.0 110 | /system/etc/security/cacerts/c8763593.0 111 | /system/etc/security/cacerts/17b51fe6.0 112 | /system/etc/security/cacerts/c7e2a638.0 113 | /system/etc/security/cacerts/03e16f6c.0 114 | /system/etc/security/cacerts/6e8bf996.0 115 | /system/etc/security/cacerts/f4996e82.0 116 | /system/etc/security/cacerts/3c58f906.0 117 | /system/etc/security/cacerts/8f7b96c4.0 118 | /system/etc/security/cacerts/f58a60fe.0 119 | /system/etc/security/cacerts/d64f06f3.0 120 | /system/etc/security/cacerts/5cf9d536.0 121 | /system/etc/security/cacerts/12d55845.0 122 | /system/etc/security/cacerts/86212b19.0 123 | /system/etc/security/cacerts/7a819ef2.0 124 | /system/etc/security/cacerts/74c26bd0.0 125 | /system/etc/security/cacerts/33815e15.0 126 | /system/etc/security/cacerts/bf64f35b.0 127 | /system/etc/security/cacerts/b7db1890.0 128 | /system/etc/security/cacerts/9f533518.0 129 | /system/etc/security/cacerts/1155c94b.0 130 | /system/etc/security/cacerts/e7b8d656.0 131 | /system/etc/security/cacerts/6fcc125d.0 132 | /system/etc/security/cacerts/9685a493.0 133 | /system/etc/security/cacerts/3e7271e8.0 134 | /system/etc/security/cacerts/d537fba6.0 135 | /system/etc/security/cacerts/00673b5b.0 136 | /system/etc/security/cacerts/67495436.0 137 | /system/etc/security/cacerts/fde84897.0 138 | /system/etc/security/cacerts/e775ed2d.0 139 | /system/etc/security/cacerts/76579174.0 140 | /system/etc/security/cacerts/5046c355.0 141 | /system/etc/security/cacerts/eb375c3e.0 142 | /system/etc/security/cacerts/f80cc7f6.0 143 | /system/etc/security/cacerts/75680d2e.0 144 | /system/etc/security/cacerts/635ccfd5.0 145 | /system/etc/security/cacerts/48478734.0 146 | /system/etc/security/cacerts/111e6273.0 147 | /system/etc/security/cacerts/a7605362.0 148 | /system/etc/security/cacerts/1920cacb.0 149 | /system/etc/security/cacerts/7d3cd826.0 150 | /system/etc/security/cacerts/bc3f2570.0 151 | /system/etc/security/cacerts/bda4cc84.0 152 | /system/etc/security/cacerts/bdacca6f.0 153 | /system/etc/security/cacerts/9772ca32.0 154 | /system/etc/security/cacerts/a15b3b6b.0 155 | /system/etc/security/cacerts/57692373.0 156 | /system/etc/security/cacerts/343eb6cb.0 157 | /system/etc/security/cacerts/3d441de8.0 158 | /system/etc/security/cacerts/d8274e24.0 159 | /system/etc/security/cacerts/46b2fd3b.0 160 | /system/etc/security/cacerts/4d654d1d.0 161 | /system/etc/security/cacerts/5a5372fc.0 162 | /system/etc/security/cacerts/10531352.0 163 | /system/etc/security/cacerts/455f1b52.0 164 | /system/etc/security/cacerts/5021a0a2.0 165 | /system/etc/security/cacerts/11a09b38.0 166 | /system/etc/security/cacerts/594f1775.0 167 | /system/etc/security/cacerts/d16a5865.0 168 | /system/etc/security/cacerts/e8651083.0 169 | /system/etc/security/cacerts/4e18c148.0 170 | /system/etc/security/cacerts/a7d2cf64.0 171 | /system/etc/security/cacerts/72f369af.0 172 | /system/etc/security/cacerts/89c02a45.0 173 | /system/etc/security/cacerts/0d188d89.0 174 | /system/etc/security/cacerts/a3896b44.0 175 | /system/etc/security/cacerts/58a44af1.0 176 | /system/etc/security/cacerts/85cde254.0 177 | /system/etc/security/cacerts/9dbefe7b.0 178 | /system/etc/security/cacerts/9d6523ce.0 179 | /system/etc/security/cacerts/8470719d.0 180 | /system/etc/security/cacerts/2e8714cb.0 181 | /system/etc/security/cacerts/119afc2e.0 182 | /system/etc/security/cacerts/72fa7371.0 183 | /system/etc/security/otacerts.zip 184 | /system/etc/hosts 185 | /system/etc/ppp/ip-up-vpn 186 | /system/etc/dbus.conf 187 | /system/etc/fallback_fonts.xml 188 | /system/etc/apns-conf.xml 189 | /system/etc/NOTICE.html.gz 190 | /system/etc/init.goldfish.sh 191 | /system/etc/dhcpcd/dhcpcd-run-hooks 192 | /system/etc/dhcpcd/dhcpcd-hooks/95-configured 193 | /system/etc/dhcpcd/dhcpcd-hooks/20-dns.conf 194 | /system/framework/monkey.jar 195 | /system/framework/bu.jar 196 | /system/framework/apache-xml.odex 197 | /system/framework/bmgr.jar 198 | /system/framework/framework.odex 199 | /system/framework/core-junit.odex 200 | /system/framework/android.test.runner.jar 201 | /system/framework/framework-res.apk 202 | /system/framework/ime.jar 203 | /system/framework/am.jar 204 | /system/framework/filterfw.jar 205 | /system/framework/bouncycastle.odex 206 | /system/framework/pm.odex 207 | /system/framework/input.jar 208 | /system/framework/pm.jar 209 | /system/framework/javax.obex.jar 210 | /system/framework/javax.obex.odex 211 | /system/framework/core.jar 212 | /system/framework/input.odex 213 | /system/framework/android.test.runner.odex 214 | /system/framework/services.odex 215 | /system/framework/com.android.location.provider.jar 216 | /system/framework/svc.odex 217 | /system/framework/bouncycastle.jar 218 | /system/framework/services.jar 219 | /system/framework/core-junit.jar 220 | /system/framework/com.android.location.provider.odex 221 | /system/framework/framework.jar 222 | /system/framework/ime.odex 223 | /system/framework/apache-xml.jar 224 | /system/framework/filterfw.odex 225 | /system/framework/ext.jar 226 | /system/framework/android.policy.odex 227 | /system/framework/ext.odex 228 | /system/framework/android.policy.jar 229 | /system/framework/monkey.odex 230 | /system/framework/bmgr.odex 231 | /system/framework/core.odex 232 | /system/framework/bu.odex 233 | /system/framework/svc.jar 234 | /system/framework/am.odex 235 | /system/tts/lang_pico/en-GB_ta.bin 236 | /system/tts/lang_pico/en-GB_kh0_sg.bin 237 | /system/tts/lang_pico/fr-FR_nk0_sg.bin 238 | /system/tts/lang_pico/en-US_lh0_sg.bin 239 | /system/tts/lang_pico/de-DE_gl0_sg.bin 240 | /system/tts/lang_pico/de-DE_ta.bin 241 | /system/tts/lang_pico/it-IT_ta.bin 242 | /system/tts/lang_pico/es-ES_ta.bin 243 | /system/tts/lang_pico/fr-FR_ta.bin 244 | /system/tts/lang_pico/es-ES_zl0_sg.bin 245 | /system/tts/lang_pico/en-US_ta.bin 246 | /system/tts/lang_pico/it-IT_cm0_sg.bin 247 | /system/fonts/DroidSerif-BoldItalic.ttf 248 | /system/fonts/DroidSansGeorgian.ttf 249 | /system/fonts/DroidSansFallback.ttf 250 | /system/fonts/DroidSansMono.ttf 251 | /system/fonts/Roboto-Italic.ttf 252 | /system/fonts/Roboto-Bold.ttf 253 | /system/fonts/DroidSerif-Regular.ttf 254 | /system/fonts/AndroidClock.ttf 255 | /system/fonts/DroidSansHebrew-Bold.ttf 256 | /system/fonts/DroidSansThai.ttf 257 | /system/fonts/DroidSansHebrew-Regular.ttf 258 | /system/fonts/AndroidClock_Solid.ttf 259 | /system/fonts/DroidSansArmenian.ttf 260 | /system/fonts/Roboto-Regular.ttf 261 | /system/fonts/DroidSansEthiopic-Regular.ttf 262 | /system/fonts/DroidSerif-Italic.ttf 263 | /system/fonts/DroidNaskh-Regular.ttf 264 | /system/fonts/DroidSerif-Bold.ttf 265 | /system/fonts/Clockopia.ttf 266 | /system/fonts/AndroidClock_Highlight.ttf 267 | /system/fonts/Roboto-BoldItalic.ttf 268 | /system/lib/libnetutils.so 269 | /system/lib/libthread_db.so 270 | /system/lib/libjni_mosaic.so 271 | /system/lib/libstagefright.so 272 | /system/lib/libsensorservice.so 273 | /system/lib/libinput.so 274 | /system/lib/libssl.so 275 | /system/lib/libpowermanager.so 276 | /system/lib/egl/libGLES_android.so 277 | /system/lib/egl/egl.cfg 278 | /system/lib/egl/libGLESv2_emulation.so 279 | /system/lib/egl/libGLESv1_CM_emulation.so 280 | /system/lib/egl/libEGL_emulation.so 281 | /system/lib/libmedia.so 282 | /system/lib/libcrypto.so 283 | /system/lib/libstdc++.so 284 | /system/lib/libm.so 285 | /system/lib/libexif.so 286 | /system/lib/libeffects.so 287 | /system/lib/libsurfaceflinger.so 288 | /system/lib/libETC1.so 289 | /system/lib/libstagefright_omx.so 290 | /system/lib/libwilhelm.so 291 | /system/lib/libGLESv2_dbg.so 292 | /system/lib/libcutils.so 293 | /system/lib/libdrm1.so 294 | /system/lib/libvariablespeed.so 295 | /system/lib/libstagefright_amrnb_common.so 296 | /system/lib/libfilterpack_imageproc.so 297 | /system/lib/libc.so 298 | /system/lib/libsurfaceflinger_client.so 299 | /system/lib/libchromium_net.so 300 | /system/lib/libmtp.so 301 | /system/lib/libWnnEngDic.so 302 | /system/lib/libsqlite.so 303 | /system/lib/libEGL.so 304 | /system/lib/libnativehelper.so 305 | /system/lib/libGLESv2.so 306 | /system/lib/libGLESv2_enc.so 307 | /system/lib/libGLESv1_CM.so 308 | /system/lib/libsystem_server.so 309 | /system/lib/libui.so 310 | /system/lib/lib_renderControl_enc.so 311 | /system/lib/libvorbisidec.so 312 | /system/lib/libwnndict.so 313 | /system/lib/libctest.so 314 | /system/lib/libstagefright_enc_common.so 315 | /system/lib/libext4_utils.so 316 | /system/lib/libharfbuzz.so 317 | /system/lib/libstagefright_soft_g711dec.so 318 | /system/lib/libwebrtc_audio_preprocessing.so 319 | /system/lib/libstagefright_soft_mpeg4dec.so 320 | /system/lib/libutils.so 321 | /system/lib/hw/audio.primary.goldfish.so 322 | /system/lib/hw/lights.goldfish.so 323 | /system/lib/hw/audio_policy.default.so 324 | /system/lib/hw/gralloc.default.so 325 | /system/lib/hw/gralloc.goldfish.so 326 | /system/lib/hw/camera.goldfish.so 327 | /system/lib/hw/gps.goldfish.so 328 | /system/lib/hw/sensors.goldfish.so 329 | /system/lib/libreference-ril.so 330 | /system/lib/libpower.so 331 | /system/lib/libdrm1_jni.so 332 | /system/lib/libmedia_jni.so 333 | /system/lib/libstagefright_soft_vpxdec.so 334 | /system/lib/libcameraservice.so 335 | /system/lib/libril.so 336 | /system/lib/libdefcontainer_jni.so 337 | /system/lib/libOpenglSystemCommon.so 338 | /system/lib/libttspico.so 339 | /system/lib/libsoundpool.so 340 | /system/lib/libstagefright_soft_aacdec.so 341 | /system/lib/libsysutils.so 342 | /system/lib/libsrec_jni.so 343 | /system/lib/libicui18n.so 344 | /system/lib/libc_malloc_debug_qemu.so 345 | /system/lib/soundfx/libaudiopreprocessing.so 346 | /system/lib/soundfx/libbundlewrapper.so 347 | /system/lib/soundfx/libvisualizer.so 348 | /system/lib/soundfx/libreverbwrapper.so 349 | /system/lib/libhardware_legacy.so 350 | /system/lib/libcamera_client.so 351 | /system/lib/librs_jni.so 352 | /system/lib/libfilterfw.so 353 | /system/lib/libnfc_ndef.so 354 | /system/lib/libdvm.so 355 | /system/lib/libwpa_client.so 356 | /system/lib/libjpeg.so 357 | /system/lib/libaudioeffect_jni.so 358 | /system/lib/libhardware.so 359 | /system/lib/libc_malloc_debug_leak.so 360 | /system/lib/libspeexresampler.so 361 | /system/lib/libstagefright_avc_common.so 362 | /system/lib/libandroid_runtime.so 363 | /system/lib/libusbhost.so 364 | /system/lib/libWnnJpnDic.so 365 | /system/lib/libstagefright_yuv.so 366 | /system/lib/liblog.so 367 | /system/lib/libemoji.so 368 | /system/lib/libsqlite_jni.so 369 | /system/lib/libstagefright_foundation.so 370 | /system/lib/libstagefright_soft_vorbisdec.so 371 | /system/lib/libbinder.so 372 | /system/lib/libmediaplayerservice.so 373 | /system/lib/libgabi++.so 374 | /system/lib/libpagemap.so 375 | /system/lib/libsonivox.so 376 | /system/lib/libRS.so 377 | /system/lib/libskia.so 378 | /system/lib/libdrmframework.so 379 | /system/lib/libclcore.bc 380 | /system/lib/libjnigraphics.so 381 | /system/lib/libFFTEm.so 382 | /system/lib/libstagefright_soft_h264dec.so 383 | /system/lib/libandroid_servers.so 384 | /system/lib/libandroid.so 385 | /system/lib/libbcinfo.so 386 | /system/lib/libexpat.so 387 | /system/lib/libbcc.so 388 | /system/lib/libOpenSLES.so 389 | /system/lib/libdiskconfig.so 390 | /system/lib/libbcc.so.sha1 391 | /system/lib/libstagefright_soft_mp3dec.so 392 | /system/lib/libgui.so 393 | /system/lib/libpixelflinger.so 394 | /system/lib/libstagefright_soft_amrdec.so 395 | /system/lib/librtp_jni.so 396 | /system/lib/libaudioflinger.so 397 | /system/lib/libdl.so 398 | /system/lib/libSR_AudioIn.so 399 | /system/lib/libjni_latinime.so 400 | /system/lib/libstlport.so 401 | /system/lib/invoke_mock_media_player.so 402 | /system/lib/libttscompat.so 403 | /system/lib/libwebcore.so 404 | /system/lib/libOpenMAXAL.so 405 | /system/lib/libicuuc.so 406 | /system/lib/libz.so 407 | /system/lib/libGLESv1_enc.so 408 | /system/app/Music.odex 409 | /system/app/Development.odex 410 | /system/app/PinyinIME.odex 411 | /system/app/ConnectivityTest.apk 412 | /system/app/Protips.apk 413 | /system/app/NetSpeed.apk 414 | /system/app/Exchange.apk 415 | /system/app/OpenWnn.apk 416 | /system/app/Camera.odex 417 | /system/app/UserDictionaryProvider.apk 418 | /system/app/CertInstaller.apk 419 | /system/app/ApplicationsProvider.odex 420 | /system/app/LatinIME.odex 421 | /system/app/SpeechRecorder.odex 422 | /system/app/SettingsProvider.apk 423 | /system/app/Launcher2.apk 424 | /system/app/TelephonyProvider.odex 425 | /system/app/Gallery.odex 426 | /system/app/Development.apk 427 | /system/app/QuickSearchBox.odex 428 | /system/app/KeyChain.odex 429 | /system/app/MediaProvider.apk 430 | /system/app/Settings.apk 431 | /system/app/QuickSearchBox.apk 432 | /system/app/LiveWallpapersPicker.apk 433 | /system/app/DrmProvider.odex 434 | /system/app/GpsLocationTest.apk 435 | /system/app/ContactsProvider.apk 436 | /system/app/Settings.odex 437 | /system/app/SystemUI.apk 438 | /system/app/DownloadProvider.apk 439 | /system/app/Camera.apk 440 | /system/app/Protips.odex 441 | /system/app/CustomLocale.apk 442 | /system/app/CalendarProvider.odex 443 | /system/app/OpenWnn.odex 444 | /system/app/TelephonyProvider.apk 445 | /system/app/DrmProvider.apk 446 | /system/app/StingrayProgramMenuSystem.apk 447 | /system/app/CustomLocale.odex 448 | /system/app/Contacts.odex 449 | /system/app/Launcher2.odex 450 | /system/app/PicoTts.odex 451 | /system/app/ContactsProvider.odex 452 | /system/app/DownloadProviderUi.odex 453 | /system/app/NetSpeed.odex 454 | /system/app/GpsLocationTest.odex 455 | /system/app/Mms.apk 456 | /system/app/LiveWallpapersPicker.odex 457 | /system/app/Phone.odex 458 | /system/app/Music.apk 459 | /system/app/DefaultContainerService.apk 460 | /system/app/KeyChain.apk 461 | /system/app/PackageInstaller.apk 462 | /system/app/SdkSetup.odex 463 | /system/app/Calculator.apk 464 | /system/app/SoundRecorder.odex 465 | /system/app/SettingsProvider.odex 466 | /system/app/Browser.apk 467 | /system/app/SpeechRecorder.apk 468 | /system/app/SharedStorageBackup.apk 469 | /system/app/SoundRecorder.apk 470 | /system/app/Phone.apk 471 | /system/app/Gallery.apk 472 | /system/app/Exchange.odex 473 | /system/app/BackupRestoreConfirmation.apk 474 | /system/app/SystemUI.odex 475 | /system/app/ApplicationsProvider.apk 476 | /system/app/CalendarProvider.apk 477 | /system/app/HTMLViewer.odex 478 | /system/app/BackupRestoreConfirmation.odex 479 | /system/app/Calendar.odex 480 | /system/app/PinyinIME.apk 481 | /system/app/DownloadProviderUi.apk 482 | /system/app/DownloadProvider.odex 483 | /system/app/Fallback.apk 484 | /system/app/LatinIME.apk 485 | /system/app/Email.odex 486 | /system/app/ConnectivityTest.odex 487 | /system/app/StingrayProgramMenu.apk 488 | /system/app/HTMLViewer.apk 489 | /system/app/PicoTts.apk 490 | /system/app/Email.apk 491 | /system/app/DeskClock.odex 492 | /system/app/CertInstaller.odex 493 | /system/app/SharedStorageBackup.odex 494 | /system/app/PackageInstaller.odex 495 | /system/app/Browser.odex 496 | /system/app/VpnDialogs.odex 497 | /system/app/DeskClock.apk 498 | /system/app/Calculator.odex 499 | /system/app/SdkSetup.apk 500 | /system/app/Mms.odex 501 | /system/app/MediaProvider.odex 502 | /system/app/Contacts.apk 503 | /system/app/UserDictionaryProvider.odex 504 | /system/app/Fallback.odex 505 | /system/app/Calendar.apk 506 | /system/app/DefaultContainerService.odex 507 | /system/app/VpnDialogs.apk 508 | /system/bin/dumpsys 509 | /system/bin/InputReader_test 510 | /system/bin/iptables 511 | /system/bin/dumpstate 512 | /system/bin/am 513 | /system/bin/bmgr 514 | /system/bin/servicemanager 515 | /system/bin/dalvikvm 516 | /system/bin/monkey 517 | /system/bin/BlobCache_test 518 | /system/bin/mtpd 519 | /system/bin/rild 520 | /system/bin/pppd 521 | /system/bin/Looper_test 522 | /system/bin/ZipFileRO_test 523 | /system/bin/recordvideo 524 | /system/bin/system_server 525 | /system/bin/keystore_cli 526 | /system/bin/omx_tests 527 | /system/bin/installd 528 | /system/bin/audioloop 529 | /system/bin/svc 530 | /system/bin/showlease 531 | /system/bin/ime 532 | /system/bin/radiooptions 533 | /system/bin/logwrapper 534 | /system/bin/adb 535 | /system/bin/simg2img 536 | /system/bin/qemu-props 537 | /system/bin/dexopt 538 | /system/bin/ObbFile_test 539 | /system/bin/racoon 540 | /system/bin/InputDispatcher_test 541 | /system/bin/surfaceflinger 542 | /system/bin/sf2 543 | /system/bin/ping 544 | /system/bin/schedtest 545 | /system/bin/stream 546 | /system/bin/debuggerd 547 | /system/bin/String8_test 548 | /system/bin/netd 549 | /system/bin/record 550 | /system/bin/logcat 551 | /system/bin/keystore 552 | /system/bin/Unicode_test 553 | /system/bin/service 554 | /system/bin/linker 555 | /system/bin/sdcard 556 | /system/bin/mediaserver 557 | /system/bin/toolbox 558 | /system/bin/gdbserver 559 | /system/bin/gdbjithelper 560 | /system/bin/ping6 561 | /system/bin/check_prereq 562 | /system/bin/screenshot 563 | /system/bin/decoder 564 | /system/bin/bootanimation 565 | /system/bin/bu 566 | /system/bin/sensorservice 567 | /system/bin/vdc 568 | /system/bin/run-as 569 | /system/bin/ndc 570 | /system/bin/netcfg 571 | /system/bin/InputEvent_test 572 | /system/bin/screencap 573 | /system/bin/InputPublisherAndConsumer_test 574 | /system/bin/ip6tables 575 | /system/bin/dhcpcd 576 | /system/bin/updater 577 | /system/bin/recovery 578 | /system/bin/bugreport 579 | /system/bin/skia_test 580 | /system/bin/input 581 | /system/bin/gzip 582 | /system/bin/app_process 583 | /system/bin/InputChannel_test 584 | /system/bin/vold 585 | /system/bin/testid3 586 | /system/bin/stagefright 587 | /system/bin/qemud 588 | /system/bin/applypatch_static 589 | /system/bin/applypatch 590 | /system/bin/flash_image 591 | /system/bin/fsck_msdos 592 | /system/bin/ash 593 | /system/bin/pm 594 | /system/build.prop 595 | /system/xbin/procrank 596 | /system/xbin/showslab 597 | /system/xbin/netserver 598 | /system/xbin/showmap 599 | /system/xbin/strace 600 | /system/xbin/sane_schedstat 601 | /system/xbin/librank 602 | /system/xbin/btool 603 | /system/xbin/tcpdump 604 | /system/xbin/su 605 | /system/xbin/check-lost+found 606 | /system/xbin/ssh 607 | /system/xbin/daemonize 608 | /system/xbin/cpueater 609 | /system/xbin/rawbu 610 | /system/xbin/directiotest 611 | /system/xbin/scp 612 | /system/xbin/latencytop 613 | /system/xbin/netperf 614 | /system/xbin/nc 615 | /system/xbin/sqlite3 616 | /system/xbin/micro_bench 617 | /system/xbin/dexdump 618 | /system/xbin/add-property-tag 619 | /system/xbin/procmem 620 | /system/xbin/timeinfo 621 | -------------------------------------------------------------------------------- /blobutil/emulator_systems/sdk_15.txt: -------------------------------------------------------------------------------- 1 | /system/usr/share/zoneinfo/zoneinfo.dat 2 | /system/usr/share/zoneinfo/zoneinfo.idx 3 | /system/usr/share/zoneinfo/zoneinfo.version 4 | /system/usr/share/bmd/RFFspeed_501.bmd 5 | /system/usr/share/bmd/RFFstd_501.bmd 6 | /system/usr/keylayout/Vendor_046d_Product_c294.kl 7 | /system/usr/keylayout/Vendor_046d_Product_c532.kl 8 | /system/usr/keylayout/AVRCP.kl 9 | /system/usr/keylayout/Vendor_05ac_Product_0239.kl 10 | /system/usr/keylayout/Vendor_046d_Product_c216.kl 11 | /system/usr/keylayout/qwerty.kl 12 | /system/usr/keylayout/Vendor_045e_Product_028e.kl 13 | /system/usr/keylayout/Vendor_22b8_Product_093d.kl 14 | /system/usr/keylayout/Vendor_054c_Product_0268.kl 15 | /system/usr/keylayout/Vendor_046d_Product_c299.kl 16 | /system/usr/keylayout/Generic.kl 17 | /system/usr/idc/qwerty2.idc 18 | /system/usr/idc/qwerty.idc 19 | /system/usr/srec/config/en.us/baseline11k.par 20 | /system/usr/srec/config/en.us/grammars/VoiceDialer.g2g 21 | /system/usr/srec/config/en.us/grammars/boolean.g2g 22 | /system/usr/srec/config/en.us/grammars/phone_type_choice.g2g 23 | /system/usr/srec/config/en.us/baseline.par 24 | /system/usr/srec/config/en.us/g2p/en-US-ttp.data 25 | /system/usr/srec/config/en.us/models/generic.swiarb 26 | /system/usr/srec/config/en.us/models/generic8.lda 27 | /system/usr/srec/config/en.us/models/generic11_f.swimdl 28 | /system/usr/srec/config/en.us/models/generic8_m.swimdl 29 | /system/usr/srec/config/en.us/models/generic11.lda 30 | /system/usr/srec/config/en.us/models/generic11_m.swimdl 31 | /system/usr/srec/config/en.us/models/generic8_f.swimdl 32 | /system/usr/srec/config/en.us/dictionary/enroll.ok 33 | /system/usr/srec/config/en.us/dictionary/basic.ok 34 | /system/usr/srec/config/en.us/dictionary/cmu6plus.ok.zip 35 | /system/usr/srec/config/en.us/baseline8k.par 36 | /system/usr/icu/icudt46l.dat 37 | /system/usr/keychars/qwerty.kcm 38 | /system/usr/keychars/Virtual.kcm 39 | /system/usr/keychars/Generic.kcm 40 | /system/usr/keychars/qwerty2.kcm 41 | /system/media/audio/ui/VideoRecord.ogg 42 | /system/media/audio/ui/camera_click.ogg 43 | /system/etc/system_fonts.xml 44 | /system/etc/event-log-tags 45 | /system/etc/vold.fstab 46 | /system/etc/permissions/handheld_core_hardware.xml 47 | /system/etc/permissions/platform.xml 48 | /system/etc/permissions/android.hardware.camera.autofocus.xml 49 | /system/etc/permissions/android.hardware.touchscreen.multitouch.jazzhand.xml 50 | /system/etc/permissions/com.android.location.provider.xml 51 | /system/etc/security/cacerts/d777342d.0 52 | /system/etc/security/cacerts/ddc328ff.0 53 | /system/etc/security/cacerts/ed524cf5.0 54 | /system/etc/security/cacerts/ee7cd6fb.0 55 | /system/etc/security/cacerts/3ad48a91.0 56 | /system/etc/security/cacerts/2fa87019.0 57 | /system/etc/security/cacerts/5e4e69e7.0 58 | /system/etc/security/cacerts/882de061.0 59 | /system/etc/security/cacerts/399e7759.0 60 | /system/etc/security/cacerts/1eb37bdf.0 61 | /system/etc/security/cacerts/e60bf0c0.0 62 | /system/etc/security/cacerts/81b9768f.0 63 | /system/etc/security/cacerts/c33a80d4.0 64 | /system/etc/security/cacerts/a0bc6fbb.0 65 | /system/etc/security/cacerts/dbc54cab.0 66 | /system/etc/security/cacerts/27af790d.0 67 | /system/etc/security/cacerts/1dcd6f4c.0 68 | /system/etc/security/cacerts/95aff9e3.0 69 | /system/etc/security/cacerts/f61bff45.0 70 | /system/etc/security/cacerts/2fb1850a.0 71 | /system/etc/security/cacerts/3c860d51.0 72 | /system/etc/security/cacerts/895cad1a.0 73 | /system/etc/security/cacerts/ed049835.0 74 | /system/etc/security/cacerts/69105f4f.0 75 | /system/etc/security/cacerts/c215bc69.0 76 | /system/etc/security/cacerts/7999be0d.0 77 | /system/etc/security/cacerts/cf701eeb.0 78 | /system/etc/security/cacerts/87753b0d.0 79 | /system/etc/security/cacerts/9339512a.0 80 | /system/etc/security/cacerts/2afc57aa.0 81 | /system/etc/security/cacerts/add67345.0 82 | /system/etc/security/cacerts/ff783690.0 83 | /system/etc/security/cacerts/7a481e66.0 84 | /system/etc/security/cacerts/7d453d8f.0 85 | /system/etc/security/cacerts/6adf0799.0 86 | /system/etc/security/cacerts/1dbdda5b.0 87 | /system/etc/security/cacerts/418595b9.0 88 | /system/etc/security/cacerts/ea169617.0 89 | /system/etc/security/cacerts/3a3b02ce.0 90 | /system/etc/security/cacerts/08aef7bb.0 91 | /system/etc/security/cacerts/219d9499.0 92 | /system/etc/security/cacerts/7651b327.0 93 | /system/etc/security/cacerts/4fbd6bfa.0 94 | /system/etc/security/cacerts/bcdd5959.0 95 | /system/etc/security/cacerts/cdaebb72.0 96 | /system/etc/security/cacerts/e48193cf.0 97 | /system/etc/security/cacerts/5a3f0ff8.0 98 | /system/etc/security/cacerts/c527e4ab.0 99 | /system/etc/security/cacerts/84cba82f.0 100 | /system/etc/security/cacerts/56b8a0b6.0 101 | /system/etc/security/cacerts/1df5ec47.0 102 | /system/etc/security/cacerts/ab5346f4.0 103 | /system/etc/security/cacerts/23f4c490.0 104 | /system/etc/security/cacerts/1e8e7201.0 105 | /system/etc/security/cacerts/60afe812.0 106 | /system/etc/security/cacerts/524d9b43.0 107 | /system/etc/security/cacerts/facacbc6.0 108 | /system/etc/security/cacerts/1dac3003.0 109 | /system/etc/security/cacerts/b0f3e76e.0 110 | /system/etc/security/cacerts/ccc52f49.0 111 | /system/etc/security/cacerts/fac084d7.0 112 | /system/etc/security/cacerts/c8763593.0 113 | /system/etc/security/cacerts/17b51fe6.0 114 | /system/etc/security/cacerts/c7e2a638.0 115 | /system/etc/security/cacerts/03e16f6c.0 116 | /system/etc/security/cacerts/6e8bf996.0 117 | /system/etc/security/cacerts/f4996e82.0 118 | /system/etc/security/cacerts/3c58f906.0 119 | /system/etc/security/cacerts/8f7b96c4.0 120 | /system/etc/security/cacerts/f58a60fe.0 121 | /system/etc/security/cacerts/d64f06f3.0 122 | /system/etc/security/cacerts/5cf9d536.0 123 | /system/etc/security/cacerts/12d55845.0 124 | /system/etc/security/cacerts/86212b19.0 125 | /system/etc/security/cacerts/7a819ef2.0 126 | /system/etc/security/cacerts/74c26bd0.0 127 | /system/etc/security/cacerts/33815e15.0 128 | /system/etc/security/cacerts/bf64f35b.0 129 | /system/etc/security/cacerts/b7db1890.0 130 | /system/etc/security/cacerts/9f533518.0 131 | /system/etc/security/cacerts/1155c94b.0 132 | /system/etc/security/cacerts/e7b8d656.0 133 | /system/etc/security/cacerts/6fcc125d.0 134 | /system/etc/security/cacerts/9685a493.0 135 | /system/etc/security/cacerts/3e7271e8.0 136 | /system/etc/security/cacerts/d537fba6.0 137 | /system/etc/security/cacerts/00673b5b.0 138 | /system/etc/security/cacerts/67495436.0 139 | /system/etc/security/cacerts/fde84897.0 140 | /system/etc/security/cacerts/e775ed2d.0 141 | /system/etc/security/cacerts/76579174.0 142 | /system/etc/security/cacerts/5046c355.0 143 | /system/etc/security/cacerts/eb375c3e.0 144 | /system/etc/security/cacerts/f80cc7f6.0 145 | /system/etc/security/cacerts/75680d2e.0 146 | /system/etc/security/cacerts/635ccfd5.0 147 | /system/etc/security/cacerts/48478734.0 148 | /system/etc/security/cacerts/111e6273.0 149 | /system/etc/security/cacerts/a7605362.0 150 | /system/etc/security/cacerts/1920cacb.0 151 | /system/etc/security/cacerts/7d3cd826.0 152 | /system/etc/security/cacerts/bc3f2570.0 153 | /system/etc/security/cacerts/bda4cc84.0 154 | /system/etc/security/cacerts/bdacca6f.0 155 | /system/etc/security/cacerts/9772ca32.0 156 | /system/etc/security/cacerts/a15b3b6b.0 157 | /system/etc/security/cacerts/57692373.0 158 | /system/etc/security/cacerts/343eb6cb.0 159 | /system/etc/security/cacerts/3d441de8.0 160 | /system/etc/security/cacerts/d8274e24.0 161 | /system/etc/security/cacerts/46b2fd3b.0 162 | /system/etc/security/cacerts/4d654d1d.0 163 | /system/etc/security/cacerts/5a5372fc.0 164 | /system/etc/security/cacerts/10531352.0 165 | /system/etc/security/cacerts/455f1b52.0 166 | /system/etc/security/cacerts/5021a0a2.0 167 | /system/etc/security/cacerts/11a09b38.0 168 | /system/etc/security/cacerts/594f1775.0 169 | /system/etc/security/cacerts/d16a5865.0 170 | /system/etc/security/cacerts/e8651083.0 171 | /system/etc/security/cacerts/4e18c148.0 172 | /system/etc/security/cacerts/a7d2cf64.0 173 | /system/etc/security/cacerts/72f369af.0 174 | /system/etc/security/cacerts/89c02a45.0 175 | /system/etc/security/cacerts/0d188d89.0 176 | /system/etc/security/cacerts/a3896b44.0 177 | /system/etc/security/cacerts/58a44af1.0 178 | /system/etc/security/cacerts/85cde254.0 179 | /system/etc/security/cacerts/9dbefe7b.0 180 | /system/etc/security/cacerts/9d6523ce.0 181 | /system/etc/security/cacerts/8470719d.0 182 | /system/etc/security/cacerts/2e8714cb.0 183 | /system/etc/security/cacerts/119afc2e.0 184 | /system/etc/security/cacerts/72fa7371.0 185 | /system/etc/security/otacerts.zip 186 | /system/etc/hosts 187 | /system/etc/ppp/ip-up-vpn 188 | /system/etc/dbus.conf 189 | /system/etc/fallback_fonts.xml 190 | /system/etc/apns-conf.xml 191 | /system/etc/NOTICE.html.gz 192 | /system/etc/init.goldfish.sh 193 | /system/etc/dhcpcd/dhcpcd-run-hooks 194 | /system/etc/dhcpcd/dhcpcd-hooks/95-configured 195 | /system/etc/dhcpcd/dhcpcd-hooks/20-dns.conf 196 | /system/framework/monkey.jar 197 | /system/framework/bu.jar 198 | /system/framework/apache-xml.odex 199 | /system/framework/bmgr.jar 200 | /system/framework/framework.odex 201 | /system/framework/core-junit.odex 202 | /system/framework/android.test.runner.jar 203 | /system/framework/framework-res.apk 204 | /system/framework/ime.jar 205 | /system/framework/am.jar 206 | /system/framework/filterfw.jar 207 | /system/framework/bouncycastle.odex 208 | /system/framework/pm.odex 209 | /system/framework/input.jar 210 | /system/framework/pm.jar 211 | /system/framework/javax.obex.jar 212 | /system/framework/javax.obex.odex 213 | /system/framework/core.jar 214 | /system/framework/input.odex 215 | /system/framework/android.test.runner.odex 216 | /system/framework/services.odex 217 | /system/framework/com.android.location.provider.jar 218 | /system/framework/svc.odex 219 | /system/framework/bouncycastle.jar 220 | /system/framework/services.jar 221 | /system/framework/core-junit.jar 222 | /system/framework/com.android.location.provider.odex 223 | /system/framework/framework.jar 224 | /system/framework/ime.odex 225 | /system/framework/apache-xml.jar 226 | /system/framework/filterfw.odex 227 | /system/framework/ext.jar 228 | /system/framework/android.policy.odex 229 | /system/framework/ext.odex 230 | /system/framework/android.policy.jar 231 | /system/framework/monkey.odex 232 | /system/framework/bmgr.odex 233 | /system/framework/core.odex 234 | /system/framework/bu.odex 235 | /system/framework/svc.jar 236 | /system/framework/am.odex 237 | /system/tts/lang_pico/en-GB_ta.bin 238 | /system/tts/lang_pico/en-GB_kh0_sg.bin 239 | /system/tts/lang_pico/fr-FR_nk0_sg.bin 240 | /system/tts/lang_pico/en-US_lh0_sg.bin 241 | /system/tts/lang_pico/de-DE_gl0_sg.bin 242 | /system/tts/lang_pico/de-DE_ta.bin 243 | /system/tts/lang_pico/it-IT_ta.bin 244 | /system/tts/lang_pico/es-ES_ta.bin 245 | /system/tts/lang_pico/fr-FR_ta.bin 246 | /system/tts/lang_pico/es-ES_zl0_sg.bin 247 | /system/tts/lang_pico/en-US_ta.bin 248 | /system/tts/lang_pico/it-IT_cm0_sg.bin 249 | /system/fonts/DroidSerif-BoldItalic.ttf 250 | /system/fonts/DroidSansGeorgian.ttf 251 | /system/fonts/DroidSansFallback.ttf 252 | /system/fonts/DroidSansMono.ttf 253 | /system/fonts/Roboto-Italic.ttf 254 | /system/fonts/Roboto-Bold.ttf 255 | /system/fonts/DroidSerif-Regular.ttf 256 | /system/fonts/AndroidClock.ttf 257 | /system/fonts/DroidSansHebrew-Bold.ttf 258 | /system/fonts/DroidSansThai.ttf 259 | /system/fonts/DroidSansHebrew-Regular.ttf 260 | /system/fonts/AndroidClock_Solid.ttf 261 | /system/fonts/DroidSansArmenian.ttf 262 | /system/fonts/Roboto-Regular.ttf 263 | /system/fonts/DroidSansEthiopic-Regular.ttf 264 | /system/fonts/DroidSerif-Italic.ttf 265 | /system/fonts/DroidNaskh-Regular.ttf 266 | /system/fonts/DroidSerif-Bold.ttf 267 | /system/fonts/Clockopia.ttf 268 | /system/fonts/AndroidClock_Highlight.ttf 269 | /system/fonts/Roboto-BoldItalic.ttf 270 | /system/lib/libnetutils.so 271 | /system/lib/libthread_db.so 272 | /system/lib/libjni_mosaic.so 273 | /system/lib/libstagefright.so 274 | /system/lib/libsensorservice.so 275 | /system/lib/libinput.so 276 | /system/lib/libssl.so 277 | /system/lib/libpowermanager.so 278 | /system/lib/egl/libGLES_android.so 279 | /system/lib/egl/egl.cfg 280 | /system/lib/egl/libGLESv2_emulation.so 281 | /system/lib/egl/libGLESv1_CM_emulation.so 282 | /system/lib/egl/libEGL_emulation.so 283 | /system/lib/libmedia.so 284 | /system/lib/libcrypto.so 285 | /system/lib/libstdc++.so 286 | /system/lib/libm.so 287 | /system/lib/libexif.so 288 | /system/lib/libeffects.so 289 | /system/lib/libsurfaceflinger.so 290 | /system/lib/libETC1.so 291 | /system/lib/libstagefright_omx.so 292 | /system/lib/libwilhelm.so 293 | /system/lib/libGLESv2_dbg.so 294 | /system/lib/libcutils.so 295 | /system/lib/libdrm1.so 296 | /system/lib/libvariablespeed.so 297 | /system/lib/libstagefright_amrnb_common.so 298 | /system/lib/libfilterpack_imageproc.so 299 | /system/lib/libc.so 300 | /system/lib/libsurfaceflinger_client.so 301 | /system/lib/libchromium_net.so 302 | /system/lib/libmtp.so 303 | /system/lib/libWnnEngDic.so 304 | /system/lib/libsqlite.so 305 | /system/lib/libEGL.so 306 | /system/lib/libnativehelper.so 307 | /system/lib/libGLESv2.so 308 | /system/lib/libGLESv2_enc.so 309 | /system/lib/libGLESv1_CM.so 310 | /system/lib/libsystem_server.so 311 | /system/lib/libui.so 312 | /system/lib/lib_renderControl_enc.so 313 | /system/lib/libvorbisidec.so 314 | /system/lib/libwnndict.so 315 | /system/lib/libctest.so 316 | /system/lib/libstagefright_enc_common.so 317 | /system/lib/libext4_utils.so 318 | /system/lib/libharfbuzz.so 319 | /system/lib/libstagefright_soft_g711dec.so 320 | /system/lib/libwebrtc_audio_preprocessing.so 321 | /system/lib/libstagefright_soft_mpeg4dec.so 322 | /system/lib/libutils.so 323 | /system/lib/hw/audio.primary.goldfish.so 324 | /system/lib/hw/lights.goldfish.so 325 | /system/lib/hw/audio_policy.default.so 326 | /system/lib/hw/gralloc.default.so 327 | /system/lib/hw/gralloc.goldfish.so 328 | /system/lib/hw/camera.goldfish.so 329 | /system/lib/hw/gps.goldfish.so 330 | /system/lib/hw/sensors.goldfish.so 331 | /system/lib/libreference-ril.so 332 | /system/lib/libpower.so 333 | /system/lib/libdrm1_jni.so 334 | /system/lib/libmedia_jni.so 335 | /system/lib/libstagefright_soft_vpxdec.so 336 | /system/lib/libcameraservice.so 337 | /system/lib/libril.so 338 | /system/lib/libdefcontainer_jni.so 339 | /system/lib/libOpenglSystemCommon.so 340 | /system/lib/libttspico.so 341 | /system/lib/libsoundpool.so 342 | /system/lib/libstagefright_soft_aacdec.so 343 | /system/lib/libsysutils.so 344 | /system/lib/libsrec_jni.so 345 | /system/lib/libicui18n.so 346 | /system/lib/libc_malloc_debug_qemu.so 347 | /system/lib/soundfx/libaudiopreprocessing.so 348 | /system/lib/soundfx/libbundlewrapper.so 349 | /system/lib/soundfx/libvisualizer.so 350 | /system/lib/soundfx/libreverbwrapper.so 351 | /system/lib/libhardware_legacy.so 352 | /system/lib/libcamera_client.so 353 | /system/lib/librs_jni.so 354 | /system/lib/libfilterfw.so 355 | /system/lib/libnfc_ndef.so 356 | /system/lib/libdvm.so 357 | /system/lib/libwpa_client.so 358 | /system/lib/libjpeg.so 359 | /system/lib/libaudioeffect_jni.so 360 | /system/lib/libhardware.so 361 | /system/lib/libc_malloc_debug_leak.so 362 | /system/lib/libspeexresampler.so 363 | /system/lib/libstagefright_avc_common.so 364 | /system/lib/libandroid_runtime.so 365 | /system/lib/libusbhost.so 366 | /system/lib/libWnnJpnDic.so 367 | /system/lib/libstagefright_yuv.so 368 | /system/lib/liblog.so 369 | /system/lib/libemoji.so 370 | /system/lib/libsqlite_jni.so 371 | /system/lib/libstagefright_foundation.so 372 | /system/lib/libstagefright_soft_vorbisdec.so 373 | /system/lib/libbinder.so 374 | /system/lib/libmediaplayerservice.so 375 | /system/lib/libgabi++.so 376 | /system/lib/libpagemap.so 377 | /system/lib/libsonivox.so 378 | /system/lib/libRS.so 379 | /system/lib/libskia.so 380 | /system/lib/libdrmframework.so 381 | /system/lib/libclcore.bc 382 | /system/lib/libjnigraphics.so 383 | /system/lib/libhwui.so 384 | /system/lib/libFFTEm.so 385 | /system/lib/libstagefright_soft_h264dec.so 386 | /system/lib/libandroid_servers.so 387 | /system/lib/libandroid.so 388 | /system/lib/libbcinfo.so 389 | /system/lib/libexpat.so 390 | /system/lib/libbcc.so 391 | /system/lib/libOpenSLES.so 392 | /system/lib/libdiskconfig.so 393 | /system/lib/libbcc.so.sha1 394 | /system/lib/libstagefright_soft_mp3dec.so 395 | /system/lib/libgui.so 396 | /system/lib/libpixelflinger.so 397 | /system/lib/libstagefright_soft_amrdec.so 398 | /system/lib/librtp_jni.so 399 | /system/lib/libaudioflinger.so 400 | /system/lib/libdl.so 401 | /system/lib/libSR_AudioIn.so 402 | /system/lib/libjni_latinime.so 403 | /system/lib/libstlport.so 404 | /system/lib/invoke_mock_media_player.so 405 | /system/lib/libttscompat.so 406 | /system/lib/libwebcore.so 407 | /system/lib/libOpenMAXAL.so 408 | /system/lib/libicuuc.so 409 | /system/lib/libz.so 410 | /system/lib/libGLESv1_enc.so 411 | /system/app/Music.odex 412 | /system/app/Development.odex 413 | /system/app/PinyinIME.odex 414 | /system/app/ConnectivityTest.apk 415 | /system/app/Protips.apk 416 | /system/app/NetSpeed.apk 417 | /system/app/Exchange.apk 418 | /system/app/OpenWnn.apk 419 | /system/app/Camera.odex 420 | /system/app/UserDictionaryProvider.apk 421 | /system/app/CertInstaller.apk 422 | /system/app/ApplicationsProvider.odex 423 | /system/app/LatinIME.odex 424 | /system/app/SpeechRecorder.odex 425 | /system/app/SettingsProvider.apk 426 | /system/app/Launcher2.apk 427 | /system/app/TelephonyProvider.odex 428 | /system/app/Gallery.odex 429 | /system/app/Development.apk 430 | /system/app/QuickSearchBox.odex 431 | /system/app/KeyChain.odex 432 | /system/app/MediaProvider.apk 433 | /system/app/Settings.apk 434 | /system/app/QuickSearchBox.apk 435 | /system/app/LiveWallpapersPicker.apk 436 | /system/app/DrmProvider.odex 437 | /system/app/GpsLocationTest.apk 438 | /system/app/ContactsProvider.apk 439 | /system/app/Settings.odex 440 | /system/app/SystemUI.apk 441 | /system/app/DownloadProvider.apk 442 | /system/app/Camera.apk 443 | /system/app/Protips.odex 444 | /system/app/CustomLocale.apk 445 | /system/app/CalendarProvider.odex 446 | /system/app/OpenWnn.odex 447 | /system/app/TelephonyProvider.apk 448 | /system/app/DrmProvider.apk 449 | /system/app/StingrayProgramMenuSystem.apk 450 | /system/app/CustomLocale.odex 451 | /system/app/Contacts.odex 452 | /system/app/Launcher2.odex 453 | /system/app/PicoTts.odex 454 | /system/app/ContactsProvider.odex 455 | /system/app/DownloadProviderUi.odex 456 | /system/app/NetSpeed.odex 457 | /system/app/GpsLocationTest.odex 458 | /system/app/Mms.apk 459 | /system/app/LiveWallpapersPicker.odex 460 | /system/app/Phone.odex 461 | /system/app/Music.apk 462 | /system/app/DefaultContainerService.apk 463 | /system/app/KeyChain.apk 464 | /system/app/PackageInstaller.apk 465 | /system/app/SdkSetup.odex 466 | /system/app/Calculator.apk 467 | /system/app/SoundRecorder.odex 468 | /system/app/SettingsProvider.odex 469 | /system/app/Browser.apk 470 | /system/app/SpeechRecorder.apk 471 | /system/app/SharedStorageBackup.apk 472 | /system/app/SoundRecorder.apk 473 | /system/app/Phone.apk 474 | /system/app/Gallery.apk 475 | /system/app/Exchange.odex 476 | /system/app/BackupRestoreConfirmation.apk 477 | /system/app/SystemUI.odex 478 | /system/app/ApplicationsProvider.apk 479 | /system/app/CalendarProvider.apk 480 | /system/app/HTMLViewer.odex 481 | /system/app/BackupRestoreConfirmation.odex 482 | /system/app/Calendar.odex 483 | /system/app/PinyinIME.apk 484 | /system/app/DownloadProviderUi.apk 485 | /system/app/DownloadProvider.odex 486 | /system/app/Fallback.apk 487 | /system/app/LatinIME.apk 488 | /system/app/Email.odex 489 | /system/app/ConnectivityTest.odex 490 | /system/app/StingrayProgramMenu.apk 491 | /system/app/HTMLViewer.apk 492 | /system/app/PicoTts.apk 493 | /system/app/Email.apk 494 | /system/app/DeskClock.odex 495 | /system/app/CertInstaller.odex 496 | /system/app/SharedStorageBackup.odex 497 | /system/app/PackageInstaller.odex 498 | /system/app/Browser.odex 499 | /system/app/VpnDialogs.odex 500 | /system/app/DeskClock.apk 501 | /system/app/Calculator.odex 502 | /system/app/SdkSetup.apk 503 | /system/app/Mms.odex 504 | /system/app/MediaProvider.odex 505 | /system/app/Contacts.apk 506 | /system/app/UserDictionaryProvider.odex 507 | /system/app/Fallback.odex 508 | /system/app/Calendar.apk 509 | /system/app/DefaultContainerService.odex 510 | /system/app/VpnDialogs.apk 511 | /system/bin/dumpsys 512 | /system/bin/InputReader_test 513 | /system/bin/iptables 514 | /system/bin/dumpstate 515 | /system/bin/am 516 | /system/bin/bmgr 517 | /system/bin/servicemanager 518 | /system/bin/dalvikvm 519 | /system/bin/monkey 520 | /system/bin/BlobCache_test 521 | /system/bin/mtpd 522 | /system/bin/rild 523 | /system/bin/pppd 524 | /system/bin/Looper_test 525 | /system/bin/ZipFileRO_test 526 | /system/bin/recordvideo 527 | /system/bin/system_server 528 | /system/bin/keystore_cli 529 | /system/bin/omx_tests 530 | /system/bin/installd 531 | /system/bin/audioloop 532 | /system/bin/svc 533 | /system/bin/showlease 534 | /system/bin/ime 535 | /system/bin/radiooptions 536 | /system/bin/logwrapper 537 | /system/bin/adb 538 | /system/bin/simg2img 539 | /system/bin/qemu-props 540 | /system/bin/dexopt 541 | /system/bin/ObbFile_test 542 | /system/bin/racoon 543 | /system/bin/InputDispatcher_test 544 | /system/bin/surfaceflinger 545 | /system/bin/sf2 546 | /system/bin/ping 547 | /system/bin/schedtest 548 | /system/bin/stream 549 | /system/bin/debuggerd 550 | /system/bin/String8_test 551 | /system/bin/netd 552 | /system/bin/record 553 | /system/bin/logcat 554 | /system/bin/keystore 555 | /system/bin/Unicode_test 556 | /system/bin/service 557 | /system/bin/linker 558 | /system/bin/sdcard 559 | /system/bin/mediaserver 560 | /system/bin/toolbox 561 | /system/bin/gdbserver 562 | /system/bin/gdbjithelper 563 | /system/bin/ping6 564 | /system/bin/check_prereq 565 | /system/bin/screenshot 566 | /system/bin/decoder 567 | /system/bin/bootanimation 568 | /system/bin/bu 569 | /system/bin/sensorservice 570 | /system/bin/vdc 571 | /system/bin/run-as 572 | /system/bin/ndc 573 | /system/bin/netcfg 574 | /system/bin/InputEvent_test 575 | /system/bin/screencap 576 | /system/bin/InputPublisherAndConsumer_test 577 | /system/bin/ip6tables 578 | /system/bin/dhcpcd 579 | /system/bin/updater 580 | /system/bin/recovery 581 | /system/bin/bugreport 582 | /system/bin/skia_test 583 | /system/bin/input 584 | /system/bin/gzip 585 | /system/bin/app_process 586 | /system/bin/InputChannel_test 587 | /system/bin/vold 588 | /system/bin/testid3 589 | /system/bin/stagefright 590 | /system/bin/qemud 591 | /system/bin/applypatch_static 592 | /system/bin/applypatch 593 | /system/bin/flash_image 594 | /system/bin/fsck_msdos 595 | /system/bin/ash 596 | /system/bin/pm 597 | /system/build.prop 598 | /system/xbin/procrank 599 | /system/xbin/showslab 600 | /system/xbin/netserver 601 | /system/xbin/showmap 602 | /system/xbin/strace 603 | /system/xbin/sane_schedstat 604 | /system/xbin/librank 605 | /system/xbin/btool 606 | /system/xbin/tcpdump 607 | /system/xbin/su 608 | /system/xbin/check-lost+found 609 | /system/xbin/ssh 610 | /system/xbin/daemonize 611 | /system/xbin/cpueater 612 | /system/xbin/rawbu 613 | /system/xbin/directiotest 614 | /system/xbin/scp 615 | /system/xbin/latencytop 616 | /system/xbin/netperf 617 | /system/xbin/nc 618 | /system/xbin/sqlite3 619 | /system/xbin/micro_bench 620 | /system/xbin/dexdump 621 | /system/xbin/add-property-tag 622 | /system/xbin/procmem 623 | /system/xbin/timeinfo 624 | -------------------------------------------------------------------------------- /build_prepare.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ##################################################################### 3 | 4 | echo -e "\nThis sets the OTA package path to /tmp and depending on your selection\nmake an insecure build as well.\n\n" 5 | 6 | BOARDCNFMK="$1" 7 | 8 | F_CHECK(){ 9 | echo -e "\nYour current settings:\n" 10 | echo -e "OTA path (build/core/Makefile):\n$(grep 'INTERNAL_OTA_PACKAGE_TARGET :=' build/core/Makefile)" 11 | echo -e "\ninsecure state (vendor/lineage/config/common.mk):\n$(grep "secure=" vendor/lineage/config/common.mk)" 12 | echo -e "\nselinux state (device/lge/g4-common/BoardConfigCommon.mk):\n$(grep 'androidboot.selinux=' $BOARDCNFMK)" 13 | echo 14 | } 15 | 16 | F_INSEC(){ 17 | echo -e "... prepare insecure building:" 18 | sed -i "s/ro.adb.secure=./ro.adb.secure=0/" vendor/lineage/config/common.mk 19 | echo -e "... set the build permissive..." 20 | sed -i 's/androidboot.selinux=enforcing/androidboot.selinux=permissive/g' $BOARDCNFMK 21 | F_CHECK 22 | } 23 | 24 | F_INSEC_OFF(){ 25 | echo -e "... prepare secure building:" 26 | CPWD=$(pwd) 27 | cd vendor/lineage/ && git reset --hard 28 | cd $CPWD 29 | echo -e "vendor/lineage/config/common.mk:\t$(grep secure= vendor/lineage/config/common.mk |tr '\n' ,)\n" 30 | echo -e "... set the build to enforcing.." 31 | sed -i 's/androidboot.selinux=permissive/androidboot.selinux=enforcing/g' $BOARDCNFMK 32 | F_CHECK 33 | } 34 | 35 | F_TMP(){ 36 | echo -e "... set path to ramdisk:" 37 | ROUTPATH=out/zip 38 | [ ! -L $ROUTPATH ] && ln -s /tmp/zip $ROUTPATH 39 | sed -i 's#INTERNAL_OTA_PACKAGE_TARGET := .*/$(name).zip#INTERNAL_OTA_PACKAGE_TARGET := ${OUT_DIR}/zip/$(name).zip#g' build/core/Makefile 40 | echo -e "build/core/Makefile:\t\t\t$(grep 'INTERNAL_OTA_PACKAGE_TARGET :=' build/core/Makefile)\n" 41 | F_CHECK 42 | } 43 | 44 | F_HELP(){ 45 | echo -e "\nUSAGE / HELP" 46 | echo -e "----------------------\n" 47 | echo -e "Mandatory arg:\t (the full device tree path containing the mk file which defines the cmdline)" 48 | echo -e "Action args:\tinsecure, setpath, check, resetall" 49 | echo -e "\nmultiple options are allowed for: insecure and setpath but NOT for resetinsecure or resetall\n\n" 50 | exit 9 51 | 52 | } 53 | 54 | [ ! -f "$BOARDCNFMK" ] && echo -e "ERROR: $BOARDCNFMK is not a file!\n\n" && F_HELP && exit 99 55 | shift 56 | 57 | case $1 in 58 | help|-help|--help) 59 | F_HELP 60 | ;; 61 | insecure|setpath|resetinsecure|resetall|check) 62 | ;; 63 | *) 64 | echo -e "\nmissing arg!!" 65 | F_HELP 66 | ;; 67 | esac 68 | 69 | while [ ! -z "$1" ];do 70 | case $1 in 71 | insecure) 72 | F_INSEC 73 | shift 74 | ;; 75 | setpath) 76 | F_TMP 77 | shift 78 | ;; 79 | resetinsecure) 80 | F_INSEC_OFF 81 | exit 82 | ;; 83 | resetall) 84 | echo -e "This will RESET ALL PROJECTS to default (repo forall -vc 'git reset --hard')!" 85 | read -p "Are you sure? " ANS 86 | [ "$ANS" == "y" ] && repo forall -vc "git reset --hard" 87 | exit 88 | ;; 89 | check) 90 | F_CHECK 91 | exit 92 | ;; 93 | *) 94 | F_HELP 95 | ;; 96 | esac 97 | done 98 | -------------------------------------------------------------------------------- /cherrypicker.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | ################################################################################## 3 | # forked from: https://github.com/GeoZac/android_vendor_unconv 4 | # License: GPLv3 5 | ################################################################################## 6 | 7 | import sys 8 | from argparse import ArgumentParser 9 | 10 | # Spice up the output 11 | from colorama import init, deinit, Fore # Back, Style 12 | from pygerrit2 import GerritRestAPI 13 | from pyperclip import copy 14 | 15 | from xtrasforcherrypicker import BLACKLIST, UPSTREAM, WHITELIST 16 | 17 | init(autoreset=False) 18 | 19 | DASHES = "=" * 55 20 | STARS = "*" * 55 21 | 22 | 23 | def show_banner(): 24 | print(Fore.GREEN) 25 | print(STARS) 26 | print(" Cherrypick Helper") 27 | print(STARS) 28 | 29 | 30 | def check_excludes(args, c_topic): 31 | # Split excludes into a list so that we can skip multiple topics 32 | exclusions = list(args.E.split(",") if args.E is not None else "") 33 | if exclusions is not None and c_topic in exclusions: 34 | return False 35 | 36 | return True 37 | 38 | 39 | # Initialise some variables 40 | PROJECTS = {} 41 | TOPICS = [] 42 | # Make a copy of the blocked repos so I can modify it if required 43 | BLOCK_LIST = BLACKLIST 44 | # Set of changes which will be skipped in all cases 45 | DNM = [ 46 | ] 47 | 48 | 49 | def get_query(url, query): 50 | rest = GerritRestAPI(url=url, auth=None) 51 | return rest.get(query) 52 | 53 | 54 | # Print help and wait for a input 55 | # if args.H is not None: 56 | # show_help() 57 | def show_help(): 58 | print(" Cherrypicker") 59 | print("") 60 | 61 | 62 | def check_upstream(args): 63 | status = "open" if args.O else "merged" 64 | if args.C == "ALL": 65 | projects = UPSTREAM 66 | else: 67 | projects = [project for project in UPSTREAM if args.C in project.lower()] 68 | 69 | for upstream_project in projects: 70 | upstream_numbers = "" 71 | upstream_addr, upstream_brnch = setup_project(args) 72 | upstream_project = f"android_{upstream_project}" 73 | # query = "/q/status:merged branch:lineage-15.1 project:LineageOS/android_{0}".format(project) 74 | query = f"/changes/?q=project:LineageOS/{upstream_project}%20status:{status}%20branch:{upstream_brnch}" 75 | upstream_changes = get_query(upstream_addr, query)[:15] 76 | print(Fore.BLUE, upstream_project) 77 | for upstream_change in reversed(upstream_changes): 78 | upstream_number = upstream_change["_number"] 79 | upstream_subject = upstream_change["subject"] 80 | if "translation" in upstream_subject: 81 | continue 82 | print(Fore.GREEN, upstream_number, Fore.CYAN, upstream_subject, Fore.RED, get_topic(upstream_change)) 83 | upstream_numbers = upstream_numbers + " " + str(upstream_number) 84 | print(f"repopick -g {upstream_addr} {upstream_numbers} -P {set_path(upstream_project)}") 85 | input("Continue ?") 86 | 87 | deinit() 88 | sys.exit(0) 89 | 90 | 91 | # noinspection PyShadowingNames 92 | def check_mergeable(change): 93 | try: 94 | return change["mergeable"] 95 | except KeyError: 96 | return False 97 | 98 | 99 | def get_topic(m_change): 100 | try: 101 | return m_change["topic"] 102 | except KeyError: 103 | return None 104 | 105 | 106 | def adjust_for_qcom(change): 107 | branch = change["branch"] 108 | name = change["project"] 109 | if "pn5xx" in branch: 110 | name = name.replace("opensource_", "opensource_pn5xx_") 111 | change["project"] = name 112 | return change 113 | if "sn100x" in branch: 114 | name = name.replace("opensource_", "opensource_sn100x_") 115 | change["project"] = name 116 | return change 117 | if "caf" in branch: 118 | board = branch.split("caf-")[-1] 119 | name = name.replace("qcom_", f"qcom-caf_{board}_") 120 | change["project"] = name 121 | return change 122 | if "-legacy-um" in branch: 123 | name = name.replace("sepolicy", "sepolicy-legacy-um") 124 | change["project"] = name 125 | return change 126 | if "-legacy" in branch: 127 | name = name.replace("sepolicy", "sepolicy-legacy") 128 | change["project"] = name 129 | return change 130 | print("Caught a new one to adjust for path", branch) 131 | return change 132 | 133 | 134 | # Nope these only worth picking up 135 | def setup_project(args, verbose=False): 136 | if args.R == "los": 137 | msg = "Seems,serious" 138 | addr = "https://review.lineageos.org" 139 | base_branch = args.B if args.B is not None else "lineage-21.0" 140 | # Kill the blocklist if searching LineageOS gerrit 141 | global BLOCK_LIST 142 | BLOCK_LIST = [] 143 | elif args.R is not None: 144 | msg = "Who dis?" 145 | addr = args.R 146 | base_branch = args.B 147 | else: 148 | msg = "Meh,its just ice cold" 149 | addr = "https://gerrit.aicp-rom.com" 150 | base_branch = args.B if args.B is not None else "u14.0" 151 | if verbose: 152 | print(Fore.YELLOW, f"\b{msg}") 153 | if not base_branch: 154 | print("Need to specify a branch,use -B argument") 155 | sys.exit(0) 156 | 157 | return addr, base_branch 158 | 159 | 160 | def set_query(args): 161 | if args.Q is not None: 162 | return f"/changes/?q={args.Q}" 163 | query = "/changes/?q=status:open" 164 | if args.T is None: 165 | final_q = query 166 | else: 167 | q_topic = f" topic:{args.T}" 168 | final_q = "".join([query, q_topic]) 169 | if args.D: 170 | print(final_q) 171 | return final_q 172 | 173 | 174 | def get_changes(args): 175 | gerrit_addr, gerrit_branch = setup_project(args, True) 176 | query = set_query(args) 177 | changes = get_query(gerrit_addr, query) 178 | if args.D: 179 | print(query) 180 | total = len(changes) 181 | if total > 200 and args.S is None: 182 | print(f"{total} Changes \nBetter to add a start number or streamline search") 183 | if input("Set it from manifest ?").lower() == "y": 184 | args.S = set_start(args) 185 | changes = get_query(gerrit_addr, query) 186 | else: 187 | sys.exit(0) 188 | 189 | if not changes: 190 | print("No changes, try playing with arguments") 191 | sys.exit(0) 192 | else: 193 | print(Fore.LIGHTMAGENTA_EX, f"\b{total} changes") 194 | return changes, gerrit_branch 195 | 196 | 197 | def set_path(project_name): 198 | # Broken cases: external_wpa_supplicant_8 199 | 200 | if "build" in project_name: 201 | project_name += "_make" 202 | 203 | elif project_name in ["AICP/bionic", "AICP/art"]: 204 | return project_name.strip("AICP/") 205 | 206 | elif "vendor_lineage" in project_name: 207 | project_name = "vendor_aicp" 208 | return project_name.replace("_", "/") 209 | 210 | if "_" not in project_name: 211 | return "*Manifest Change*" 212 | 213 | if "AICP" in project_name: 214 | project_path = project_name.split("AICP/")[1] 215 | project_path = project_path.replace("_", "/") 216 | return project_path 217 | 218 | project_path = project_name.split("_", 1)[1] 219 | project_path = project_path.replace("_", "/") 220 | return project_path 221 | 222 | 223 | def set_start(args): 224 | if args.S is not None: 225 | return args.S 226 | # platform_manifest gets only changed once in a while 227 | gerrit_addr, current_branch = setup_project(args) 228 | full_query = f"/changes/?q=project:AICP/platform_manifest status:merged branch:{current_branch}" 229 | if "aicp" in gerrit_addr and not args.S: # Get the last merged important change 230 | platform_changes = get_query(gerrit_addr, full_query) 231 | if not platform_changes: 232 | return 0 233 | last_patch = platform_changes[5]["_number"] 234 | last_patch_change = platform_changes[5]["subject"] 235 | print(Fore.RED, f"\b{last_patch} {last_patch_change} set as start for commit filter\n") 236 | args.S = last_patch 237 | return last_patch 238 | 239 | return 0 240 | 241 | 242 | def append_projects(args, change): 243 | project = change["project"] 244 | PROJECTS[project] = {} 245 | PROJECTS[project]["path"] = set_path(project) 246 | # AICP can resolve its own paths, so it gets a separate string of repopick numbers 247 | if args.R is not None: 248 | PROJECTS[project]["gerrit"] = setup_project(args)[0] 249 | PROJECTS[project]["numbers"] = [change["_number"]] 250 | 251 | 252 | def parse_changes(args, changes, gerrit_branch): 253 | skipped = 0 254 | merged = False 255 | total = len(changes) 256 | digits = len(str(changes[0]["_number"])) 257 | for index, change in enumerate(reversed(changes)): 258 | # print(change) 259 | number = change["_number"] 260 | subject = change["subject"] 261 | topic = get_topic(change) 262 | project = change["project"] 263 | can_merge = check_mergeable(change) 264 | if number >= set_start(args) and gerrit_branch in change["branch"]: 265 | if not any(item in project.lower() for item in BLOCK_LIST) or any( 266 | item in project.lower() for item in WHITELIST): 267 | if gerrit_branch != change["branch"]: 268 | change = adjust_for_qcom(change) 269 | if (change["status"] != "MERGED" or args.D or args.M) and number not in DNM: 270 | print( 271 | Fore.GREEN, f"\b{str(index + 1).zfill(3)}/{total}", 272 | Fore.BLUE, str(number).rjust(digits), 273 | Fore.CYAN, str(can_merge).ljust(7), 274 | Fore.LIGHTBLUE_EX, subject[:55].ljust(55), 275 | Fore.YELLOW, project[-20:].ljust(20), "|", 276 | Fore.MAGENTA, topic if topic else "" 277 | ) 278 | if (not check_excludes(args, topic)) or (not can_merge and not args.M): 279 | skipped += 1 280 | continue 281 | if topic not in TOPICS and topic is not None: 282 | TOPICS.append(topic) 283 | if change["status"] == "MERGED": 284 | merged = True 285 | if project not in PROJECTS: 286 | append_projects(args, change) 287 | 288 | else: 289 | PROJECTS[project]["numbers"].append(number) 290 | elif args.D: 291 | print( 292 | Fore.RED, f"\b{str(index + 1).zfill(3)}/{total}", 293 | Fore.RED, str(number).rjust(digits), 294 | Fore.RED, "Ignored", 295 | Fore.RED, subject[:55].ljust(55), 296 | Fore.RED, project[-20:].ljust(20), "|", 297 | Fore.RED, topic if topic else "" 298 | ) 299 | return skipped, merged 300 | 301 | 302 | def present_changes(args, skipped, merged): 303 | to_pick = 0 304 | cherry_picked = 0 305 | numbers = "" 306 | fwb = "AICP/frameworks_base" 307 | print(DASHES) 308 | print(Fore.GREEN, f"\b{len(PROJECTS)} projects") 309 | print(f"Skipping {args.E if args.E is not None else 'None'}") 310 | print(DASHES) 311 | for project in PROJECTS: 312 | change_numbers = PROJECTS[project]["numbers"] 313 | change_numbers.sort() # Doesn't seem to work in next line 314 | count = len(change_numbers) 315 | print(Fore.YELLOW, "\brepopick", Fore.RED, "\b-g", PROJECTS[project].get("gerrit", "\b" * 4), 316 | "-f" if merged else "\b", "-P", PROJECTS[project]["path"], 317 | " ".join(str(x) for x in change_numbers), Fore.CYAN) 318 | to_pick += len(change_numbers) 319 | if args.R is None and fwb in project: 320 | continue 321 | cherry_picked = count if count > cherry_picked else cherry_picked 322 | numbers += " ".join(str(x) for x in change_numbers) + " " 323 | if args.R is None and cherry_picked > 0: 324 | print(DASHES) 325 | pick_string = f"repopick {numbers}-c {cherry_picked}" 326 | print(Fore.CYAN, f"\b{pick_string}") 327 | copy(pick_string) 328 | if PROJECTS.get(fwb, None): # Not all queries may have a change in fwb 329 | fwb_changes = PROJECTS[fwb]["numbers"] 330 | print(Fore.CYAN, "\brepopick", " ".join(str(x) for x in fwb_changes), "-c", args.F + len(fwb_changes)) 331 | print(DASHES) 332 | if TOPICS: 333 | print(Fore.GREEN, "\brepopick -t", " ".join(item for item in TOPICS if item)) 334 | print(DASHES) 335 | print(Fore.MAGENTA, f"\b{to_pick} commits to pick") 336 | print(Fore.BLUE, f"\b{skipped} commits skipped") 337 | print(DASHES) 338 | 339 | 340 | def parse_arguments(): 341 | parser = ArgumentParser() 342 | 343 | # All argument goes here 344 | parser.add_argument("-R", help="Select ROM to cherry pick from", type=str.lower) 345 | parser.add_argument("-T", help="Topics to pick") 346 | parser.add_argument("-S", type=int, help="Commit to start searching from") 347 | parser.add_argument("-B", help="Branch to search for") 348 | parser.add_argument("-D", action="store_true", help="Debug mode") 349 | parser.add_argument("-M", action="store_true", default=True, help="Check mergeability") 350 | parser.add_argument("-C", const="ALL", nargs="?", help="Check upstream for any new changes") 351 | parser.add_argument("-O", action="store_true", help="Search upstream for open changes") 352 | parser.add_argument("-Q", help="Query to search for") 353 | parser.add_argument("-E", help="Exclude topics") 354 | parser.add_argument("-F", nargs="?", const=1, type=int, default=22, help="No of Commits to check for on fwb") 355 | 356 | # parser.add_argument("-h", help="Show the f***ing help and exit") 357 | return parser.parse_args() 358 | 359 | 360 | # Always keep this method above main, for better control 361 | def set_defaults(args): 362 | assert args is not None 363 | 364 | 365 | def repo_pick(): 366 | args = parse_arguments() 367 | set_defaults(args) 368 | if args.C is not None: 369 | args.R = "los" 370 | args.B = None 371 | check_upstream(args) 372 | changes, branch = get_changes(args) 373 | skipped, merged = parse_changes(args, changes, branch) 374 | present_changes(args, skipped, merged) 375 | 376 | 377 | if __name__ == "__main__": 378 | show_banner() 379 | repo_pick() 380 | -------------------------------------------------------------------------------- /codereview/bracechecker.c: -------------------------------------------------------------------------------- 1 | /* Program to check rudimentary syntax errors like unmatch braces,brakets or parenthesis */ 2 | 3 | #include 4 | 5 | int brace,brack,paren; 6 | 7 | void incomment(); 8 | void inquote(int c); 9 | void search(int c); 10 | 11 | int main(void) 12 | { 13 | int c; 14 | 15 | extern int brace,brack,paren; 16 | extern int bracecnt; 17 | 18 | while((c=getchar())!=EOF) 19 | if( c == '/') 20 | if((c=getchar())== '*') 21 | incomment(); 22 | else 23 | search(c); 24 | else if( c == '\'' || c == '"') 25 | inquote(c); 26 | else 27 | search(c); 28 | 29 | if( brace < 0) 30 | { 31 | printf("Unmatched Braces\n"); 32 | printf("%d\n", bracecnt); 33 | brace = 0; 34 | } 35 | else if( brack < 0) 36 | { 37 | printf("Unmatched brackets\n"); 38 | brack = 0; 39 | } 40 | else if( paren < 0) 41 | { 42 | printf("Unmatched parenthesis\n"); 43 | paren = 0; 44 | } 45 | 46 | if(brace > 0) 47 | printf("Unmatched braces\n"); 48 | else if(brack > 0) 49 | printf("Unmatched brackets\n"); 50 | else if(paren > 0) 51 | printf("Unmatched parenthesis\n"); 52 | 53 | return 0; 54 | } 55 | 56 | void incomment() 57 | { 58 | int c,d; 59 | 60 | c = getchar(); 61 | d = getchar(); 62 | 63 | while(c != '*' || d != '/') 64 | { 65 | c = d; 66 | d = getchar(); 67 | } 68 | } 69 | 70 | void inquote(int c) 71 | { 72 | int d; 73 | 74 | putchar(c); 75 | 76 | while((d=getchar())!=c) 77 | if( d == '\\') 78 | getchar(); 79 | } 80 | 81 | void search(int c) 82 | { 83 | extern int brace,brack,paren; 84 | int bracecnt; 85 | 86 | if ( c == '{') 87 | ++bracecnt, 88 | printf("%c\n", c), 89 | --brace; 90 | else if ( c == '}') 91 | ++brace; 92 | else if( c == '(') 93 | --brack; 94 | else if( c == ')') 95 | ++brack; 96 | else if( c == '[') 97 | --paren; 98 | else if( c == ']') 99 | ++paren; 100 | } 101 | 102 | 103 | 104 | 105 | -------------------------------------------------------------------------------- /codereview/bracechecker.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # python 3 4 | # spec at http://xahlee.org/comp/validate_matching_brackets.html 5 | # 2011-07-17 6 | # by Raymond Hettinger 7 | 8 | input_dir = "/home/xdajog/android/cm_kk/kernel/samsung/i927/drivers/usb/gadget/" 9 | 10 | import os, re 11 | 12 | def check_balance(characters): 13 | '''Return -1 if all delimiters are balanced or 14 | the char number of the first delimiter mismatch. 15 | 16 | ''' 17 | openers = { 18 | '(': ')', 19 | '{': '}', 20 | '[': ']' 21 | } 22 | closers = set(openers.values()) 23 | stack = [] 24 | for i, c in enumerate(characters, start=1): 25 | if c in openers: 26 | stack.append(openers[c]) 27 | elif c in closers: 28 | if not stack or c != stack.pop(): 29 | return i 30 | if stack: 31 | print("MISMATCH AT:") 32 | print(stack) 33 | return i 34 | return -1 35 | 36 | def scan(directory, encoding='utf-8'): 37 | for dirpath, dirnames, filenames in os.walk(directory): 38 | for filename in filenames: 39 | fullname = os.path.join(dirpath, filename) 40 | print ( "processing:" + fullname) 41 | with open(fullname, 'r', encoding=encoding) as f: 42 | try: 43 | characters = f.read() 44 | except UnicodeDecodeError: 45 | continue 46 | position = check_balance(characters) 47 | if position >= 0: 48 | print('{0!r}: {1}'.format(position, fullname)) 49 | 50 | scan(input_dir) 51 | 52 | print ("done") 53 | -------------------------------------------------------------------------------- /codereview/bracechecker.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ################################################################## 3 | # 4 | # Taken from: 5 | # http://unix.stackexchange.com/questions/10267/how-to-find-unmatched-brackets-in-a-text-file 6 | # 7 | ################################################################## 8 | 9 | # Itentify the script 10 | bname="$(basename "$0")" 11 | # Make a work dir 12 | wdir="/tmp/$USER/$bname" 13 | [[ ! -d "$wdir" ]] && mkdir -p "$wdir" 14 | 15 | # Arg1: The bracket pair 'string' 16 | pair="$1" 17 | # pair='[]' # test 18 | # pair='<>' # test 19 | # pair='{}' # test 20 | # pair='()' # test 21 | 22 | # Arg2: The input file to test 23 | ufile="$2" 24 | # Build a test source file 25 | ifile="$wdir/$bname.in" 26 | cp "$ufile" "$ifile" 27 | while IFS= read -r line ;do 28 | echo "$line" >> "$ifile" 29 | done < < 33 | < > 34 | < > > > 35 | ----+----1----+----2----+----3----+----4----+----5----+----6 36 | { } { } } } } 37 | ( ) ( ( ( ) ) 38 | ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 39 | EOF 40 | 41 | echo "File = $ifile" 42 | # Count how many: Left, Right, and Both 43 | left=${pair:0:1} 44 | rght=${pair:1:1} 45 | echo "Pair = $left$rght" 46 | 47 | # Make a stripped-down 'skeleton' of the source file - brackets only 48 | skel="/tmp/$USER/$bname.skel" 49 | cp /dev/null "$skel" 50 | 51 | # Make a String Of Brackets file ... (It is tricky manipulating bash strings with [].. 52 | sed 's/[^'${rght}${left}']//g' "$ifile" > "$skel" 53 | < "$skel" tr -d '\n' > "$skel.str" 54 | Left=($(<"$skel.str" tr -d "$left" |wc -m -l)); LeftCt=$((${Left[1]}-${Left[0]})) 55 | Rght=($(<"$skel.str" tr -d "$rght" |wc -m -l)); RghtCt=$((${Rght[1]}-${Rght[0]})) 56 | #Rght=($(<"$skel.str" tr -d "$left" |wc -m -l)); LeftCt=$((${Rght[1]}-${Rght[0]})) 57 | #Left=($(<"$skel.str" tr -d "$rght" |wc -m -l)); RghtCt=$((${Left[1]}-${Left[0]})) 58 | 59 | yBkts=($(sed -e "s/\(.\)/ \1 /g" "$skel.str")) 60 | BothCt=$((LeftCt+RghtCt)) 61 | eleCtB=${#yBkts[@]} 62 | echo 63 | 64 | if (( eleCtB != BothCt )) ; then 65 | echo "ERROR: array Item Count ($eleCtB)" 66 | echo " should equal BothCt ($BothCt)" 67 | exit 1 68 | else 69 | grpIx=0 # Keep track of Groups of nested pairs 70 | eleIxFir[$grpIx]=0 # Ix of First Bracket in a specific Group 71 | eleCtL=0 # Count of Left brackets in current Group 72 | eleCtR=0 # Count of Right brackets in current Group 73 | errIx=-1 # Ix of an element in error. 74 | for (( eleIx=0; eleIx <= eleCtB; eleIx++ )) ; do 75 | if [[ "${yBkts[eleIx]}" == "$left" ]] ; then 76 | # Left brackets are 'okay' until proven otherwise 77 | ((eleCtL++)) # increment Left bracket count 78 | else 79 | ((eleCtR++)) # increment Right bracket count 80 | # Right brackets are 'okay' until their count exceeds that of Left brackets 81 | if (( eleCtR > eleCtL )) ; then 82 | echo 83 | echo "ERROR: MIS-matching Right \"$rght\" in Group $((grpIx+1)) (at Bracket $((eleIx+1)) overall)" 84 | errType=$rght 85 | errIx=$eleIx 86 | break 87 | elif (( eleCtL == eleCtR )) ; then 88 | echo "*INFO: Group $((grpIx+1)) contains $eleCtL matching pairs" 89 | # Reset the element counts, and note the first element Ix for the next group 90 | eleCtL=0 91 | eleCtR=0 92 | ((grpIx++)) 93 | eleIxFir[$grpIx]=$((eleIx+1)) 94 | fi 95 | fi 96 | done 97 | # 98 | if (( eleCtL > eleCtR )) ; then 99 | # Left brackets are always potentially valid (until EOF)... 100 | # so, this 'error' is the last element in array 101 | echo 102 | echo "eleCtR > eleCtL are: $eleCtR $eleCtL" 103 | echo "ERROR: *END-OF-FILE* encountered after Bracket $eleCtB." 104 | echo " A Left \"$left\" is un-paired in Group $((grpIx+1))." 105 | errType=$left 106 | unpairedCt=$((eleCtL-eleCtR)) 107 | errIx=$((${eleIxFir[grpIx]}+unpairedCt-1)) 108 | echo " Group $((grpIx+1)) has $unpairedCt un-paired Left \"$left\"." 109 | echo " Group $((grpIx+1)) begins at Bracket $((eleIxFir[grpIx]+1))." 110 | fi 111 | 112 | # On error, get Line and Column numbers 113 | if (( errIx >= 0 )) ; then 114 | errLNum=0 # Source Line number (current). 115 | eleCtSoFar=0 # Count of bracket-elements in lines processed so far. 116 | errItemNum=$((errIx+1)) # error Ix + 1 (ie. "1 based") 117 | # Read the skeketon file to find the error line-number 118 | while IFS= read -r skline ; do 119 | ((errLNum++)) 120 | brackets="${skline//[^"${rght}${left}"]/}" # remove whitespace 121 | ((eleCtSoFar+=${#brackets})) 122 | if (( eleCtSoFar >= errItemNum )) ; then 123 | # We now have the error line-number 124 | # ..now get the relevant Source Line 125 | excerpt=$(< "$ifile" tail -n +$errLNum |head -n 1) 126 | # Homogenize the brackets (to be all "Left"), for easy counting 127 | mogX="${excerpt//$rght/$left}"; mogXCt=${#mogX} # How many 'Both' brackets on the error line? 128 | if [[ "$errType" == "$left" ]] ; then 129 | # R-Trunc from the error element [inclusive] 130 | ((eleTruncCt=eleCtSoFar-errItemNum+1)) 131 | for (( ele=0; ele 10 | ################################################################################################## 11 | VERSION="v0.7" 12 | 13 | # a static date when you start using this script the first time 14 | # it is just used for informational purpose to show in the title of the total count 15 | FIRSTRUN="2019-01-01" 16 | 17 | # start this tool like this to 18 | # DEBUG=1 gendllog_ng.sh 19 | [ -z "$DEBUG" ] && DEBUG=0 20 | 21 | # the base directory where the report file(s) should be placed 22 | ROMDIR="/home/nightlies/roms/theme" 23 | 24 | # the full path(s) to the webserver log(s) 25 | # multiple log paths need to be separated by a space 26 | WEBLOG='/var/lib/lxd/containers/ota/rootfs/var/log/apache2/access_ssl.log /var/lib/lxd/containers/ota/rootfs/var/log/apache2/access.log' 27 | 28 | # logrotate command to execute after each run: 29 | # ensure you use '-f' to ENFORCE rotating so we do not count things again on next run 30 | LOGREXEC="lxc exec ota -- logrotate -f /etc/logrotate.d/apache2" 31 | 32 | # report file names with their corresponding search pattern 33 | # the format is as follows: 34 | # STAT[N]=: 35 | # STAT[N] can be any number, just ensure you put new ones in "STATFILES=" variable 36 | # is a local unique path accessible from the internet, becomes the actual report file 37 | # can be 1 or multiple regex pattern separated by a pipe 38 | STATF1="$ROMDIR/ota_stats_los.html:lineage/.*/lineage.*\.zip" 39 | STATF2="$ROMDIR/ota_stats_e-os.html:e-os/.*/e-.*\.zip" 40 | STATF3="$ROMDIR/ota_stats_axp.html:axp/.*/AXP.*\.zip" 41 | 42 | # if you add additional STATF[N] statements above, add them here as well 43 | # the parser will only handle the STATFILES var 44 | STATFILES="$STATF1 $STATF2 $STATF3" 45 | 46 | # besides the above defined search patterns these are excluded always 47 | # separated by pipe, pattern can be a regex 48 | EXCLUDE="/theme/|css|md5|sha256|sha512|\.prop|/api/" 49 | 50 | ################################################################################################################################ 51 | 52 | F_HELP(){ 53 | cat <<_EOHELP 54 | 55 | $0 version - $VERSION 56 | a helper to generate VERY basic html reports 57 | 58 | it will: 59 | 1. parse all logfiles defined in WEBLOG (currently set: $WEBLOG) 60 | 2. search for given pattern(s) 61 | 3. generate counts for found patterns 62 | 4. stores the total result count in a persistent file 63 | 5. generates a stats html report 64 | 6. triggers a logrotate if all went fine 65 | 66 | Usage: 67 | 68 | $0 (without arguments) regular usage. will run, parse, generate stats 69 | $0 fresh will skip any previous calculation results 70 | $0 help|-help|--help this message 71 | 72 | Environment: 73 | 74 | export DEBUG=1 will print a lot of information and skips: 75 | persistent file creation (step4), logrotate (step6) 76 | step5 will create a stats file named .debug.html 77 | 78 | Schedule: 79 | 80 | once the script is working as expected create e.g. a /etc/cron.d/gen-stats: 81 | 82 | # generate download stats 83 | SHELL=/bin/bash 84 | PATH=/sbin:/bin:/usr/sbin:/usr/bin 85 | 30 1 * * 1 root /root/gen_simple_dl-stats.sh 86 | 87 | with the above cron you will just see the stats from the last week. if you want e.g. monthly 88 | logs you should use cron.monthly to generate it monthly but then you might need to adjust 89 | the logrotate.d config as well! the logrotate.d conf should always fire way later then your 90 | cron so it actually should NEVER gets executed - because this is handled by this script. 91 | 92 | _EOHELP 93 | } 94 | 95 | SKIPCALC=0 96 | 97 | # parse args 98 | case $1 in 99 | help|-help|--help) F_HELP; exit;; 100 | *clean|clean) SKIPCALC=1 ;; 101 | esac 102 | 103 | [ $DEBUG -eq 1 ] && SKIPCALC=1 104 | 105 | # logging func 106 | F_LOG(){ 107 | MODE=$1 108 | MSG="$2" 109 | 110 | case $MODE in 111 | D) echo -e "$(date '+%F %T') - DEBUG - $MSG" ;; 112 | *) echo -e "$(date '+%F %T') - INFO - $MSG" ;; 113 | esac 114 | } 115 | 116 | # parse logs... 117 | for statfile in $STATFILES;do 118 | if [ $DEBUG -eq 1 ];then 119 | SHTML="${statfile/:*}.debug.html" 120 | cp ${statfile/:*} $SHTML 121 | else 122 | SHTML="${statfile/:*}" 123 | fi 124 | SEARCHSTR="${statfile/*:}" 125 | TOTALCNT=${SHTML}.total 126 | PERM_CNT_FILE=${SHTML}.permtotal 127 | 128 | [ $DEBUG -eq 1 ] && F_LOG D "SHTML: $SHTML, TOTALCNT: $TOTALCNT, PERM_CNT_FILE: $PERM_CNT_FILE" 129 | 130 | cat > $SHTML < 132 | 133 | 134 | 135 | Download stats 136 | 137 | 138 | 144 | 145 | 146 |

Download Statistics (since last check)

147 | (statistic last updated $(date '+%F %T'))
148 |
149 | EOHEAD 150 | 151 | # read in current stats 152 | if [ ! -f "$PERM_CNT_FILE" ] || [ $SKIPCALC -eq 1 ] ; then DLCNT=0; else eval $(cat $PERM_CNT_FILE);fi 153 | PASTCNT=$DLCNT 154 | 155 | for dl in $(zgrep --no-filename -E -i "GET.*/.*($SEARCHSTR).* 200 " $WEBLOG | grep -E -v "($EXCLUDE)" |cut -d ' ' -f "7,9" |cut -d " " -f1);do 156 | echo "${dl##*/}
" 157 | DLCNT=$((DLCNT+1)) 158 | echo $DLCNT > $TOTALCNT 159 | done | sort | uniq -c | sort -nr | sed 's#\([0-9]\) #\1 -- | -- #g'>> $SHTML 160 | 161 | [ $DEBUG -eq 1 ] && F_LOG D "grepped for $SEARCHSTR, got count of $(cat $TOTALCNT)" 162 | 163 | [ -f "$TOTALCNT" ] && echo "

Total Downloads (since: $FIRSTRUN)

$(cat $TOTALCNT)

" >> $SHTML #&& echo -e "DLCNT=$(cat $TOTALCNT)\nUDATE=$(date +%F)" > ${PERM_CNT_FILE}.tmp 164 | 165 | #EVALCNT=$(source ${PERM_CNT_FILE}.tmp; echo $DLCNT) 166 | CURCNT=$(cat $TOTALCNT) 167 | #SUMCNT=$(($EVALCNT + $CURCNT)) 168 | [ -z "$CURCNT" ] && CURCNT=0 169 | 170 | [ $DEBUG -eq 1 ] && F_LOG D "current count was $CURCNT (past count: $PASTCNT)" 171 | 172 | if [ "$CURCNT" -gt "$PASTCNT" ];then 173 | echo -e "DLCNT=$CURCNT\nUDATE=$(date +%F)" > ${PERM_CNT_FILE} 174 | else 175 | [ $DEBUG -eq 1 ] && F_LOG D "Not updating ${PERM_CNT_FILE} because: TOTALCNT ($TOTALCNT) is less then PASTCNT ($PASTCNT)" 176 | fi 177 | chmod +r ${PERM_CNT_FILE} 178 | 179 | echo "

Most recent downloads


" >> $SHTML 180 | for at in $(find $WEBLOG);do 181 | zgrep -E -i "GET.*/.*($SEARCHSTR).* 200 " $at | grep -E -v "($EXCLUDE)" |cut -d ' ' -f "4,7,9" | tr -d "[" |cut -d " " -f 1,2 #&& break 182 | done | sort -r | sed 's# /.*/# -- | -- #g' | sed 's#$#
#g' >> $SHTML 183 | 184 | if [ "$DEBUG" -eq 1 ];then 185 | for at in $(find $WEBLOG);do 186 | F_LOG D "$SEARCHSTR at $at excluding: $EXCLUDE" 187 | zgrep -E -i "GET.*/.*($SEARCHSTR).* 200 " $at | grep -E -v "($EXCLUDE)" |cut -d ' ' -f "4,7,9" | tr -d "[" |cut -d " " -f 1,2 #&& break 188 | done 189 | fi 190 | 191 | echo -e "" >> $SHTML 192 | 193 | done 194 | 195 | # FORCE logrotate run so we do not count everything again 196 | [ $DEBUG -ne 1 ] && $LOGREXEC 197 | -------------------------------------------------------------------------------- /jenkins/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ################################################################# 3 | # 4 | # wrapper to satisfy android builds with jenkins 5 | # 6 | ################################################################# 7 | 8 | echo "starting build wrapper $0 ..." 9 | SRCPATH="$1" 10 | RUNCMD="$@" 11 | 12 | 13 | source ~/.profile 14 | source ~/.bashrc 15 | 16 | [ -z "$CCACHE_DIR" ] && export CCACHE_DIR=/ccache/$USER 17 | 18 | echo -e "USE_CCACHE: $USE_CCACHE\nCCACHE_DIR: $CCACHE_DIR\nANDROID_JACK_VM_ARGS: $ANDROID_JACK_VM_ARGS\nSRCPATH: $SRCPATH\nRUNCMD: $RUNCMD" 19 | 20 | f_help(){ 21 | echo -e "\n\nUsage:\n $0 sources-path cmd-to-run\n" 22 | } 23 | 24 | [ -z "$RUNCMD" ] && echo "ERROR: uuhm.. missing RUNCMD! What should I do? smokin a pipe or what? try again! pfff.." && f_help && exit 3 25 | [ ! -d "$SRCPATH" ] && echo "ERROR: missing source path or $SRCPATH does not exists!" && exit 3 26 | 27 | cd $SRCPATH 28 | source build/envsetup.sh 29 | 30 | echo -e "ro.product.cpu.abilist=$TARGET_CPU_ABI,$TARGET_2ND_CPU_ABI" 31 | 32 | [ "$3" == "killjack" ] && jack-admin kill-server 33 | 34 | # filter out unwanted stuff 35 | RUNCMD=$(echo "$RUNCMD" |grep -vo killjack | grep -vo "$SRCPATH") 36 | 37 | $RUNCMD 38 | RET=$? 39 | 40 | echo -e "ro.product.cpu.abilist=$TARGET_CPU_ABI,$TARGET_2ND_CPU_ABI" 41 | 42 | echo "build wrapper $0 finished with $RET" 43 | exit $RET 44 | -------------------------------------------------------------------------------- /kernel-upstreaming/README.md: -------------------------------------------------------------------------------- 1 | # linux-stable merge script 2 | 3 | This script is designed to help you merge or pick linux-stable into your own kernel source repos. 4 | 5 | Either clone this repo or run the following command in the root of your kernel folder: 6 | 7 | `curl -o linux-stable.sh https://raw.githubusercontent.com/android-linux-stable/script/master/linux-stable.sh && chmod +x linux-stable.sh` 8 | 9 | Once you have it downloaded, run `./linux-stable.sh -h` to learn more about it 10 | 11 | If you have any questions or issues, file an issue on this repo! 12 | -------------------------------------------------------------------------------- /kernel-upstreaming/linux-stable.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Pull in linux-stable updates to a kernel tree 4 | # 5 | # Copyright (C) 2017-2018 Nathan Chancellor 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program. If not, see 19 | 20 | 21 | # Colors for script 22 | BOLD="\033[1m" 23 | GRN="\033[01;32m" 24 | RED="\033[01;31m" 25 | RST="\033[0m" 26 | YLW="\033[01;33m" 27 | 28 | 29 | # Alias for echo to handle escape codes like colors 30 | function echo() { 31 | command echo -e "$@" 32 | } 33 | 34 | 35 | # Prints a formatted header to point out what is being done to the user 36 | function header() { 37 | if [[ -n ${2} ]]; then 38 | COLOR=${2} 39 | else 40 | COLOR=${RED} 41 | fi 42 | echo "${COLOR}" 43 | # shellcheck disable=SC2034 44 | echo "====$(for i in $(seq ${#1}); do echo "=\c"; done)====" 45 | echo "== ${1} ==" 46 | # shellcheck disable=SC2034 47 | echo "====$(for i in $(seq ${#1}); do echo "=\c"; done)====" 48 | echo "${RST}" 49 | } 50 | 51 | 52 | # Prints an error in bold red 53 | function die() { 54 | echo 55 | echo "${RED}${1}${RST}" 56 | [[ ${2} = "-h" ]] && ${0} -h 57 | exit 1 58 | } 59 | 60 | 61 | # Prints a statement in bold green 62 | function success() { 63 | echo 64 | echo "${GRN}${1}${RST}" 65 | [[ -z ${2} ]] && echo 66 | } 67 | 68 | 69 | # Prints a warning in bold yellow 70 | function warn() { 71 | echo 72 | echo "${YLW}${1}${RST}" 73 | [[ -z ${2} ]] && echo 74 | } 75 | 76 | 77 | # Parse the provided parameters 78 | function parse_parameters() { 79 | while [[ $# -ge 1 ]]; do 80 | case ${1} in 81 | # Use git cherry-pick 82 | "-c"|"--cherry-pick") 83 | UPDATE_METHOD=cherry-pick ;; 84 | 85 | # Only update the linux-stable remote 86 | "-f"|"--fetch-only") 87 | FETCH_REMOTE_ONLY=true ;; 88 | 89 | # Help menu 90 | "-h"|"--help") 91 | echo 92 | echo "${BOLD}Command:${RST} ./$(basename "${0}") " 93 | echo 94 | echo "${BOLD}Script description:${RST} Merges/cherry-picks Linux upstream into a kernel tree" 95 | echo 96 | echo "${BOLD}Required parameters:${RST}" 97 | echo " -c | --cherry-pick" 98 | echo " -m | --merge" 99 | echo " Call either git cherry-pick or git merge when updating from upstream" 100 | echo 101 | echo "${BOLD}Optional parameters:${RST}" 102 | echo " -f | --fetch-only" 103 | echo " Simply fetches the tags from linux-stable then exits" 104 | echo 105 | echo " -k | --kernel-folder" 106 | echo " The device's kernel source's location; this can either be a full path or relative to where the script is being executed." 107 | echo 108 | echo " -l | --latest" 109 | echo " Updates to the latest version available for the current kernel tree" 110 | echo 111 | echo " -p | --print-latest" 112 | echo " Prints the latest version available for the current kernel tree then exits" 113 | echo 114 | echo " -v | --version" 115 | echo " Updates to the specified version (e.g. -v 3.18.78)" 116 | echo 117 | echo "${BOLD}Defaults:${RST}" 118 | echo " If -l or -v are not specified, ONE version is picked at a time (e.g. 3.18.31 to 3.18.32)" 119 | echo 120 | echo " If -k is not specified, the script assumes it is in the kernel source folder already" 121 | echo 122 | exit 1 ;; 123 | 124 | # Kernel source location 125 | "-k"|"--kernel-folder") 126 | shift 127 | [[ $# -lt 1 ]] && die "Please specify a kernel source location!" 128 | 129 | KERNEL_FOLDER=${1} ;; 130 | 131 | # Update to the latest version upstream unconditionally 132 | "-l"|"--latest") 133 | UPDATE_MODE=1 ;; 134 | 135 | # Use git merge 136 | "-m"|"--merge") 137 | UPDATE_METHOD=merge ;; 138 | 139 | # Print the latest version from kernel.org 140 | "-p"|"--print-latest") 141 | PRINT_LATEST=true ;; 142 | 143 | # Update to the specified version 144 | "-v"|"--version") 145 | shift 146 | [[ $# -lt 1 ]] && die "Please specify a version to update!" 147 | 148 | TARGET_VERSION=${1} ;; 149 | 150 | *) 151 | die "Invalid parameter!" ;; 152 | esac 153 | 154 | shift 155 | done 156 | 157 | # If kernel source isn't specified, assume we're there 158 | [[ -z ${KERNEL_FOLDER} ]] && KERNEL_FOLDER=$(pwd) 159 | 160 | # Sanity checks 161 | [[ ! ${UPDATE_METHOD} ]] && die "Neither cherry-pick nor merge were specified, please supply one!" -h 162 | [[ ! -d ${KERNEL_FOLDER} ]] && die "Invalid kernel source location specified! Folder does not exist" -h 163 | [[ ! -f ${KERNEL_FOLDER}/Makefile ]] && die "Invalid kernel source location specified! No Makefile present" -h 164 | 165 | # Default update mode is one version at a time 166 | [[ -z ${UPDATE_MODE} && -z ${TARGET_VERSION} ]] && UPDATE_MODE=0 167 | } 168 | 169 | 170 | # Update the linux-stable remote (and add it if it doesn't exist) 171 | function update_remote() { 172 | header "Updating linux-stable" 173 | 174 | # Add remote if it isn't already present 175 | cd "${KERNEL_FOLDER}" || die "Could not change into ${KERNEL_FOLDER}!" 176 | 177 | if git fetch --tags https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/; then 178 | success "linux-stable updated successfully!" 179 | else 180 | die "linux-stable update failed!" 181 | fi 182 | 183 | [[ ${FETCH_REMOTE_ONLY} ]] && exit 0 184 | } 185 | 186 | 187 | # Generate versions 188 | function generate_versions() { 189 | header "Calculating versions" 190 | 191 | # Full kernel version 192 | CURRENT_VERSION=$(make kernelversion) 193 | # First two numbers (3.4 | 3.10 | 3.18 | 4.4) 194 | CURRENT_MAJOR_VERSION=$(echo "${CURRENT_VERSION}" | cut -f 1,2 -d .) 195 | # Last number 196 | CURRENT_SUBLEVEL=$(echo "${CURRENT_VERSION}" | cut -d . -f 3) 197 | 198 | # Get latest update from upstream 199 | LATEST_VERSION=$(git tag --sort=-taggerdate -l "v${CURRENT_MAJOR_VERSION}"* | head -n 1 | sed s/v//) 200 | LATEST_SUBLEVEL=$(echo "${LATEST_VERSION}" | cut -d . -f 3) 201 | 202 | # Print the current/latest version and exit if requested 203 | echo "${BOLD}Current kernel version:${RST} ${CURRENT_VERSION}" 204 | echo 205 | echo "${BOLD}Latest kernel version:${RST} ${LATEST_VERSION}" 206 | if [[ ${PRINT_LATEST} ]]; then 207 | echo 208 | exit 0 209 | fi 210 | 211 | # UPDATE_MODES: 212 | # 0. Update one version 213 | # 1. Update to the latest version 214 | case ${UPDATE_MODE} in 215 | 0) 216 | TARGET_SUBLEVEL=$((CURRENT_SUBLEVEL + 1)) 217 | TARGET_VERSION=${CURRENT_MAJOR_VERSION}.${TARGET_SUBLEVEL} ;; 218 | 1) 219 | TARGET_VERSION=${LATEST_VERSION} ;; 220 | esac 221 | 222 | # Make sure target version is between current version and latest version 223 | TARGET_SUBLEVEL=$(echo "${TARGET_VERSION}" | cut -d . -f 3) 224 | [[ ${TARGET_SUBLEVEL} -le ${CURRENT_SUBLEVEL} ]] && die "${TARGET_VERSION} is already present in ${CURRENT_VERSION}!" 225 | [[ ${TARGET_SUBLEVEL} -gt ${LATEST_SUBLEVEL} ]] && die "${CURRENT_VERSION} is the latest!" 226 | [[ ${CURRENT_SUBLEVEL} -eq 0 ]] && CURRENT_VERSION=${CURRENT_MAJOR_VERSION} 227 | 228 | RANGE=v${CURRENT_VERSION}..v${TARGET_VERSION} 229 | 230 | echo 231 | echo "${BOLD}Target kernel version:${RST} ${TARGET_VERSION}" 232 | echo 233 | } 234 | 235 | 236 | function update_to_target_version() { 237 | case ${UPDATE_METHOD} in 238 | "cherry-pick") 239 | if ! git cherry-pick "${RANGE}"; then 240 | die "Cherry-pick needs manual intervention! Resolve conflicts then run: 241 | 242 | git add . && git cherry-pick --continue" 243 | else 244 | header "${TARGET_VERSION} PICKED CLEANLY!" "${GRN}" 245 | fi ;; 246 | 247 | "merge") 248 | if ! GIT_MERGE_VERBOSITY=1 git merge --no-edit "v${TARGET_VERSION}"; then 249 | die "Merge needs manual intervention! 250 | 251 | Resolve conflicts then run git commit!" 252 | else 253 | header "${TARGET_VERSION} MERGED CLEANLY!" "${GRN}" 254 | fi ;; 255 | esac 256 | } 257 | 258 | 259 | parse_parameters "$@" 260 | update_remote 261 | generate_versions 262 | update_to_target_version 263 | -------------------------------------------------------------------------------- /memcheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ########################################################################### 3 | # 4 | # Simple RAM watcher for manually optimizing RAM usage 5 | # 6 | ########################################################################### 7 | 8 | OUT_OLD=0 9 | 10 | while [ "1" == "1" ];do 11 | 12 | OUT=$(free -m |grep "buffers/cache" |tr " " "." |cut -d"." -f9) 13 | if [ -z "$OUT" ];then 14 | echo nothing >> /dev/null 15 | else 16 | if [ $OUT -gt $OUT_OLD ];then 17 | clear 18 | echo mem increased from $OUT_OLD MB to $OUT MB 19 | OUT_OLD=$OUT 20 | fi 21 | fi 22 | sleep 2s 23 | 24 | done 25 | -------------------------------------------------------------------------------- /mkbootimg_tools/ARM/README.md: -------------------------------------------------------------------------------- 1 | 1. Built to be used on Arm devices. 2 | 3 | 2. All binaries are statically compiled using the arm-linux-androideabi and arm-linux-gnueabi toolchains. 4 | 5 | 3. Run the mkboot script and have fun (mkboot script is a shebang manipulator) 6 | 7 | NOTE: This project (ARM) is designed to work on Android (ARM) devices, however, it will also work on Linux as well. Tested and confirmed working on Ubuntu 15.04. 8 | 9 | ### Unpack Boot.img or Recovery.img: 10 | root@android:/data/local/tmp/mkbootimg_tool/ARM # ./mkboot boot.img bootfolder 11 | 12 | Unpack & decompress boot.img to bootfolder 13 | 14 | ****** WARNING ******* WARNING ******* WARNING ****** 15 | 16 | This image is built using NON-standard mkbootimg! 17 | 18 | BASE is 0x80400000 19 | RAMDISK_OFFSET is 0x01408000 20 | 21 | You can modify mkbootimg.c with the above value(s) 22 | 23 | ****** WARNING ******* WARNING ******* WARNING ****** 24 | 25 | kernel : zImage 26 | ramdisk : ramdisk 27 | page size : 2048 28 | kernel size : 5690888 29 | ramdisk size : 520206 30 | base : 0x80400000 (Non Standard) 31 | kernel offset : 0x00008000 32 | ramdisk offset : 0x01408000 (Non Standard) 33 | second offset : 0x00f00000 34 | tags offset : 0x00000100 35 | cmd line : console=ttyHSL0,115200,n8 user_debug=31 36 | 37 | Ramdisk is gzip format. 38 | 1851 blocks 39 | Unpack completed. 40 | 41 | root@android:/data/local/tmp/mkbootimg_tools-master/ARM # 42 | 43 | ### Repack Boot.img or Recovery.img: 44 | root@android:/data/local/tmp/mkbootimg_tools-master/ARM # ./mkboot bootfolder boot.img 45 | 46 | mkbootimg from bootfolder/img_info. 47 | 48 | kernel : zImage 49 | ramdisk : new_ramdisk.gzip 50 | page size : 2048 51 | kernel size : 5690888 52 | ramdisk size : 521739 53 | base : 0x80400000 54 | kernel offset : 0x00008000 55 | ramdisk offset : 0x01408000 56 | second offset : 0x00f00000 57 | tags offset : 0x00000100 58 | cmd line : console=ttyHSL0,115200,n8 user_debug=31 59 | 60 | Kernel size: 5690888, new ramdisk size: 521739, boot.img: 6215680. 61 | 62 | boot.img has been created. 63 | 64 | root@android:/data/local/tmp/mkbootimg_tools-master/ARM # 65 | 66 | ### Repack Boot.img or Recovery.img with larger build than original: 67 | root@android:/data/local/tmp/mkbootimg_tools-master/ARM # ./mkboot bootfolder boot.img 68 | 69 | mkbootimg from bootfolder/img_info. 70 | 71 | kernel : zImage 72 | ramdisk : new_ramdisk.gzip 73 | page size : 2048 74 | kernel size : 5690888 75 | ramdisk size : 11233890 76 | base : 0x80400000 77 | kernel offset : 0x00008000 78 | ramdisk offset : 0x01408000 79 | second offset : 0x00f00000 80 | tags offset : 0x00000100 81 | cmd line : console=ttyHSL0,115200,n8 user_debug=31 82 | 83 | Kernel size: 5690888, new ramdisk size: 11233890, boot.img: 16928768. 84 | 85 | boot.img has been created. 86 | 87 | 88 | ****** CAUTION ******* CAUTION ******* CAUTION ****** 89 | 90 | boot.img is 151552 bytes larger than 91 | the original build! Make sure this new 92 | size is not larger than the actual partition! 93 | 94 | ****** CAUTION ******* CAUTION ******* CAUTION ****** 95 | 96 | root@android:/data/local/tmp/mkbootimg_tools-master/ARM # 97 | -------------------------------------------------------------------------------- /mkbootimg_tools/ARM/bash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfX-android/android_buildtools/7d55c8b24860bb5892ca0fa1895cfa20eaf0f990/mkbootimg_tools/ARM/bash -------------------------------------------------------------------------------- /mkbootimg_tools/ARM/cpio: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfX-android/android_buildtools/7d55c8b24860bb5892ca0fa1895cfa20eaf0f990/mkbootimg_tools/ARM/cpio -------------------------------------------------------------------------------- /mkbootimg_tools/ARM/file: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfX-android/android_buildtools/7d55c8b24860bb5892ca0fa1895cfa20eaf0f990/mkbootimg_tools/ARM/file -------------------------------------------------------------------------------- /mkbootimg_tools/ARM/grep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfX-android/android_buildtools/7d55c8b24860bb5892ca0fa1895cfa20eaf0f990/mkbootimg_tools/ARM/grep -------------------------------------------------------------------------------- /mkbootimg_tools/ARM/gzip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfX-android/android_buildtools/7d55c8b24860bb5892ca0fa1895cfa20eaf0f990/mkbootimg_tools/ARM/gzip -------------------------------------------------------------------------------- /mkbootimg_tools/ARM/lz4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfX-android/android_buildtools/7d55c8b24860bb5892ca0fa1895cfa20eaf0f990/mkbootimg_tools/ARM/lz4 -------------------------------------------------------------------------------- /mkbootimg_tools/ARM/lzma: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfX-android/android_buildtools/7d55c8b24860bb5892ca0fa1895cfa20eaf0f990/mkbootimg_tools/ARM/lzma -------------------------------------------------------------------------------- /mkbootimg_tools/ARM/lzop: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfX-android/android_buildtools/7d55c8b24860bb5892ca0fa1895cfa20eaf0f990/mkbootimg_tools/ARM/lzop -------------------------------------------------------------------------------- /mkbootimg_tools/ARM/magic.mgc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfX-android/android_buildtools/7d55c8b24860bb5892ca0fa1895cfa20eaf0f990/mkbootimg_tools/ARM/magic.mgc -------------------------------------------------------------------------------- /mkbootimg_tools/ARM/mkboot: -------------------------------------------------------------------------------- 1 | # This is a wrapper script which basically manipulates the boundaries of an already limited shebang. 2 | # This allows the execution of the real mkboot (aka wrapper) script using bash from the project directory whether it be on Linux or an ARM device. 3 | 4 | target=$(pwd) 5 | script="${target}/wrapper" 6 | shebang=$(head -1 "$script") 7 | buildit="$@" 8 | 9 | # Use an array in case a argument is there too 10 | interp=( ${shebang#\#!} ) 11 | 12 | # Now run it, passing in the remaining command line arguments 13 | # EXAMPLE 1: Unpacking: ./mkboot recovery.img recoveryfolder 14 | # EXAMPLE 2: Packing: ./mkboot recoveryfolder recovery.img 15 | shift 1 16 | exec "${target}/${interp[@]}" "$script" ${buildit} 17 | -------------------------------------------------------------------------------- /mkbootimg_tools/ARM/mkbootfs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfX-android/android_buildtools/7d55c8b24860bb5892ca0fa1895cfa20eaf0f990/mkbootimg_tools/ARM/mkbootfs -------------------------------------------------------------------------------- /mkbootimg_tools/ARM/mkbootimg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfX-android/android_buildtools/7d55c8b24860bb5892ca0fa1895cfa20eaf0f990/mkbootimg_tools/ARM/mkbootimg -------------------------------------------------------------------------------- /mkbootimg_tools/ARM/od: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfX-android/android_buildtools/7d55c8b24860bb5892ca0fa1895cfa20eaf0f990/mkbootimg_tools/ARM/od -------------------------------------------------------------------------------- /mkbootimg_tools/ARM/wrapper: -------------------------------------------------------------------------------- 1 | #!bash 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | #boot.img tool 16 | #original author: xiaolu 17 | #heavily modified by: Modding.MyMind 18 | 19 | #set -x # for debugging 20 | 21 | trap "clean" 2 3 4 22 | workdir=$(pwd) 23 | toolpath=$(readlink -f $0) 24 | tooldir=$(dirname $toolpath) 25 | mkbootimg=$tooldir/mkbootimg 26 | mkbootfs=$tooldir/mkbootfs 27 | busybox=$(command -v busybox) 28 | od=$tooldir/od 29 | gzip=$tooldir/gzip 30 | lz4=$tooldir/lz4 31 | lzop=$tooldir/lzop 32 | lzma=$tooldir/lzma 33 | xz=$tooldir/xz # Also used for lzma compression 34 | grep=$tooldir/grep 35 | cpio=$tooldir/cpio 36 | magic=$tooldir/magic.mgc 37 | file=$tooldir/file 38 | old_bootimg=true 39 | C_OUT="\033[0;1m" 40 | C_ERR="\033[31;1m" 41 | C_CAUT="\033[33;1m" 42 | C_CLEAR="\033[0;0m" 43 | 44 | pout() { 45 | $busybox printf "${C_OUT}${*}${C_CLEAR}\n" 46 | } 47 | perr() { 48 | $busybox printf "${C_ERR}${*}${C_CLEAR}\n" 49 | } 50 | pcaut() { 51 | $busybox printf "${C_CAUT}${*}${C_CLEAR}\n" 52 | } 53 | clean() 54 | { 55 | $busybox rm -rf /tmp/mkboot.* 56 | #pout "..." 57 | exit 58 | } 59 | 60 | # Check for busybox 61 | if [ -z $busybox ]; then 62 | clear; pcaut "Busybox is NOT installed!\nThis may cause issues with the script!\nUse at your own peril or install busybox!"; sleep 2 63 | fi 64 | 65 | usage() { 66 | pcaut "\n" 67 | perr "Not enough parameters or parameter error!\n" 68 | pout "Unpack Image & Decompress Ramdisk : \n $($busybox basename $0) [image] [output dir]" 69 | pout " $($busybox basename $0) boot.img project_folder\n" 70 | pout "Repack Image & Compress Ramdisk : \n $($busybox basename $0) [unpacked dir] [new image]" 71 | pout " $($busybox basename $0) project_folder newboot.img\n" 72 | clean 73 | } 74 | 75 | print_info() { 76 | [[ $boot_magic_addr -gt 0 ]] && pout " boot magic : ANDROID!" 77 | [[ $boot_magic_addr -gt 0 ]] && pout " magic address : $boot_magic ($boot_magic_addr)" 78 | [ ! -z "$board" ] && pout " board : $board" 79 | pout " kernel : $kernel" 80 | pout " ramdisk : $ramdisk" 81 | pout " page size : $page_size" 82 | pout " kernel size : $kernel_size" 83 | pout " ramdisk size : $ramdisk_size" 84 | [ ! -z $second_size ] && [ $second_size -gt 0 ] && \ 85 | pout " second size : $second_size" 86 | [ $dtb_size -gt 0 ] && pout " dtb size : $dtb_size" 87 | if [ ! -z $base_warning ]; then 88 | pcaut " base : $base_addr (Non Standard)" 89 | else 90 | pout " base : $base_addr" 91 | fi 92 | if [ ! -z $kernel_offset_warning ]; then 93 | pcaut " kernel offset : $kernel_offset (Non Standard)" 94 | else 95 | pout " kernel offset : $kernel_offset" 96 | fi 97 | if [ ! -z $ramdisk_offset_warning ]; then 98 | pcaut " ramdisk offset : $ramdisk_offset (Non Standard)" 99 | else 100 | pout " ramdisk offset : $ramdisk_offset" 101 | fi 102 | if [ ! -z $second_offset_warning ]; then 103 | [ -z $second_offset ] || pcaut " second offset : $second_offset (Non Standard)" 104 | else 105 | [ -z $second_offset ] || pout " second offset : $second_offset" 106 | fi 107 | if [ ! -z $tags_offset_warning ]; then 108 | pcaut " tags offset : $tags_offset (Non Standard)" 109 | else 110 | pout " tags offset : $tags_offset" 111 | fi 112 | [ $dtb_size -gt 0 ] && pout " dtb offset : $qcdt_offset" 113 | [ $dtb_size -gt 0 ] && pout " dtb img : $dt" 114 | [ $second_size -gt 0 ] && pout " second img : $second" 115 | pout " cmd line : $cmd_line" 116 | } 117 | 118 | mkboot_img() { 119 | error=0 120 | [ $second_size -gt 0 ] && second="--second ${second}" 121 | [ $dtb_size -gt 0 ] && dtb="--dt ${dt}" 122 | [ ! -z $second_offset ] && second_offset="--second_offset ${second_offset}" 123 | [ ! -z "$board" ] && board="--board $board" 124 | 125 | $mkbootimg --kernel $kernel --ramdisk $ramdisk $board \ 126 | --base $base_addr --ramdisk_offset $ramdisk_offset \ 127 | --kernel_offset $kernel_offset $second_offset \ 128 | --tags_offset $tags_offset --cmdline "$cmd_line" \ 129 | --pagesize $page_size $second $dtb -o $new_img 2>/dev/null || error=1 130 | 131 | [ $error -eq 1 ] && return $error 132 | ramdisk_size=$($busybox stat -c "%s" $ramdisk) 133 | boot_size=$($busybox stat -c "%s" $new_img) 134 | pout "\nKernel size: $kernel_size, new ramdisk size: $ramdisk_size, $($busybox basename $new_img): $boot_size." 135 | pout "\n$($busybox basename $new_img) has been created.\n" 136 | 137 | # Check if new build is larger than original 138 | # Give caution if it is to insure size is not larger than the partition 139 | # A courtesy warning 140 | if [[ "$image_size" -lt "$boot_size" ]]; then 141 | beefed_up=$(( $boot_size - $image_size )) 142 | pcaut "\n****** CAUTION ******* CAUTION ******* CAUTION ******" 143 | pout "\n$($busybox basename $new_img) is $beefed_up bytes larger than" 144 | pout "the original build! Make sure this new" 145 | pout "size is not larger than the actual partition!" 146 | pcaut "\n****** CAUTION ******* CAUTION ******* CAUTION ******\n" 147 | fi 148 | } 149 | 150 | #decide action 151 | [ $# -lt 2 ] || [ $# -gt 3 ] && usage 152 | if [ $# -eq 2 ] && [ -d $1 ]; then 153 | mkboot_from_dir=1 154 | elif [ $# -eq 2 ] && [ -s $1 ]; then 155 | split_boot_to_dir=1 156 | else 157 | usage 158 | fi 159 | 160 | #mkboot_from_dir, img_info 161 | if [ ! -z $mkboot_from_dir ]; then 162 | pout "\nmkbootimg from $1/img_info.\n" 163 | unpacked_dir=$1 164 | new_img=$2 165 | cd $unpacked_dir 166 | if [ ! -s img_info ]; then 167 | perr "Missing img_info file! Can't rebuild $2." 168 | clean 169 | fi 170 | eval $(cat img_info) 171 | 172 | if [ -z $kernel ] || [ -z $ramdisk ] || [ -z $base_addr ]; then 173 | perr "Lacking parameters in img_info." 174 | clean 175 | fi 176 | [ -z $second_size ] && second_size=0 177 | [ -z $dtb_size ] && dtb_size=0 178 | 179 | if [ -d $ramdisk ]; then 180 | compression_type=$($file -m $magic ./ramdisk.* | $busybox cut -d: -f2 | $busybox cut -d" " -f2) 181 | case $compression_type in 182 | gzip) compression_warning=$compression_type; compression_ext=gzip; compression_repack=$gzip;; 183 | XZ) compression_warning=$compression_type; compression_ext=xz; compression_repack="$xz -1 --check=crc32";; 184 | LZMA) compression_warning=$compression_type; compression_ext=lzma; compression_repack="$xz --format=lzma";; 185 | LZ4) compression_warning=$compression_type; compression_ext=lz4; compression_repack="$lz4 -l -9";; 186 | lzop) compression_warning=$compression_type; compression_ext=lzop; compression_repack="$lzop -f -9";; 187 | esac; 188 | if [ -z $compression_warning ]; then 189 | perr "\n****** HAZARD ******* HAZARD ******* HAZARD ******" 190 | pout "\nRamdisk is $compression_type format. Can't repack ramdisk." 191 | pout "This tool currently does not support $compression_type." 192 | perr "\n****** HAZARD ******* HAZARD ******* HAZARD ******\n" 193 | exit 194 | fi 195 | if [ $compression_type != "gzip" ] && [ $compression_type != "LZMA" ] && [ $compression_type != "LZ4" ] && [ $compression_type != "lzop" ] && [ $compression_type != "XZ" ]; then 196 | perr "\nRamdisk is unknown format. Can't repack ramdisk." 197 | exit 0 198 | else 199 | # XZ GZIP LZMA LZ4 LZOP 200 | $mkbootfs $ramdisk | $compression_repack > new_ramdisk.$compression_ext 201 | ramdisk=new_ramdisk.$compression_ext 202 | ramdisk_size=$($busybox stat -c "%s" $ramdisk) 203 | fi 204 | fi 205 | #cd $unpacked_dir 206 | print_info 207 | $busybox rm -f $new_img 208 | mkboot_img $new_img || perr "Make $new_img Error! pls check img_info file." 209 | #pout "Add SEANDROIDENFORCE tag." 210 | #printf SEANDROIDENFORCE >> $new_img 211 | $busybox rm -f new_ramdisk.gz 212 | clean 213 | fi 214 | 215 | #split boot.img to dir. 216 | if [ -e $2 ]; then 217 | read -p "$2 exists, delete?(N/y)" reply 218 | case $reply in 219 | y | Y) 220 | $busybox rm -rf $2 221 | ;; 222 | *) 223 | exit 224 | ;; 225 | esac 226 | fi 227 | tempdir=$2 228 | $busybox mkdir -p "$tempdir" 229 | pout "\nUnpack & decompress $1 to $2\n" 230 | 231 | #get boot.img info 232 | cp -f $1 $tempdir/ 233 | cd $tempdir 234 | bootimg=$($busybox basename $1) 235 | # Find BOOT_MAGIC address in dec and hex 236 | boot_magic_addr=$($grep -abo ANDROID! $bootimg | $busybox cut -f 1 -d : | head -1) 237 | boot_magic=`printf 0x%08x $boot_magic_addr` 238 | # Find standard QCDT address in hex 239 | qcdt_addr=$($grep -abo QCDT $bootimg | $busybox cut -f 1 -d : | head -1) 240 | if [ ! -z $qcdt_addr ]; then 241 | qcdt_addr=`printf 0x%x $qcdt_addr` 242 | fi 243 | [ -z $boot_magic_addr ] && clean 244 | if [ $boot_magic_addr -gt 0 ]; then 245 | $busybox dd if=$bootimg of=bootimg bs=$boot_magic_addr skip=1 2>/dev/null 246 | bootimg=bootimg 247 | fi 248 | 249 | kernel_addr=0x$($od -A n -X -j 12 -N 4 $bootimg | $busybox sed 's/ //g' | $busybox sed 's/^0*//g') 250 | ramdisk_addr=0x$($od -A n -X -j 20 -N 4 $bootimg | $busybox sed 's/ //g' | $busybox sed 's/^0*//g') 251 | second_addr=0x$($od -A n -X -j 28 -N 4 $bootimg | $busybox sed 's/ //g' | $busybox sed 's/^0*//g') 252 | tags_addr=0x$($od -A n -X -j 32 -N 4 $bootimg | $busybox sed 's/ //g' | $busybox sed 's/^0*//g') 253 | 254 | kernel_size=$($od -A n -D -j 8 -N 4 $bootimg | $busybox sed 's/ //g') 255 | #base_addr=0x$($od -A n -x -j 14 -N 2 $bootimg | $busybox sed 's/ //g')0000 256 | ramdisk_size=$($od -A n -D -j 16 -N 4 $bootimg | $busybox sed 's/ //g') 257 | second_size=$($od -A n -D -j 24 -N 4 $bootimg | $busybox sed 's/ //g') 258 | page_size=$($od -A n -D -j 36 -N 4 $bootimg | $busybox sed 's/ //g') 259 | dtb_size=$($od -A n -D -j 40 -N 4 $bootimg | $busybox sed 's/ //g') 260 | #cmd_line=$($od -A n --strings -j 64 -N 512 $bootimg) 261 | #board=$($od -A n --strings -j 48 -N 16 $bootimg) 262 | cmd_line=$($od -A n -S1 -j 64 -N 512 $bootimg) 263 | board=$($od -A n -S1 -j 48 -N 16 $bootimg) 264 | 265 | base_addr=$((kernel_addr-0x00008000)) 266 | kernel_offset=$((kernel_addr-base_addr)) 267 | ramdisk_offset=$((ramdisk_addr-base_addr)) 268 | second_offset=$((second_addr-base_addr)) 269 | tags_offset=$((tags_addr-base_addr)) 270 | qcdt_offset=$((qcdt_addr-base_addr)) 271 | 272 | base_addr=$(printf "%08x" $base_addr) 273 | kernel_offset=$(printf "%08x" $kernel_offset) 274 | ramdisk_offset=$(printf "%08x" $ramdisk_offset) 275 | second_offset=$(printf "%08x" $second_offset) 276 | tags_offset=$(printf "%08x" $tags_offset) 277 | qcdt_offset=$(printf "%08x" $qcdt_offset) 278 | 279 | base_addr=0x${base_addr:0-8} 280 | kernel_offset=0x${kernel_offset:0-8} 281 | ramdisk_offset=0x${ramdisk_offset:0-8} 282 | second_offset=0x${second_offset:0-8} 283 | tags_offset=0x${tags_offset:0-8} 284 | qcdt_offset=0x${qcdt_offset:0-8} 285 | 286 | ######################################################### 287 | # BELOW SECTION HANDLES NON STANDARD IMAGES 288 | 289 | if [ $base_addr != 0x10000000 ]; then 290 | base_warning=$base_addr 291 | fi 292 | 293 | if [ $kernel_offset != 0x00008000 ]; then 294 | kernel_offset_warning=$kernel_offset 295 | fi 296 | 297 | if [ $ramdisk_offset != 0x01000000 ]; then 298 | ramdisk_offset_warning=$ramdisk_offset 299 | fi 300 | 301 | if [ $second_offset != 0x00f00000 ]; then 302 | second_offset_warning=$second_offset 303 | fi 304 | 305 | if [ $tags_offset != 0x00000100 ]; then 306 | tags_offset_warning=$tags_offset 307 | fi 308 | 309 | # Below are the known offsets for non standard mkbootimg.c 310 | if [[ ! -z $base_warning ]] || [[ ! -z $kernel_offset_warning ]] || [[ ! -z $ramdisk_offset_warning ]] || [[ ! -z $second_offset_warning ]] || [[ ! -z $tags_offset_warning ]]; then 311 | perr "****** WARNING ******* WARNING ******* WARNING ******\n" 312 | pout "This image is built using NON-standard mkbootimg!\n" 313 | fi 314 | if [ ! -z $base_warning ]; then 315 | pout "BASE is $base_warning" 316 | fi 317 | if [ ! -z $kernel_offset_warning ]; then 318 | pout "KERNEL_OFFSET is $kernel_offset_warning" 319 | fi 320 | if [ ! -z $ramdisk_offset_warning ]; then 321 | pout "RAMDISK_OFFSET is $ramdisk_offset_warning" 322 | fi 323 | if [ ! -z $second_offset_warning ]; then 324 | pout "SECOND_OFFSET is $second_offset_warning" 325 | fi 326 | if [ ! -z $tags_offset_warning ]; then 327 | pout "TAGS_OFFSET is $tags_offset_warning" 328 | fi 329 | if [[ ! -z $base_warning ]] || [[ ! -z $kernel_offset_warning ]] || [[ ! -z $ramdisk_offset_warning ]] || [[ ! -z $second_offset_warning ]] || [[ ! -z $tags_offset_warning ]]; then 330 | pout "\nYou can modify mkbootimg.c with the above value(s)" 331 | perr "\n****** WARNING ******* WARNING ******* WARNING ******\n" 332 | fi 333 | 334 | # ABOVE SECTION HANDLES NON STANDARD IMAGES 335 | ######################################################### 336 | 337 | k_count=$(((kernel_size+page_size-1)/page_size)) 338 | r_count=$(((ramdisk_size+page_size-1)/page_size)) 339 | s_count=$(((second_size+page_size-1)/page_size)) 340 | d_count=$(((dtb_size+page_size-1)/page_size)) 341 | k_offset=1 342 | r_offset=$((k_offset+k_count)) 343 | s_offset=$((r_offset+r_count)) 344 | d_offset=$((s_offset+s_count)) 345 | 346 | #zImage 347 | $busybox dd if=$bootimg of=zImage_tmp bs=$page_size skip=$k_offset count=$k_count 2>/dev/null 348 | $busybox dd if=zImage_tmp of=zImage bs=$kernel_size count=1 2>/dev/null 349 | 350 | #ramdisk.gz 351 | $busybox dd if=$bootimg of=ramdisk_tmp bs=$page_size skip=$r_offset count=$r_count 2>/dev/null 352 | $busybox dd if=ramdisk_tmp of=ramdisk.gz bs=$ramdisk_size count=1 2>/dev/null 353 | 354 | #second image 355 | if [ $second_size -gt 0 ]; then 356 | $busybox dd if=$bootimg of=second.img_tmp bs=$page_size skip=$s_offset count=$s_count 2>/dev/null 357 | $busybox dd if=second.img_tmp of=second.img bs=$second_size count=1 2>/dev/null 358 | second="$tempdir/second.img" 359 | second=$($busybox basename $second) 360 | secondb_name="second=$second" 361 | secondb_size="second_size=$second_size" 362 | fi 363 | 364 | #dtb 365 | if [ $dtb_size -gt 0 ]; then 366 | $busybox dd if=$bootimg of=dt.img_tmp bs=$page_size skip=$d_offset count=$d_count 2>/dev/null 367 | $busybox dd if=dt.img_tmp of=dt.img bs=$dtb_size count=1 2>/dev/null 368 | dt="$tempdir/dt.img" 369 | dt=$($busybox basename $dt) 370 | dt_name="dt=$dt" 371 | dt_size="dtb_size=$dtb_size" 372 | fi 373 | $busybox rm -f *_tmp $($busybox basename $1) $bootimg 374 | 375 | kernel=zImage 376 | ramdisk=ramdisk 377 | [ ! -s $kernel ] && clean 378 | #print boot.img info 379 | print_info 380 | 381 | # Properly escape double quotes 382 | # Keep double quotes intact 383 | cmd_line=$(echo $cmd_line | sed -e "s/'/'\\\\''/g; 1s/^/'/; \$s/\$/'/") 384 | 385 | #write info to img_info,decompression ramdisk.gz 386 | 387 | [ ! -z "$board" ] && liveboard="board=\"$board\"" 388 | 389 | $busybox printf "kernel=zImage\nramdisk=ramdisk\n${secondb_name}\n${dt_name}\npage_size=$page_size\n\ 390 | kernel_size=$kernel_size\nramdisk_size=$ramdisk_size\n${secondb_size}\n${dt_size}\nbase_addr=$base_addr\nkernel_offset=$kernel_offset\n\ 391 | ramdisk_offset=$ramdisk_offset\nsecond_offset=$second_offset\ntags_offset=$tags_offset\nqcdt_offset=$qcdt_offset\ncmd_line=$cmd_line\n$liveboard\n" > img_info 392 | 393 | # Include original image size in bytes to img_info 394 | # Allow script to read second command argument despite the path 395 | # This should help the script be allow to read images from another directory such as /sdcard/recovery.img, ~/sdcard/recovery.img or simply recovery.img if in the project directory itself 396 | if [ -f $1 ]; then 397 | # Path to file exists outside of project directory 398 | image_size=$($busybox stat -c "%s" $1) 399 | else 400 | # Path to file exists in the project directory 401 | image_size=$($busybox stat -c "%s" '../'$1) 402 | fi 403 | $busybox printf "image_size=$image_size" >> img_info 404 | 405 | $busybox mkdir ramdisk 406 | cd ramdisk 407 | 408 | compression_type=$($file -m $magic ../ramdisk.gz | $busybox cut -d: -f2 | $busybox cut -d" " -f2) 409 | compression_warning=$compression_type 410 | 411 | case $compression_type in 412 | gzip) compression_type=$gzip; compression_ext=gz;; 413 | XZ) compression_type=$xz; compression_ext=xz;; 414 | LZMA) compression_type=$lzma; compression_ext=lzma;; 415 | LZ4) compression_type=$lz4; compression_ext=lz4;; 416 | lzop) compression_type=$lzop; compression_ext=lzop;; 417 | esac; 418 | 419 | decomp_ramdisk="$compression_type -d -c" 420 | decomp_ramdisk2="$cpio -i -d -m --no-absolute-filenames" 421 | 422 | if [ -z $compression_ext ]; then 423 | perr "\n****** HAZARD ******* HAZARD ******* HAZARD ******" 424 | pout "\nRamdisk is $compression_warning format. Can't unpack ramdisk." 425 | pout "This tool currently does not support $compression_warning." 426 | perr "\n****** HAZARD ******* HAZARD ******* HAZARD ******\n" 427 | exit 428 | fi 429 | $busybox mv ../ramdisk.gz ../ramdisk.$compression_ext # This is simply to remind the user if they view the folder afterwards 430 | pout "\nRamdisk is $compression_warning format." 431 | $decomp_ramdisk "../ramdisk.$compression_ext" | $decomp_ramdisk2 $extra 432 | 433 | #Unpack Finish to exit. 434 | pout "Unpack completed.\n" 435 | exit 436 | -------------------------------------------------------------------------------- /mkbootimg_tools/ARM/xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfX-android/android_buildtools/7d55c8b24860bb5892ca0fa1895cfa20eaf0f990/mkbootimg_tools/ARM/xz -------------------------------------------------------------------------------- /mkbootimg_tools/README.md: -------------------------------------------------------------------------------- 1 | mkbootimg_tools 2 | =============== 3 | 4 | HOW TO USE: 5 | ----------- 6 | 7 | ### Unpack boot/recovery(.img) support dtb(dt.img): 8 | ./mkboot name.img namefolderout 9 | 10 | EXAMPLE 11 | ./mkboot recoveryksuamg5.img ksuamg 12 | Unpack & decompress recoveryksuamg5.img to ksuamg 13 | kernel : /home/xiaolu/work/initramfs/s4/e330s/ksuamg5/zImage 14 | ramdisk : /home/xiaolu/work/initramfs/s4/e330s/ksuamg5/ramdisk.gz 15 | page_size : 2048 16 | base_addr : 0x00000000 17 | kernel size : 6911360 18 | kernel_addr : 0x00008000 19 | ramdisk_size : 2685222 20 | ramdisk_addr : 0x02000000 21 | second_size : 0 22 | second_addr : 0x00f00000 23 | dtb_size : 1427456 24 | tags_addr : 0x01e00000 25 | cmdline : console=null androidboot.hardware=qcom user_debug=31 maxcpus=2 msm_rtb.filter=0x3F 26 | Unpack completed. 27 | 28 | ### Repack boot/recovery(.img) support dtb(dt.img): 29 | ./mkboot namefolderout newimgname.img 30 | 31 | EXAMPLE 32 | ./mkboot ksuamg5 recovery.img 33 | mkbootimg from ksuamg5/img_info. 34 | kernel : /home/xiaolu/work/initramfs/s4/e330s/ksuamg5/zImage 35 | ramdisk : /home/xiaolu/work/initramfs/s4/e330s/ksuamg5/new_ramdisk.gz 36 | page_size : 37 | base_addr : 0x00000000 38 | kernel size : 6911360 39 | kernel_addr : 0x00008000 40 | ramdisk_size : 2685222 41 | ramdisk_addr : 0x02000000 42 | second_size : 43 | second_addr : 44 | dtb_size : 1427456 45 | dtb_img : dt.img 46 | tags_addr : 0x01e00000 47 | cmdline : console=null androidboot.hardware=qcom user_debug=31 maxcpus=2 msm_rtb.filter=0x3F 48 | Kernel size: 6911360, new ramdisk size: 3416778, recovery.img: 11759616. 49 | recovery.img has been created. 50 | ... 51 | 52 | ### Create a dt.img: 53 | yourkernelsources/scripts/dtbTool -s 2048 -o arch/arm/boot/dt.img -p scripts/dtc/ arch/arm/boot/ 54 | 55 | EXAMPLE 56 | SHV-E330S_JB_Opensource/Kernel$ scripts/dtbTool -s 2048 -o arch/arm/boot/dt.img -p scripts/dtc/ arch/arm/boot/ 57 | DTB combiner: 58 | Input directory: '/media/diskd/kernel/SHV-E330S_JB_Opensource/Kernel/arch/arm/boot/' 59 | Output file: '/media/diskd/kernel/SHV-E330S_JB_Opensource/Kernel/arch/arm/boot/dt.img' 60 | Found file: msm8974-sec-ks01-r03.dtb ... chipset: 2114015745, platform: 3, rev: 0 61 | Found file: msm8974-sec-ks01-r07.dtb ... chipset: 2114015745, platform: 7, rev: 0 62 | Found file: msm8974-sec-ks01-r06.dtb ... chipset: 2114015745, platform: 6, rev: 0 63 | Found file: msm8974-sec-ks01-r04.dtb ... chipset: 2114015745, platform: 4, rev: 0 64 | Found file: msm8974-sec-ks01-r11.dtb ... chipset: 2114015745, platform: 11, rev: 0 65 | Found file: msm8974-sec-ks01-r02.dtb ... chipset: 2114015745, platform: 2, rev: 0 66 | Found file: msm8974-sec-ks01-r00.dtb ... chipset: 2114015745, platform: 0, rev: 0 67 | Found file: msm8974-sec-ks01-r05.dtb ... chipset: 2114015745, platform: 5, rev: 0 68 | Found file: msm8974-sec-ks01-r01.dtb ... chipset: 2114015745, platform: 1, rev: 0 69 | => Found 9 unique DTB(s) 70 | 71 | Generating master DTB... completed 72 | 73 | 74 | ### dtbToolCM support dt-tag & dtb v2/3(https://github.com/CyanogenMod/android_device_qcom_common/tree/cm-13.0/dtbtool): 75 | 76 | dtbToolCM -s 2048 -d "htc,project-id = <" -o arch/arm/boot/dt.img -p scripts/dtc/ arch/arm/boot/ 77 | 78 | -------------------------------------------------------------------------------- /mkbootimg_tools/dtbTool: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfX-android/android_buildtools/7d55c8b24860bb5892ca0fa1895cfa20eaf0f990/mkbootimg_tools/dtbTool -------------------------------------------------------------------------------- /mkbootimg_tools/dtbToolCM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfX-android/android_buildtools/7d55c8b24860bb5892ca0fa1895cfa20eaf0f990/mkbootimg_tools/dtbToolCM -------------------------------------------------------------------------------- /mkbootimg_tools/dtbtool.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012-2014, The Linux Foundation. All rights reserved. 2 | 3 | Redistribution and use in source form and compiled forms (SGML, HTML, 4 | PDF, PostScript, RTF and so forth) with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | Redistributions in source form must retain the above copyright 8 | notice, this list of conditions and the following disclaimer as the 9 | first lines of this file unmodified. 10 | 11 | Redistributions in compiled form (transformed to other DTDs, 12 | converted to PDF, PostScript, RTF and other formats) must reproduce 13 | the above copyright notice, this list of conditions and the following 14 | disclaimer in the documentation and/or other materials provided with 15 | the distribution. 16 | 17 | THIS DOCUMENTATION IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 18 | WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AND 20 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE FREEBSD 21 | DOCUMENTATION PROJECT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 28 | DAMAGE. 29 | 30 | 31 | Android - Table of Device Tree 32 | ============================== 33 | 34 | 0) Document revision 35 | v1.0 - Initial version (dng) 36 | v1.1 - Add v2 format to allow subtype (dng) 37 | 38 | 1) Android boot image: 39 | ---------------------- 40 | 1.1) Header: 41 | 1) Magic (8B) 42 | 2) kernel size (4B) 43 | 3) kernel addr (4B) 44 | 4) ramdisk size (4B) 45 | 5) ramdisk addr (4B) 46 | 6) 2ndary size (4B) 47 | 7) 2ndary addr (4B) 48 | 8) tags addr (4B) 49 | 9) page size (4B) 50 | 10) unused #1 (4B) (zero in standard Android) 51 | 11) unused #2 (4B) (zero in standard Android) 52 | 12) product name (16B) 53 | 13) kernel cmdline (512B) 54 | 14) id (8B) 55 | 56 | 1.2) Layout: 57 | A) header (as above - 1 page) 58 | B) kernel (n pages) 59 | C) ramdisk (m pages) 60 | D) second stage (o pages) 61 | 62 | 2) QC table of device tree 63 | -------------------------- 64 | 2.1) Changes: 65 | i) use "unused #1, #2" members in existing boot image 66 | header to point to new table of device tree 67 | (#1 - size of QC table of DT) 68 | ii) append table of device tree (described later) 69 | after "D) second stage" 70 | 71 | 2.2) Format: 72 | size 73 | x +------------------+ 74 | | | MAGIC ("QCDT") | 4B 75 | | +------------------+ 76 | header | VERSION | uint32 (version 3) 77 | | +------------------+ 78 | | | num of DTBs | uint32 (number of DTB entries) 79 | x +------------------+ 80 | | | platform id #1 | uint32 (e.g. ID for MSM8974) 81 | | +------------------+ 82 | | | variant id #1 | uint32 (e.g. ID for CDP, MTP) 83 | | +------------------+ 84 | | | subtype id #1 | uint32 (e.g. ID for subtype) (QCDT v2) 85 | device +------------------+ 86 | #1 | soc rev #1 | uint32 (e.g. MSM8974 v2) 87 | entry +------------------+ 88 | | | pmic0 #1 | uint32 (pmic0-> first smallest SID of existing pmic) 89 | | +------------------+ 90 | | | pmic1 #1 | uint32 (pmic1-> secondary smallest SID of existing pmic) 91 | | +------------------+ 92 | | | pmic2 #1 | uint32 (pmic2-> third smallest SID of existing pmic) 93 | | +------------------+ 94 | | | pmic3 #1 | uint32 (pmic3-> fourth smallest SID of existing pmic) 95 | | +------------------+ 96 | | | offset #1 | uint32 (byte offset from start/before MAGIC 97 | | +------------------+ to DTB entry) 98 | | | size #1 | uint32 (size in bytes of DTB blob) 99 | x +------------------+ 100 | . . 101 | . . (repeat) 102 | . . 103 | 104 | x +------------------+ 105 | | | platform id #Z | uint32 (e.g. ID for MSM8974) 106 | | +------------------+ 107 | device | variant id #Z | uint32 (e.g. ID for CDP, MTP) 108 | #Z +------------------+ 109 | entry | subtype id #Z | uint32 (e.g. ID for subtype) (QCDT v2) 110 | (last) +------------------+ 111 | | | soc rev #Z | uint32 (e.g. MSM8974 v2) 112 | | +------------------+ 113 | | | pmic0 #1 | uint32 (pmic0-> first smallest SID of existing pmic) 114 | | +------------------+ 115 | | | pmic1 #1 | uint32 (pmic1-> secondary smallest SID of existing pmic) 116 | | +------------------+ 117 | | | pmic2 #1 | uint32 (pmic2-> third smallest SID of existing pmic) 118 | | +------------------+ 119 | | | pmic3 #1 | uint32 (pmic3-> fourth smallest SID of existing pmic) 120 | | +------------------+ 121 | | | offset #Z | uint32 (byte offset from start/before MAGIC 122 | x +------------------+ to DTB entry) 123 | | 0 ("zero") | uint32 (end of list delimiter) 124 | +------------------+ to DTB entry) 125 | | padding | variable length for next DTB to start on 126 | +------------------+ page boundary 127 | | DTB #1 | variable (start is page aligned) 128 | | | 129 | | | 130 | +------------------+ 131 | | padding | variable length for next DTB to start on 132 | +------------------+ page boundary 133 | . 134 | . 135 | . 136 | 137 | +------------------+ 138 | | DTB #Z (last) | variable (start is page aligned) 139 | | | 140 | | | 141 | +------------------+ 142 | 143 | 3) Operations 144 | ------------- 145 | 3.1) Build-time: 146 | 1) Each DTS per device will add a "qcom,msm-id" entry 147 | e.g. for msm8974-sim.dts, add 148 | qcom,msm-id = ; 149 | or 150 | qcom,msm-id = ; 151 | qcom,board-id = ; 152 | or 153 | qcom,msm-id = ; 154 | qcom,board-id = ; 155 | qcom,pmic-id = ; 156 | x = ID for msm8974 157 | y = ID for CDP, MTP, etc. 158 | y' = ID for subtype (assumed zero if absent) 159 | z = ID for soc revision 160 | a = pmic0 161 | b = pmic1 162 | c = pmic2 163 | d = pmic3 164 | SBL populates the pmic entries always in ascending order of SID, so 165 | pmic0-> SID0, pmic1-> SID1, pmic2-> SID2, pmic3-> SID3. 166 | e.g. for qcom,pmic-id = 167 | Board X = MSM8994 + PM8994 + PMI8994 (Existing boards [ROW]) 168 | Board Y = MSM8994 + PM8994 + PMI8994 + PM8004 (Internal SS board variant) 169 | Board Z = MSM8994 + PM8994 + PM8004 (Boards that SS will be making) 170 | 171 | For all boards X, Y, and Z, PMICs have the following SIDs and REVID SUBTYPEs 172 | (i.e. PMIC Model): 173 | PM8994 - SID 0 and 1; subtype = 9 174 | PMI8994 - SID 2 and 3; subtype = 10 175 | PM8004 - SID 4 and 5; subtype = 12 176 | 177 | LK using SMEM PMIC info(1 as major and 0 as minor version for example): 178 | Board X: qcom,pmic-id = <0x0109 0x010A 0x0 0x0>; 179 | Board Y: qcom,pmic-id = <0x0109 0x010A 0x010C 0x0>; 180 | Board Z: qcom,pmic-id = <0x0109 0x010C 0x0 0x0>; 181 | 182 | The entry can optionally be an array: 183 | qcom,msm-id = , , ...; 184 | or 185 | qcom,msm-id = , , ...; 186 | qcom,board-id = , ...; 187 | or 188 | qcom,msm-id = , , ...; 189 | qcom,board-id = , ...; 190 | qcom,pmic-id = , ...; 191 | Note that qcom,msm-id, qcom,board-id and qcom,pmic-id are not matched pairs. 192 | 2) Kernel compile will generate the DTB 193 | 3) Android build will run a new tool (dtbTool) 194 | a) scan the DTB output directory for all compiled DTB 195 | b) decompile the DTB for "qcom,msm-id"/"qcom,board-id"/"qcom,pmic-id" 196 | c) generate the QC table of device tree in sorted 197 | order (platform, variant, subtype, soc rev, pmic0, pmic1, pmic2, pmic3) 198 | d) modified mkbootimg will merge new table of DT 199 | 200 | 3.2) Run-time: 201 | 1) LK bootloader will obtain platform id/variant/subtype/soc rev/major ver/minor ver 202 | /pmic0/pmic1/pmic2/pmic3 info either from early bootloaders or via other means 203 | 2) LK bootloader will check entries #10 for non-zero 204 | value (set to zero for standard boot.img). If the 205 | value is non-zero, refer to page section after 206 | the "second stage" in the boot.img layout 207 | 3) Check QCDT magic 208 | 4) Check QCDT version (optional LK to handle multiple 209 | QCDT version) 210 | 5) LK scans through the QCDT table to look for matching 211 | entry. Search order is: 212 | 1) msm ID exact match 213 | 2) Platform type exact match 214 | 3) subtype ID exact match 215 | 4) HLOS subtype exact match 216 | 5) Pmic0 model ID exact match 217 | 6) Pmic1 model ID exact match 218 | 7) Pmic2 model ID exact match 219 | 8) Pmic3 model ID exact match 220 | 9) foundry ID, look for exact match, if not found choose 221 | device tree with foundry-id(0x0) 222 | 10) select the highest soc rev in QCDT that is 223 | equal to or lower than the runtime detected soc rev 224 | 11) select the highest major&minor ver in QCDT that is 225 | equal to or lower than the runtime detected major ver 226 | 12) select the highest pmic0 major&minor in QCDT that is 227 | equal to or lower than the runtime detected pmic0 228 | 13) select the highest pmic1 major&minor in QCDT that is 229 | equal to or lower than the runtime detected pmic1 230 | 14) select the highest pmic2 major&minor in QCDT that is 231 | equal to or lower than the runtime detected pmic2 232 | 15) select the highest pmic3 major&minor in QCDT that is 233 | equal to or lower than the runtime detected pmic3 234 | 6) Load the matching DTB blob to the tags addr 235 | 7) LK pass the correct DTB to the kernel 236 | -------------------------------------------------------------------------------- /mkbootimg_tools/dtc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfX-android/android_buildtools/7d55c8b24860bb5892ca0fa1895cfa20eaf0f990/mkbootimg_tools/dtc -------------------------------------------------------------------------------- /mkbootimg_tools/lz4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfX-android/android_buildtools/7d55c8b24860bb5892ca0fa1895cfa20eaf0f990/mkbootimg_tools/lz4 -------------------------------------------------------------------------------- /mkbootimg_tools/mkboot: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | #boot.img tool 16 | #by xiaolu 17 | trap "clean" 2 3 4 18 | workdir=$(pwd) 19 | toolpath=$(readlink -f $0) 20 | tooldir=$(dirname $toolpath) 21 | mkbootimg=$tooldir/mkbootimg 22 | mkbootfs=$tooldir/mkbootfs 23 | C_OUT="\033[0;1m" 24 | C_ERR="\033[31;1m" 25 | C_CLEAR="\033[0;0m" 26 | 27 | pout() { 28 | printf "${C_OUT}${*}${C_CLEAR}\n" 29 | } 30 | perr() { 31 | printf "${C_ERR}${*}${C_CLEAR}\n" 32 | } 33 | clean() 34 | { 35 | rm -rf /tmp/mkboot.* 36 | pout "..." 37 | exit 38 | } 39 | 40 | unpack_complete() 41 | { 42 | [ ! -z $format ] && echo format=$format >> ../img_info 43 | pout "Unpack completed." 44 | exit 45 | } 46 | 47 | zip_command() 48 | { 49 | if [ "$1" == lzop ]; then 50 | zcommand="lzop -n -f -9" 51 | elif [ "$1" == lz4 ]; then 52 | zcommand="lz4 -f -9" 53 | elif [ "$1" == lzma ]; then 54 | zcommand="lzma -f -c" 55 | elif [ "$1" == xz ]; then 56 | zcommand="xz -f -c" 57 | else 58 | zcommand="gzip -n -f" 59 | fi 60 | } 61 | 62 | usage() 63 | { 64 | pout "" 65 | pout "----------------------------------------------------------------------" 66 | pout "Not enough parameters or parameter error!" 67 | pout "unpack boot.img & decompress ramdisk:\n $(basename $0) [img] [output dir]" 68 | pout " $(basename $0) boot.img boot20130905" 69 | pout "Use the unpacked directory repack boot.img(img_info):\n $(basename $0) [unpacked dir] [newbootfile]" 70 | pout " $(basename $0) boot20130905 newboot.img" 71 | clean 72 | } 73 | 74 | print_info() 75 | { 76 | [ ! -z "$board" ] && pout " board : $board" 77 | pout " kernel : $kernel" 78 | pout " ramdisk : $ramdisk" 79 | pout " page size : $page_size" 80 | pout " kernel size : $kernel_size" 81 | pout " ramdisk size : $ramdisk_size" 82 | [ ! -z $second_size ] && [ $second_size -gt 0 ] && \ 83 | pout " second_size : $second_size" 84 | [ $dtb_size -gt 0 ] && pout " dtb size : $dtb_size" 85 | pout " base : $base_addr" 86 | pout " kernel offset : $kernel_offset" 87 | pout " ramdisk offset : $ramdisk_offset" 88 | [ ! -z $second_size ] && [ $second_size -gt 0 ] && \ 89 | pout " second_offset : $second_offset" 90 | pout " tags offset : $tags_offset" 91 | [ $dtb_size -gt 0 ] && pout " dtb img : $dt" 92 | pout " cmd line : $cmd_line" 93 | } 94 | 95 | mkboot_img() 96 | { 97 | error=0 98 | [ $second_size -gt 0 ] && second="--second ${second}" 99 | [ $dtb_size -gt 0 ] && dtb="--dt ${dt}" 100 | 101 | $mkbootimg --kernel $kernel --ramdisk $ramdisk --board "$board" \ 102 | --base $base_addr --ramdisk_offset $ramdisk_offset \ 103 | --tags_offset $tags_offset --cmdline "$cmd_line" \ 104 | --pagesize $page_size $second $dtb -o $1 || error=1 105 | 106 | [ $error -eq 1 ] && return $error 107 | ramdisk_size=$(stat -c "%s" $ramdisk) 108 | boot_size=$(stat -c "%s" $1) 109 | pout "Kernel size: $kernel_size, new ramdisk size: $ramdisk_size, $(basename $1): $boot_size." 110 | pout "$(basename $1) has been created." 111 | } 112 | 113 | #decide action 114 | [ $# -lt 2 ] || [ $# -gt 3 ] && usage 115 | if [ $# -eq 2 ] && [ -d $1 ]; then 116 | mkboot_from_dir=1 117 | elif [ $# -eq 2 ] && [ -s $1 ]; then 118 | split_boot_to_dir=1 119 | else 120 | usage 121 | fi 122 | 123 | #mkboot_from_dir, img_info 124 | if [ ! -z $mkboot_from_dir ]; then 125 | pout "mkbootimg from $1/img_info." 126 | unpacked_dir=$(readlink -f $1) 127 | new_img=$(readlink -f $2) 128 | cd $unpacked_dir 129 | if [ ! -s img_info ]; then 130 | pout "not found img_info file! can't rebuild img." 131 | clean 132 | fi 133 | eval $(cat img_info) 134 | if [ -z $kernel ] || [ -z $ramdisk ] || [ -z $base_addr ]; then 135 | pout "img_info file have not enough parameters." 136 | clean 137 | fi 138 | [ -z $second_size ] && second_size=0 139 | [ -z $dtb_size ] && dtb_size=0 140 | if [ -d $ramdisk ]; then 141 | [ -z $format ] && format=gzip 142 | zip_command $format 143 | #cd $ramdisk; find . | fakeroot cpio -R 0:0 -H newc -o 2>/dev/null \ 144 | # | $zcommand > $unpacked_dir/new_ramdisk; cd $unpacked_dir 145 | $mkbootfs $ramdisk | $zcommand > new_ramdisk 146 | ramdisk=new_ramdisk 147 | ramdisk_size=$(stat -c "%s" $ramdisk) 148 | fi 149 | print_info 150 | pout "ramdisk is $format format." 151 | rm -f $new_img 152 | mkboot_img $new_img || perr "Make boot.img Error! pls check img_info file." 153 | #pout "Add SEANDROIDENFORCE tag." 154 | #printf SEANDROIDENFORCE >> $new_img 155 | rm -f new_ramdisk 156 | clean 157 | fi 158 | 159 | #split boot.img to dir. 160 | if [ -e $2 ]; then 161 | read -p "$2 exists, delete?(N/y)" reply 162 | case $reply in 163 | y | Y) 164 | rm -rf $2 165 | ;; 166 | *) 167 | exit 168 | ;; 169 | esac 170 | fi 171 | tempdir="$(readlink -f $2)" 172 | mkdir -p $tempdir 173 | pout "Unpack & decompress $1 to $2" 174 | 175 | #get boot.img info 176 | cp -f $1 $tempdir/ 177 | cd $tempdir 178 | bootimg=$(basename $1) 179 | offset=$(grep -abo ANDROID! $bootimg | cut -f 1 -d :) 180 | [ -z $offset ] && clean 181 | if [ $offset -gt 0 ]; then 182 | dd if=$bootimg of=bootimg bs=$offset skip=1 2>/dev/null 183 | bootimg=bootimg 184 | fi 185 | 186 | kernel_addr=0x$(od -A n -X -j 12 -N 4 $bootimg | sed 's/ //g' | sed 's/^0*//g') 187 | ramdisk_addr=0x$(od -A n -X -j 20 -N 4 $bootimg | sed 's/ //g' | sed 's/^0*//g') 188 | second_addr=0x$(od -A n -X -j 28 -N 4 $bootimg | sed 's/ //g' | sed 's/^0*//g') 189 | tags_addr=0x$(od -A n -X -j 32 -N 4 $bootimg | sed 's/ //g' | sed 's/^0*//g') 190 | 191 | kernel_size=$(od -A n -D -j 8 -N 4 $bootimg | sed 's/ //g') 192 | #base_addr=0x$(od -A n -x -j 14 -N 2 $bootimg | sed 's/ //g')0000 193 | ramdisk_size=$(od -A n -D -j 16 -N 4 $bootimg | sed 's/ //g') 194 | second_size=$(od -A n -D -j 24 -N 4 $bootimg | sed 's/ //g') 195 | page_size=$(od -A n -D -j 36 -N 4 $bootimg | sed 's/ //g') 196 | dtb_size=$(od -A n -D -j 40 -N 4 $bootimg | sed 's/ //g') 197 | #cmd_line=$(od -A n --strings -j 64 -N 512 $bootimg) 198 | #board=$(od -A n --strings -j 48 -N 16 $bootimg) 199 | cmd_line=$(od -A n -S1 -j 64 -N 512 $bootimg) 200 | board=$(od -A n -S1 -j 48 -N 16 $bootimg) 201 | 202 | base_addr=$((kernel_addr-0x00008000)) 203 | kernel_offset=$((kernel_addr-base_addr)) 204 | ramdisk_offset=$((ramdisk_addr-base_addr)) 205 | second_offset=$((second_addr-base_addr)) 206 | tags_offset=$((tags_addr-base_addr)) 207 | 208 | base_addr=$(printf "%08x" $base_addr) 209 | kernel_offset=$(printf "%08x" $kernel_offset) 210 | ramdisk_offset=$(printf "%08x" $ramdisk_offset) 211 | second_offset=$(printf "%08x" $second_offset) 212 | tags_offset=$(printf "%08x" $tags_offset) 213 | 214 | base_addr=0x${base_addr:0-8} 215 | kernel_offset=0x${kernel_offset:0-8} 216 | ramdisk_offset=0x${ramdisk_offset:0-8} 217 | second_offset=0x${second_offset:0-8} 218 | tags_offset=0x${tags_offset:0-8} 219 | 220 | k_count=$(((kernel_size+page_size-1)/page_size)) 221 | r_count=$(((ramdisk_size+page_size-1)/page_size)) 222 | s_count=$(((second_size+page_size-1)/page_size)) 223 | d_count=$(((dtb_size+page_size-1)/page_size)) 224 | k_offset=1 225 | r_offset=$((k_offset+k_count)) 226 | s_offset=$((r_offset+r_count)) 227 | d_offset=$((s_offset+s_count)) 228 | 229 | #kernel 230 | dd if=$bootimg of=kernel_tmp bs=$page_size skip=$k_offset count=$k_count 2>/dev/null 231 | dd if=kernel_tmp of=kernel bs=$kernel_size count=1 2>/dev/null 232 | #ramdisk.packed 233 | dd if=$bootimg of=ramdisk_tmp bs=$page_size skip=$r_offset count=$r_count 2>/dev/null 234 | dd if=ramdisk_tmp of=ramdisk.packed bs=$ramdisk_size count=1 2>/dev/null 235 | #second 236 | if [ $second_size -gt 0 ]; then 237 | dd if=$bootimg of=second.img.tmp bs=$page_size skip=$s_offset count=$s_count 2>/dev/null 238 | dd if=second.img.tmp of=second.img bs=$second_size count=1 2>/dev/null 239 | s_name="second=second.img\n" 240 | s_size="second_size=$second_size\n" 241 | fi 242 | #dtb 243 | if [ $dtb_size -gt 0 ]; then 244 | dd if=$bootimg of=dt.img_tmp bs=$page_size skip=$d_offset count=$d_count 2>/dev/null 245 | dd if=dt.img_tmp of=dt.img bs=$dtb_size count=1 2>/dev/null 246 | dt="$tempdir/dt.img" 247 | dt=$(basename $dt) 248 | dt_name="dt=$dt\n" 249 | dt_size="dtb_size=$dtb_size\n" 250 | fi 251 | rm -f *_tmp $(basename $1) $bootimg 252 | 253 | kernel=kernel 254 | ramdisk=ramdisk 255 | [ ! -s $kernel ] && clean 256 | #print boot.img info 257 | print_info 258 | 259 | esq="'\"'\"'" 260 | escaped_cmd_line=`echo $cmd_line | sed "s/'/$esq/g"` 261 | 262 | #write info to img_info,decompression ramdisk.packed 263 | printf "kernel=kernel\nramdisk=ramdisk\n${s_name}${dt_name}page_size=$page_size\n\ 264 | kernel_size=$kernel_size\nramdisk_size=$ramdisk_size\n${s_size}${dt_size}base_addr=$base_addr\nkernel_offset=$kernel_offset\n\ 265 | ramdisk_offset=$ramdisk_offset\ntags_offset=$tags_offset\ncmd_line=\'$escaped_cmd_line\'\nboard=\"$board\"\n" > img_info 266 | mkdir ramdisk 267 | cd ramdisk 268 | 269 | gzip -t ../ramdisk.packed 2>/dev/null 270 | if [ $? -eq 0 ]; then 271 | pout "ramdisk is gzip format." 272 | format=gzip 273 | gzip -d -c ../ramdisk.packed | cpio -i -d -m --no-absolute-filenames 2>/dev/null 274 | unpack_complete 275 | fi 276 | lzma -t ../ramdisk.packed 2>/dev/null 277 | if [ $? -eq 0 ]; then 278 | pout "ramdisk is lzma format." 279 | format=lzma 280 | lzma -d -c ../ramdisk.packed | cpio -i -d -m --no-absolute-filenames 2>/dev/null 281 | unpack_complete 282 | fi 283 | xz -t ../ramdisk.packed 2>/dev/null 284 | if [ $? -eq 0 ]; then 285 | pout "ramdisk is xz format." 286 | format=xz 287 | xz -d -c ../ramdisk.packed | cpio -i -d -m --no-absolute-filenames 2>/dev/null 288 | unpack_complete 289 | fi 290 | lzop -t ../ramdisk.packed 2>/dev/null 291 | if [ $? -eq 0 ]; then 292 | pout "ramdisk is lzo format." 293 | format=lzop 294 | lzop -d -c ../ramdisk.packed | cpio -i -d -m --no-absolute-filenames 2>/dev/null 295 | unpack_complete 296 | fi 297 | $tooldir/lz4 -d ../ramdisk.packed 2>/dev/null | cpio -i -d -m --no-absolute-filenames 2>/dev/null 298 | if [ $? -eq 0 ]; then 299 | pout "ramdisk is lz4 format." 300 | format=lz4 301 | else 302 | pout "ramdisk is unknown format,can't unpack ramdisk" 303 | fi 304 | unpack_complete 305 | 306 | -------------------------------------------------------------------------------- /mkbootimg_tools/mkbootfs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfX-android/android_buildtools/7d55c8b24860bb5892ca0fa1895cfa20eaf0f990/mkbootimg_tools/mkbootfs -------------------------------------------------------------------------------- /mkbootimg_tools/mkbootimg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfX-android/android_buildtools/7d55c8b24860bb5892ca0fa1895cfa20eaf0f990/mkbootimg_tools/mkbootimg -------------------------------------------------------------------------------- /print-bootloader-id.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################################################################# 3 | # Print the bootloader IDs for devices supporting it 4 | # 5 | # Usage: 6 | # print-bootloader-id.sh /path/to/avb_pkmd.bin 7 | ############################################################################################################# 8 | # License: MIT 9 | ############################################################################################################# 10 | 11 | key="$1" 12 | 13 | if [ ! -f "$key" ];then 14 | echo "missing key or not existent: $key" 15 | exit 4 16 | fi 17 | 18 | FPID=$(cat "$key" | openssl dgst -sha256 | cut -d "=" -f 2 | tr -d " " | tr "[[:lower:]]" "[[:upper:]]") 19 | echo -e "\nBOOTLOADER minimal ID" 20 | echo -e "\t${FPID:0:8}\n" 21 | echo -e "BOOTLOADER full ID:" 22 | echo -e "\t${FPID:0:16}" 23 | echo -e "\t${FPID:16:16}" 24 | echo -e "\t${FPID:32:16}" 25 | echo -e "\t${FPID:48:16}\n" 26 | -------------------------------------------------------------------------------- /raw_resources.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sfX-android/android_buildtools/7d55c8b24860bb5892ca0fa1895cfa20eaf0f990/raw_resources.bin -------------------------------------------------------------------------------- /rawresources.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import os 3 | import struct 4 | from pathlib import Path 5 | 6 | HEADER_SIZE = 2048 # This is the size of the redundant information between the start of the file and the first set of image information 7 | HEADER_MAGIC = b'BOOT_IMAGE_RLE' # This is present at the start of the raw_resources.bin file 8 | HEADER_MAGIC_SIZE = len(HEADER_MAGIC) # This is simply the number of bytes used in the HEADER_MAGIC - used to correctly move to the end of the header 9 | IMAGE_INFO_SIZE = 64 # The number of bytes used to store the data values for each image 10 | 11 | """ 12 | The format for the image data: 13 | 40 bytes for the name (with the unused space taken up with a 0 as the byte value) 14 | 3 bytes for offset 15 | 3 bytes for size 16 | 3 bytes for width 17 | 3 bytes for height 18 | 3 bytes for posX 19 | 3 bytes for posY 20 | 6 (1 between each data value) 21 | The bytes are done in the opposite way to usual - The first has the least significant value 22 | """ 23 | 24 | def printhex(name, val): 25 | print(name + ":", val) 26 | print("\thex:", hex(val)) 27 | 28 | 29 | class image: # Class to store the information of the image and print it when needed 30 | def __init__(self, name, offset, size, width, height, posX, posY): 31 | self.name = name 32 | self.offset = offset 33 | self.size = size 34 | self.width = width 35 | self.height = height 36 | self.posX = posX 37 | self.posY = posY 38 | 39 | def printStats(self): 40 | print("name:", self.name) 41 | printhex("offset", self.offset) 42 | printhex("size", self.size) 43 | printhex("width", self.width) 44 | printhex("height", self.height) 45 | printhex("posX", self.posX) 46 | printhex("posY", self.posY) 47 | 48 | 49 | def extractImageInfo(imgInfo, raw_Data): 50 | nameList = [] # Simple loop to add the bytes for the name into a list - breaks at the first 0 or when the 40 allocated bytes have been searched 51 | for byteData in range(40): 52 | if imgInfo[byteData] == 0: 53 | break 54 | nameList.append(imgInfo[byteData]) 55 | name = (bytes(nameList)).decode() # Takes the bytes in the list, converts it back to raw bytes and then decodes it into a string 56 | offset = imgInfo[40] + (imgInfo[41] * 256) + (imgInfo[42] * 65536) 57 | #print(imgInfo[40], imgInfo[41], imgInfo[42]) 58 | size = imgInfo[44] + (imgInfo[45] * 256) + (imgInfo[46] * 65536) 59 | width = imgInfo[48] + (imgInfo[49] * 256) + (imgInfo[50] * 65536) 60 | height = imgInfo[52] + (imgInfo[53] * 256) + (imgInfo[54] * 65536) 61 | posX = imgInfo[56] + (imgInfo[57] * 256) + (imgInfo[58] * 65536) 62 | posY = imgInfo[60] + (imgInfo[61] * 256) + (imgInfo[62] * 65536) 63 | 64 | myimg = image(name, offset, size, width, height, posX, posY) 65 | myimg.printStats() 66 | outputFiles(myimg, raw_Data) 67 | 68 | 69 | def outputFiles(myimg, raw_Data): 70 | relevantdata = raw_Data[myimg.offset:myimg.offset + myimg.size] 71 | rawfile = "out/raw/{}".format(myimg.name) + ".data" 72 | with open(rawfile, 'wb') as newFile: 73 | newFile.write(relevantdata) 74 | flippedfile = "out/flipped/{}".format(myimg.name) + ".rle.data" 75 | with open(rawfile, "rb") as old, open(flippedfile, "wb") as new: 76 | for chunk in iter(lambda: old.read(4), b""): 77 | chunk = struct.pack("f", chunk)[0]) 78 | new.write(chunk) 79 | 80 | if __name__ == '__main__': 81 | 82 | inFile = "raw_resources.bin" 83 | 84 | if not (Path(inFile).is_file()): 85 | print("Error:", inFile, "is not a file.") 86 | exit() 87 | with open(inFile, "rb") as rr: 88 | raw_Data = rr.read() 89 | rr.seek(0) 90 | byte = rr.read(HEADER_MAGIC_SIZE) 91 | if (byte != HEADER_MAGIC): 92 | print("Error: The file you supplied is not a valid raw_resources image.") 93 | exit() 94 | # consume the whitespace 95 | if not os.path.exists('./out'): 96 | os.makedirs('./out') 97 | if not os.path.exists('./out/raw'): 98 | os.makedirs('./out/raw') 99 | if not os.path.exists('./out/flipped'): 100 | os.makedirs('./out/flipped') 101 | byte = rr.read(HEADER_SIZE - HEADER_MAGIC_SIZE) 102 | 103 | while True: 104 | imgInfo = bytearray(rr.read(IMAGE_INFO_SIZE)) # Reads the image info for one image (and subsequently moves the read head to the start of the next one) 105 | if (imgInfo[0] == 0): # Reached the end of the image info 106 | break 107 | extractImageInfo(imgInfo, raw_Data) 108 | -------------------------------------------------------------------------------- /sign/README.md: -------------------------------------------------------------------------------- 1 | # About 2 | 3 | create your own keys for signing your build and prepare the ROM sources to use your own keys 4 | 5 | ## sign_generate_keys.sh 6 | 7 | Needed once only for creating your own signing keys: 8 | 9 | 1. will create all signing keys required in `$KEYS_DIR` (default `./user-keys/`) directory.
10 | Examples: `releasekey platform shared media networkstack verity ...` 11 | 1. will create a releasekey in readable format for [manual verifier](https://github.com/sfX-android/update_verifier) 12 | 1. will create an AVB key needed for flashing on compatible devices (like Google's Pixel, OnePlus) 13 | 14 | Usage: `./sign_generate_keys.sh` 15 | 16 | #### environment variables 17 | 18 | mandatory: 19 | - `USER_NAME` : sets given username for certificate CN (will set `CN=-$CERTCN`, will abort if unset) 20 | 21 | optional: 22 | - `CERT_CN` : sets a custom certificate CN (will set `CN=$USER_NAME-`, default: "aosp") 23 | - `KEYS_DIR` : target directory where the keys should be stored 24 | - `KSIZE` : set keysize (allowed: 4096|8192), default is [here](https://github.com/sfX-android/android_buildtools/blob/main/sign/sign_generate_keys.sh#L11-L13) - **WARNING: Setting 8192 requires to patch the Updater + recovery to allow OTA's / ADB sideload install/upgrade** 25 | - `HASHTYPE` : set keysize (allowed: sha256|sha512), default is [here](https://github.com/sfX-android/android_buildtools/blob/main/sign/sign_generate_keys.sh#L11-L13) - **WARNING: Setting sha512 requires to patch the Updater + recovery to allow OTA's / ADB sideload install/upgrade** 26 | 27 | ## sign_set_keysdir.sh 28 | 29 | Needed always after a full Android sources sync. Enables the use of the key file directory within `vendor//config/common.mk` 30 | 31 | #### Usage 32 | 33 | - `./sign_set_keysdir.sh [link-name-to-KEYS_DIR]` 34 | 35 | ``` 36 | vendor//config/common.mk will be changed to use the right keys directory (so must exist) 37 | Android-Version must be specified as: "a9, a10, .." or "A9, A10, .." 38 | [] Optional: specify the link name which should point to the real KEYS_DIR path 39 | ``` 40 | 41 | #### environment variables 42 | 43 | required: 44 | 45 | - `export KEYS_DIR=`: target directory where the keys are expected 46 | 47 | optional: 48 | 49 | instead of specifying the (optional) `` as a parameter you can also set the variable 50 | 51 | - `export KEYS_DIR_LINKNAME=`
note: when both are specified (call parameter + environment variable) the parameter wins 52 | 53 | #### Examples 54 | 55 | - `./sign_set_keysdir.sh lineage a11` 56 | - `./sign_set_keysdir.sh graphene a14 keys/lynx` 57 | 58 | -------------------------------------------------------------------------------- /sign/make_key: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (C) 2009 The Android Open Source Project 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | # Generates a public/private key pair suitable for use in signing 18 | # android .apks and OTA update packages. 19 | 20 | if [ "$#" -lt 2 -o "$#" -gt 3 ]; then 21 | cat < [] 23 | 24 | Creates .pk8 key and .x509.pem cert. Cert contains the 25 | given . A keytype of "rsa" or "ec" is accepted. 26 | EOF 27 | exit 2 28 | fi 29 | 30 | if [[ -e $1.pk8 || -e $1.x509.pem ]]; then 31 | echo "$1.pk8 and/or $1.x509.pem already exist; please delete them first" 32 | echo "if you want to replace them." 33 | exit 1 34 | fi 35 | 36 | # Use named pipes to connect get the raw RSA private key to the cert- 37 | # and .pk8-creating programs, to avoid having the private key ever 38 | # touch the disk. 39 | 40 | tmpdir=$(mktemp -d) 41 | trap 'rm -rf ${tmpdir}; echo; exit 1' EXIT INT QUIT 42 | 43 | one=${tmpdir}/one 44 | two=${tmpdir}/two 45 | mknod ${one} p 46 | mknod ${two} p 47 | chmod 0600 ${one} ${two} 48 | 49 | read -p "Enter password for '$1' (blank for none; password will be visible): " \ 50 | password 51 | 52 | case $KSIZE in 53 | 2048|3072|4096|5120|8192) echo setting rsa-${KSIZE} ;; 54 | *) echo "UNSUPPORTED or empty key size: >$KSIZE<" ; exit 3;; 55 | esac 56 | 57 | case $HASHTYPE in 58 | sha256|sha512) echo setting $HASHTYPE ;; 59 | *) echo "UNSUPPORTED or empty hash >$HASHTYPE<" ; exit 3 ;; 60 | esac 61 | 62 | if [ "${3}" = "rsa" -o "$#" -eq 2 ]; then 63 | ( openssl genrsa -f4 $KSIZE | tee ${one} > ${two} ) & 64 | hash="-${HASHTYPE}" 65 | elif [ "${3}" = "ec" ]; then 66 | ( openssl ecparam -name prime256v1 -genkey -noout | tee ${one} > ${two} ) & 67 | hash="-sha256" 68 | else 69 | echo "Only accepts RSA or EC keytypes." 70 | exit 1 71 | fi 72 | 73 | openssl req -new -x509 ${hash} -key ${two} -out $1.x509.pem \ 74 | -days 10000 -subj "$2" & 75 | 76 | if [ "${password}" == "" ]; then 77 | echo "creating ${1}.pk8 with no password" 78 | openssl pkcs8 -in ${one} -topk8 -outform DER -out $1.pk8 -nocrypt 79 | else 80 | echo "creating ${1}.pk8 with password [${password}]" 81 | export password 82 | openssl pkcs8 -in ${one} -topk8 -outform DER -out $1.pk8 \ 83 | -passout env:password -scrypt 84 | unset password 85 | fi 86 | 87 | wait 88 | wait 89 | -------------------------------------------------------------------------------- /sign/sign_generate_keys.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ######################################################################################### 3 | # 4 | # Author & Copyright: 2020-2024 steadfasterX 5 | # 6 | # Generate all required keys for signing Android builds 7 | # 8 | ######################################################################################### 9 | 10 | VENDOR_DIR=$(dirname $0) 11 | [ -z "$KEYS_DIR" ] && KEYS_DIR=user-keys 12 | _USR=$USER_NAME 13 | [ -z $_USR ] && _USR=$BUILD_USERNAME 14 | [ -z $_USR ] && echo "ERROR: missing USER_NAME var!" && exit 3 15 | [ -z "$CERT_CN" ] && CERT_CN=aosp 16 | KEYS_SUBJECT='/C=US/ST=Somewhere/L=Somewhere/CN='${_USR}-${CERT_CN}'/OU=Android/O=Google/emailAddress=android@android.local' 17 | 18 | # ensure avbtool binary path is set properly 19 | # (e.g on pie external/avb/avbtool exists only but on A14 there's only external/avb/avbtool.py 20 | [ ! -x external/avb/avbtool ] && ln -s avbtool.py external/avb/avbtool 21 | 22 | # default key/hash sizes 23 | DEFKSIZE=4096 24 | DEFHASHTYPE=sha256 25 | 26 | [ ! -d $KEYS_DIR ] && mkdir -p $KEYS_DIR 27 | 28 | case $KSIZE in 29 | 2048|4096|8192) echo setting rsa-${KSIZE} ;; 30 | *) echo -e "UNSUPPORTED or empty key size: >$KSIZE< --> Using default KSIZE=$DEFKSIZE"; export KSIZE=$DEFKSIZE;; 31 | esac 32 | 33 | case $HASHTYPE in 34 | sha256|sha512) echo setting $HASHTYPE ;; 35 | *) echo -e "UNSUPPORTED or empty hash >$HASHTYPE< --> Using default HASHTYPE=$DEFHASHTYPE" ; export HASHTYPE=$DEFHASHTYPE ;; 36 | esac 37 | 38 | unset nlist 39 | for c in releasekey platform shared media networkstack verity sdk_sandbox bluetooth extra apps nfc; do 40 | for k in pem key pk8 x509.pem der;do 41 | if [ -f "$KEYS_DIR/${c}.${k}" ];then 42 | echo "WARNING: $KEYS_DIR/$c.${k} exists!! I WILL NOT OVERWRITE EXISTING KEYS!" 43 | echo "$nlist" |grep -q "$c" && nlist=$(echo $nlist | sed "s/$c//g") 44 | continue 2 45 | else 46 | echo "$nlist" |grep -q "$c" || nlist="$nlist $c" 47 | fi 48 | done 49 | done 50 | for nc in $nlist;do 51 | echo ">> [$(date)] Generating $nc..." 52 | if [ $nc == releasekey ] && [ "$HASHTYPE" != sha256 ];then 53 | echo "enforce max hash algo to SHA256 for releasekey!" 54 | echo "reason: build/make/tools/signapk/src/com/android/signapk/SignApk.java does not support anything else (atm)" 55 | HASHTYPE=sha256 ${VENDOR_DIR}/make_key "$KEYS_DIR/$nc" "$KEYS_SUBJECT" <<< '' &> /dev/null 56 | else 57 | ${VENDOR_DIR}/make_key "$KEYS_DIR/$nc" "$KEYS_SUBJECT" <<< '' &> /dev/null 58 | fi 59 | done 60 | 61 | for c in cyngn{-priv,}-app testkey; do 62 | for e in pk8 x509.pem; do 63 | ln -s releasekey.$e "$KEYS_DIR/$c.$e" 2> /dev/null 64 | test -L "$KEYS_DIR/$c.$e" 65 | done 66 | done 67 | 68 | # make readable format for manual verifier 69 | [ ! -f "$KEYS_DIR/releasekey.pem" ] && openssl rsa -inform DER -outform PEM -in $KEYS_DIR/releasekey.pk8 -out $KEYS_DIR/releasekey.pem && echo "... $KEYS_DIR/releasekey.pem created" 70 | [ ! -f "$KEYS_DIR/releasekey_OTA.pub" ] && openssl rsa -in $KEYS_DIR/releasekey.pem -pubout > $KEYS_DIR/releasekey_OTA.pub && echo "... $KEYS_DIR/releasekey_OTA.pub created" 71 | 72 | # make AVB required stuff 73 | # AVB supports usually (atm) only sha256+4096bit max 74 | for a in pk8;do 75 | if [ -f "$KEYS_DIR/avb.${a}" ];then 76 | echo "WARNING: avb.${a} exists!! I WILL NOT OVERWRITE EXISTING KEYS!" 77 | continue 78 | fi 79 | if [ "$HASHTYPE" != "sha256" -a "$HASHTYPE" != "sha512" ];then 80 | echo "Unsupported hash type for AVB: $HASHTYPE" 81 | echo "enforcing max known to work value instead (sha512)" 82 | export HASHTYPE=sha512 83 | fi 84 | if [ "$KSIZE" -gt 4096 ];then 85 | echo "Unsupported key size for AVB: $KSIZE" 86 | echo "enforcing max known to work value instead (4096)" 87 | export KSIZE=4096 88 | fi 89 | echo ">> [$(date)] Generating AVB ($a | $KSIZE/$HASHTYPE)..." 90 | ${VENDOR_DIR}/make_key "$KEYS_DIR/avb" "$KEYS_SUBJECT" <<< '' #&> /dev/null 91 | done 92 | if [ ! -f $KEYS_DIR/avb_pkmd.bin ];then 93 | [ ! -f "$KEYS_DIR/avb.x509.der" ] && openssl x509 -outform DER -in $KEYS_DIR/avb.x509.pem -out $KEYS_DIR/avb.x509.der && echo "... $KEYS_DIR/avb.x509.der created" 94 | [ ! -f "$KEYS_DIR/avb.pem" ] && openssl pkcs8 -in $KEYS_DIR/avb.pk8 -inform DER -out $KEYS_DIR/avb.pem -nocrypt && echo "... $KEYS_DIR/avb.pem created" 95 | python external/avb/avbtool extract_public_key --key $KEYS_DIR/avb.pem --output $KEYS_DIR/avb_pkmd.bin && echo "... $KEYS_DIR/avb_pkmd.bin created" 96 | fi 97 | 98 | # Android >= 14 requires to set a BUILD file for bazel to avoid errors: 99 | cat > $KEYS_DIR/BUILD << _EOB 100 | # adding an empty BUILD file fixes the A14 build error: 101 | # "ERROR: no such package 'keys': BUILD file not found in any of the following directories. Add a BUILD file to a directory to mark it as a package." 102 | # adding the filegroup "android_certificate_directory" fixes the A14 build error: 103 | # "no such target '//keys:android_certificate_directory': target 'android_certificate_directory' not declared in package 'keys'" 104 | filegroup( 105 | name = "android_certificate_directory", 106 | srcs = glob([ 107 | "*.pk8", 108 | "*.pem", 109 | ]), 110 | visibility = ["//visibility:public"], 111 | ) 112 | _EOB 113 | -------------------------------------------------------------------------------- /sign/sign_set_keysdir.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ################################################################################################ 3 | # 4 | # Author & Copyright: 2020-2025 steadfasterX 5 | # 6 | # Prepare dir to use a custom signing key 7 | # 8 | ################################################################################################ 9 | 10 | # important for determining version number translation & vendor path 11 | vendor=$1 12 | 13 | # can be just "11" or "a11" or "android11" or "android-11" .. anything except digits will be removed 14 | androidver=$2 15 | 16 | # optionally specifying the keys dir (relative from the sources path) 17 | [ ! -z "$3" ] && tdir="$3" 18 | [ -z "$tdir" -a ! -z "$KEYS_DIR_LINKNAME" ] && tdir="$KEYS_DIR_LINKNAME" 19 | 20 | # set directory name within the source dir 21 | if [ -z "$tdir" ];then 22 | case "$vendor" in 23 | graphene) tdir="keys" ;; 24 | *) tdir="user-keys";; 25 | esac 26 | fi 27 | 28 | [ -z "$androidver" ] && androidver=0 29 | 30 | # translate ROM specific versions 31 | case $androidver in 32 | [aA]7) androidver=7;; 33 | [aA]8) androidver=8 ;; 34 | [aA]9) androidver=9 ;; 35 | [aA]10) androidver=10 ;; 36 | [aA]11) androidver=11 ;; 37 | [aA]12) androidver=12 ;; 38 | [aA]13) androidver=13 ;; 39 | [aA]14) androidver=14 ;; 40 | [aA]15) androidver=15 ;; 41 | *) 42 | echo "ERROR: Unknown android version specified! please use a7, a8, a9, ... (A7, A8, A9, ... will work, too) for a clear definition!" 43 | echo "Update your scripts and workflows which using this script as names (nougat, etc) and numbers (16.0, 17.1 etc) support has been dropped!" 44 | exit 4 45 | ;; 46 | esac 47 | normalizedver=$(echo "$androidver" | egrep -o "[0-9]+") 48 | 49 | # (re)create keys dir(s) if specified 50 | if [ ! -z "$KEYS_DIR" ];then 51 | if [ ! -d "$KEYS_DIR" ]; then 52 | echo "$KEYS_DIR does not exist - creating it..." 53 | mkdir -p "$KEYS_DIR" 54 | fi 55 | if [ ! -L $tdir ]&&[ -d "$tdir" ];then 56 | echo "WARNING: KEYS_DIR main path '$tdir' is a directory - we expected a LINK instead!" 57 | else 58 | # WARNING: we have to ensure that a link has been removed before. 59 | # otherwise (even when using ln -sf) a folder "keys" will be added within the link dir 60 | rm $tdir 61 | # Soong (Android 9+) complains if the signing keys are outside the build path 62 | ln -s "$KEYS_DIR" $tdir 63 | fi 64 | fi 65 | 66 | if [ "$vendor" != "graphene" ];then 67 | 68 | if [ "$vendor" == "eos" ] && [ "$normalizedver" -ge 10 ];then 69 | echo "skipped PRODUCT_DEFAULT_DEV_CERTIFICATE + PRODUCT_OTA_PUBLIC_KEYS as eOS is A${normalizedver} and so part of vendor/eos already" 70 | else 71 | [ ! -f vendor/$vendor/config/common.mk ] && echo "vendor/$vendor/config/common.mk does not exists! ABORTED" && exit 9 72 | grep -q "PRODUCT_DEFAULT_DEV_CERTIFICATE := $tdir/releasekey" vendor/$vendor/config/common.mk 73 | if [ $? -ne 0 ];then 74 | sed -i "1s;^;PRODUCT_DEFAULT_DEV_CERTIFICATE := $tdir/releasekey\n;" vendor/$vendor/config/common.mk && echo "PRODUCT_DEFAULT_DEV_CERTIFICATE set" 75 | fi 76 | grep -q "PRODUCT_OTA_PUBLIC_KEYS := $tdir/releasekey" vendor/$vendor/config/common.mk 77 | if [ $? -ne 0 ];then 78 | sed -i "1s;^;PRODUCT_OTA_PUBLIC_KEYS := $tdir/releasekey\n;" vendor/$vendor/config/common.mk && echo "PRODUCT_OTA_PUBLIC_KEYS set" 79 | fi 80 | fi 81 | 82 | fi 83 | if [ "$vendor" != "graphene" ];then 84 | # android =< 10 will fail when using PRODUCT_EXTRA_RECOVERY_KEYS 85 | if [ "$normalizedver" -lt 10 ];then 86 | grep -q "PRODUCT_EXTRA_RECOVERY_KEYS := $tdir/releasekey" vendor/$vendor/config/common.mk 87 | if [ $? -ne 0 ];then 88 | sed -i "1s;^;PRODUCT_EXTRA_RECOVERY_KEYS := $tdir/releasekey\n;" vendor/$vendor/config/common.mk && echo "PRODUCT_EXTRA_RECOVERY_KEYS set" 89 | fi 90 | fi 91 | fi 92 | -------------------------------------------------------------------------------- /start_android_env.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ########################################################################## 3 | # 4 | # Start a valid Android/TWRP build environment on Arch Linux 5 | # 6 | # Copyright: steadfasterX , 2018 7 | # License: LGPL v2 8 | ########################################################################## 9 | # 10 | # Requirements: 11 | # $> pacman -Sy python2-virtualenv 12 | # 13 | # $> cd ~ 14 | # $> virtualenv2 venvpy2 (will create an virtual env named venvpy2) 15 | # $> ln -s /usr/lib/python2.7/* ~/venvpy2/lib/python2.7/ 16 | # 17 | ########################################################################## 18 | SRCONLY=0 19 | BIN=${0##*/} 20 | F_HELP(){ 21 | cat <about etc) 79 | export HOSTNAME="sfxbook-droid" 80 | 81 | # the user which should be displayed in your builds (settings->about etc) 82 | export USER=steadfasterx 83 | 84 | # sets a part of the bash prompt to identify where you are in 85 | BASHPROMPT=android # can be overwritten by the "check how we started" case condition 86 | PDIRSIZE='\\W' # \\W means only the current dirname. \\w means the FULL path 87 | 88 | # where is your MAIN android source dir (1 level BEFORE your sources dir) 89 | # when starting this script with an argument you can automate the lunch cmd 90 | # (just extend the "check how we started" case condition 91 | BDIR=/opt/data/development/android_build 92 | 93 | # check how we started 94 | case $1 in 95 | -help|--help|-h|help) 96 | F_HELP 97 | exit 98 | ;; 99 | twrp) 100 | ADIR=omni 101 | SELECTDEVICE="lunch omni_g4-eng" 102 | BASHPROMPT=TWRP 103 | ;; 104 | los15) 105 | ADIR="los/15.1" 106 | ;; 107 | manual) # will just display a copy/paste template 108 | ADIR=$2 109 | BASHPROMPT="$ADIR" 110 | SRCONLY=1 111 | ;; 112 | *) 113 | ADIR="$1" 114 | BASHPROMPT="$ADIR" 115 | ;; 116 | esac 117 | 118 | # 119 | # END - VARIABLE SECTION 120 | ####################################################################################### 121 | # no changes beyond here needed (usually) 122 | # 123 | 124 | [ -z $ADIR ] && echo "require a starting dir.. ABORTED" && exit 1 125 | 126 | # some special vars 127 | export HISTFILE="$HOME/.android_big_history" # sets the path to a custom history file for android building 128 | export HISTFILESIZE="200000" # max lines of $HISTFILE at startup time of a session (e.g. 100k have an avg of ~4MB file size) 129 | export HISTSIZE="10000" # max lines that are stored in MEMORY(!) in a history list while your bash session is ONGOING 130 | 131 | [ ! -f $HISTFILE ] && touch $HISTFILE 132 | 133 | # required! otherwise build will fail :p 134 | export LANG=$LANG 135 | export LC_ALL=C 136 | 137 | ccache --set-config=max_size=$CACHESIZE 138 | 139 | # prepare the basics 140 | cd ${BDIR}/${ADIR} 141 | ENVSRC=custombuildenv 142 | 143 | cat >$ENVSRC<> $ENVSRC 187 | 188 | if [ $SRCONLY -eq 0 ] ;then 189 | export -f $(lsfns) 190 | 191 | # fasten your seat bells.. the magic happens NOW! 192 | /bin/bash --rcfile <(echo "echo -e \"\nAndroid build environment has been setup:\n\tpython: $PYVER\n\tuse ccache: $USE_CCACHE\n\tJAVA_HOME: $JAVA_HOME\n\tTW_DEVICE_VERSION: $TW_DEVICE_VERSION\n\tbuild user: $USER\n\thost set: $HOSTNAME\n\";source $ENVSRC") 193 | 194 | #/bin/bash -c "echo -e \"\nAndroid build environment has been setup:\n\tpython: $(python --version 2>&1)\n\tuse ccache: $USE_CCACHE\n\tJAVA_HOME: $JAVA_HOME\n\tTW_DEVICE_VERSION: $TW_DEVICE_VERSION\n\tbuild user: $USER\n\thost set: $HOSTNAME\n\"; \ 195 | # $SHELL --rcfile $ENVSRC" 196 | else 197 | echo "copy & paste only mode.." 198 | cat >$ENVSRC< 5 | # 6 | # Licensed under the LGPL v3 or later: 7 | # 8 | # This program is free software: you can redistribute it and/or modify 9 | # it under the terms of the GNU General Public License as published by 10 | # the Free Software Foundation, either version 3 of the License, or 11 | # (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program. If not, see . 20 | # 21 | ############################################################################################################### 22 | # 23 | # Description: 24 | # simple TWRP benchmark tester for the LG G4 25 | # Use it with any other device if you like ! Just adjust the topics: 26 | # "# set readahead" and "# set IO scheduler" 27 | # 28 | # 29 | VERSION=20161130 30 | ############################################################################################################### 31 | 32 | BAKNAME=benchmarktest 33 | LOG=${0/.sh/.log} 34 | 35 | echo "Starting $0 (version: $VERSION)" 36 | echo "Starting $0 (version: $VERSION)" > $LOG 37 | 38 | # usage info 39 | F_USAGE(){ 40 | cat < this output 47 | 48 | 49 | required args: 50 | -rhsize => read_ahead_kb 51 | -gov => cpu governor 52 | -isch => I/O scheduler 53 | -mode [SDRBCO] => backup args 54 | # S = System partition 55 | # D = Data partition 56 | # R = Recovery partition 57 | # B = Boot partition 58 | # C = Cache partition 59 | # O = Activate compression 60 | 61 | optional args: 62 | -key => decryption password when using this script 63 | in a loop (e.g. for i in 1 2 3 ;do ...) 64 | May not work always 'cause sometimes you have 65 | to reconnect the usb cable after a reboot 66 | 67 | 68 | EOHELP 69 | } 70 | 71 | 72 | [ -z "$1" ] &&echo -e "\naborted! Missing args\n\n" && F_USAGE && exit 73 | 74 | # check for help first 75 | echo "$@" |grep -q "-help" && F_USAGE && exit 76 | 77 | while [ ! -z "$1" ] ;do 78 | case "$1" in 79 | -rhsize) 80 | RHSIZE=$2 81 | shift 2 82 | ;; 83 | -gov) 84 | CGOV=$2 85 | shift 2 86 | ;; 87 | -isch) 88 | ISCH=$2 89 | shift 2 90 | ;; 91 | -mode) 92 | BAKARGS="$2" 93 | shift 2 94 | ;; 95 | -key) 96 | KEY=$2 97 | shift 2 98 | ;; 99 | *) 100 | echo "ERROR unknown arg <$1>" 101 | exit 102 | ;; 103 | esac 104 | done 105 | 106 | # precheck for req args 107 | if [ -z "$RHSIZE" ]||[ -z "$CGOV" ]||[ -z "$ISCH" ]||[ -z "$BAKARGS" ];then 108 | echo -e "\n\nmissing a required arg! ABORTED!\n\n" 109 | F_USAGE 110 | exit 111 | fi 112 | 113 | # ensure we have a decrypted device if suggested 114 | [ ! -z "$KEY" ] && echo "decrypt key set. Trying to decrypt now..." && adb shell "twrp decrypt $KEY" >> $LOG 115 | ERR=$? 116 | [ $ERR -ne 0 ] && echo -e "\n\nERROR <$ERR> occured!!!\n ABORTED!!\nHere comes the LOG:\n $(less $LOG)" && exit 117 | echo "device decrypted or no decryption needed (ended with >$ERR<)" >> $LOG 118 | 119 | # when we decrypted we need to take a breath because adb will reload then 120 | [ ! -z "$KEY" ] && echo "done. Now taking a deep breath before proceeding (adb needs that..)" && sleep 5 121 | 122 | # ensure we use the external storage 123 | adb shell 'twrp set tw_storage_path /external_sd' >> $LOG 124 | ERR=$? 125 | [ $ERR -ne 0 ] && echo -e "\n\nERROR <$ERR> occured!!!\n ABORTED!!\nHere comes the LOG:\n $(less $LOG)" && exit 126 | echo "tw_storage_path set to /external_sd (ended with >$ERR<)" >> $LOG 127 | 128 | # ensure we have no old backups in place 129 | echo "deleting any previous >$BAKNAME< backup" 130 | adb shell "rm -vRf /external_sd/TWRP/BACKUPS/*/$BAKNAME/; rm -vRf /sdcard/TWRP/BACKUPS/*/$BAKNAME/" >> $LOG 131 | ERR=$? 132 | [ $ERR -ne 0 ] && echo -e "\n\nERROR <$ERR> occured!!!\n ABORTED!!\nHere comes the LOG:\n $(less $LOG)" && exit 133 | echo "deleting any previous >$BAKNAME< backup finished (ended with >$ERR<)" >> $LOG 134 | 135 | # set cpu governor 136 | adb shell "for i in \$(find /sys/devices/ -type f -name scaling_governor);do echo $CGOV > \$i;cat \$i;done" >> $LOG 137 | ERR=$? 138 | [ $ERR -ne 0 ] && echo -e "\n\nERROR <$ERR> occured!!!\n ABORTED!!\nHere comes the LOG:\n $(less $LOG)" && exit 139 | echo "governor set (ended with >$ERR<)" >> $LOG 140 | 141 | # set IO scheduler 142 | adb shell "for a in \$(find /sys/devices/soc.0/ -type f -name scheduler|grep mmc);do echo $ISCH > \$a; cat \$a;done" >> $LOG 143 | ERR=$? 144 | [ $ERR -ne 0 ] && echo -e "\n\nERROR <$ERR> occured!!!\n ABORTED!!\nHere comes the LOG:\n $(less $LOG)" && exit 145 | echo "scheduler set (ended with >$ERR<)" >> $LOG 146 | 147 | # set readahead 148 | for b in /sys/devices/virtual/bdi/179\\:0/read_ahead_kb /sys/devices/virtual/bdi/254\\:0/read_ahead_kb /sys/devices/virtual/bdi/179\\:32/read_ahead_kb /sys/devices/virtual/bdi/179\\:64/read_ahead_kb;do 149 | adb shell "echo $RHSIZE >> $b; cat $b" 150 | ERR=$? 151 | [ $ERR -ne 0 ] && echo -e "\n\nERROR <$ERR> occured!!!\n ABORTED!!\nHere comes the LOG:\n $(less $LOG)" && exit 152 | done >> $LOG 153 | echo "readahead set (ended with >$ERR<)" >> $LOG 154 | 155 | # grep results and reboot 156 | echo "Ok.. now lean back: we start the backup! This can take a fucking long time!" 157 | echo "using: readahead=$RHSIZE, governor=$CGOV, scheduler=$ISCH, backup-args=$BAKARGS" 158 | echo "Backup starting! using: readahead=$RHSIZE, governor=$CGOV, scheduler=$ISCH, backup-args=$BAKARGS" >> $LOG 159 | # delete any existing previously pulled log 160 | rm -f recovery.log 161 | unset REMLOG 162 | # do the magic 163 | adb shell "twrp backup $BAKARGS $BAKNAME" >> $LOG \ 164 | && adb pull /tmp/recovery.log \ 165 | && egrep -i '(seconds|backup rate)' recovery.log \ 166 | && adb shell "rm -Rf /external_sd/TWRP/BACKUPS/*/$BAKNAME/" \ 167 | && adb reboot recovery && sleep 10 && echo "waiting for recovered device (if encrypted just click CANCEL on decryption page to get recovered)" \ 168 | && adb wait-for-recovery 169 | ERR=$? 170 | [ $ERR -ne 0 ] && echo -e "\n\nERROR <$ERR> occured!!!\n ABORTED!!\nHere comes the LOG:\n $(less $LOG)" && exit 171 | echo "Backup ended with >$ERR<" >> $LOG 172 | 173 | echo -e "finished\n\n" 174 | 175 | -------------------------------------------------------------------------------- /universalbuilder.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ################################################# 3 | # 4 | # This is a build script helper for sediROM 5 | # 6 | ################################################# 7 | 8 | # defines the maximum cpu's you want to use if not set by env. Valid for AOSP builds only because 9 | # for CM we always use mka / all CPUs 10 | [ -z "$MAXCPU" ] && MAXCPU=8 11 | 12 | SRCDIR="build/envsetup.sh" 13 | [ ! -f $SRCDIR ]&& echo "Are you in the root dir??? aborted." && exit 3 14 | 15 | EXDIR=${0%/*} 16 | 17 | # help/usage 18 | F_HELP(){ 19 | echo USAGE: 20 | echo 21 | echo "$0 needs one of:" 22 | echo " systemimage|userdataimage|otapackage|bootimage|recovery|mr_twrp|multirom|trampoline|multirom_zip|free|showtargets" 23 | echo " kernelonly" 24 | echo 25 | echo " e.g.: $0 otapackage" 26 | echo 27 | echo "You can also add a 'make clean or make installclean' by given it as the second arg" 28 | echo " valid options are: clean|installclean" 29 | echo 30 | echo " e.g.: $0 otapackage clean" 31 | echo 32 | echo "Special commands:" 33 | echo " You will be asked what target you want. No limits ;-)" 34 | echo " Scans for all available targets and creates a file output." 35 | echo 36 | echo "Special variables:" 37 | echo " MAXCPU for commands supporting it you can define a max amount of CPUs" 38 | echo " BUILDID if you call 'BUILDID=samsung/i927 $0' you will skip that question" 39 | echo " LOKIFY if you set this to 1 we will lokify at the end" 40 | echo " NEEDEDJAVA & JAVACBIN overwrite internal java detection. BOTH needed!" 41 | echo " NEEDEDJAVA e.g.: java-7-oracle" 42 | echo " JAVACBIN e.g.: /usr/lib/jvm/java-7-openjdk-amd64/bin/javac" 43 | echo " BUILDWHAT will be auto generated from vendorsetup.sh which will be overwritten" 44 | echo " when this var is specified. Example: aoscp_h815" 45 | echo 46 | echo "Kernelonly variables:" 47 | echo " KDIR if set it overwrites the default kernel dir (kernel/$BUILDID)" 48 | echo " KCONF the kernel defconfig filename - will prompt if not set" 49 | echo " CCPATH the full path to the wanted toolchain to use - default is UBER TC on arm64" 50 | echo " CCPREFIX the prefix for the toolchain cmds" 51 | echo 52 | } 53 | # check if we have at least 1 arg: 54 | [ -z $1 ]&& echo -e "MISSING ARG. \n\n" && F_HELP && exit 3 55 | 56 | case $1 in 57 | -h|--help) 58 | F_HELP 59 | exit 0 60 | ;; 61 | showtargets) 62 | echo "Generating all available targets..." 63 | make -qp | awk -F':' '/^[a-zA-Z0-9][^$#\/\t=]*:([^=]|$)/ {split($1,A,/ /);for(i in A)print A[i]}' > alltargets 64 | echo "All available build targets can be found in the file './alltargets' now." 65 | exit 66 | ;; 67 | esac 68 | 69 | source $SRCDIR 70 | if [ -z $BUILDID ];then 71 | echo 72 | echo "******************************************************************************************************" 73 | echo "Tell me the build id. It must match the one in device tree and need to include the vendor as well." 74 | echo 75 | echo "Example:" 76 | echo "lge/fx3q --> will look into device/lge/fx3q/" 77 | echo "or" 78 | echo "samsung/i927 --> will look into device/samsung/i927" 79 | echo "or" 80 | echo "lge/h815 --> will look into device/lge/h815" 81 | echo "and so on...!" 82 | echo 83 | echo "you can skip this step by providing BUILDID - see help" 84 | echo "******************************************************************************************************" 85 | echo 86 | echo "Ok now give me your build id:" 87 | read BUILDID 88 | else 89 | echo "BUILDID was predefined as $BUILDID" 90 | fi 91 | [ -z $BUILDWHAT ] && BUILDWHAT=$(egrep "^add_lunch_combo" device/$BUILDID/vendorsetup.sh |cut -d" " -f2) 92 | 93 | # choose the right java JDK 94 | # you need to have installed: openjdk-7-jdk for java1.7 and openjdk-6-jdk for v1.6 95 | echo enabling correct java version depending on which Android version you want to build.. 96 | BUILDJAV=$(echo ${PWD##*/}) 97 | case "$BUILDJAV" in 98 | aosp_ics) 99 | #NEEDEDJAVA=java-6-oracle 100 | NEEDEDJAVA=java-1.6.0-openjdk-amd64 101 | JAVACBIN=/usr/lib/jvm/java-6-openjdk-amd64/bin/javac 102 | BUILDEXEC="make -j${MAXCPU}" 103 | ;; 104 | aosp_jb) 105 | NEEDEDJAVA=java-1.6.0-openjdk-amd64 106 | JAVACBIN=/usr/lib/jvm/java-6-openjdk-amd64/bin/javac 107 | BUILDEXEC="make -j${MAXCPU}" 108 | ;; 109 | aosp_kk) 110 | #NEEDEDJAVA=java-7-oracle 111 | NEEDEDJAVA=java-1.7.0-openjdk-amd64 112 | JAVACBIN=/usr/lib/jvm/java-7-openjdk-amd64/bin/javac 113 | BUILDEXEC="make -j${MAXCPU}" 114 | ;; 115 | cm_ics|cm_jb) 116 | NEEDEDJAVA=java-6-oracle 117 | JAVACBIN=/usr/lib/jvm/$NEEDEDJAVA/bin/javac 118 | BUILDEXEC="mka" 119 | ;; 120 | cm_kk) 121 | NEEDEDJAVA=java-7-oracle 122 | JAVACBIN=/usr/lib/jvm/$NEEDEDJAVA/bin/javac 123 | #NEEDEDJAVA=java-1.7.0-openjdk-amd64 124 | #JAVACBIN=/usr/lib/jvm/java-7-openjdk-amd64/bin/javac 125 | BUILDEXEC="mka" 126 | ;; 127 | mm_*|ll_*|13.0|14.0|14.1) 128 | NEEDEDJAVA=java-7-oracle 129 | JAVACBIN=/usr/lib/jvm/$NEEDEDJAVA/bin/javac 130 | BUILDEXEC="mka" 131 | ;; 132 | *) 133 | BUILDEXEC="make -j${MAXCPU}" 134 | if [ -z $NEEDEDJAVA ]||[ -z $JAVACBIN ];then 135 | echo "cannot determine best java version and you havent choosen JAVACBIN or NEEDEDJAVA var!" 136 | F_HELP 137 | exit 3 138 | fi 139 | ;; 140 | esac 141 | echo "... checking if we need to switch Java version" 142 | CURRENTJ=$(java -version 2>&1|grep version) 143 | NEWJBIN=$(/usr/lib/jvm/$NEEDEDJAVA/bin/java -version 2>&1|grep version) 144 | if [ "x$CURRENTJ" == "x$NEWJBIN" ];then 145 | echo "... skipping java switch because we already have the wanted version ($CURRENTJ == $NEWJBIN)" 146 | else 147 | echo "($CURRENTJ vs. $NEWJBIN)" 148 | echo "... switching to $NEEDEDJAVA..." 149 | sudo update-java-alternatives -v -s $NEEDEDJAVA 150 | fi 151 | 152 | CURRENTC=$(javac -version 2>&1) 153 | NEWJCBIN=$($JAVACBIN -version 2>&1) 154 | if [ "x$CURRENTC" == "x$NEWJCBIN" ];then 155 | echo "... skipping javaC switch because we already have the wanted version ($CURRENTC == $NEWJCBIN)" 156 | else 157 | echo "($CURRENTC vs. $NEWJCBIN)" 158 | echo "... switching to $JAVACBIN..." 159 | sudo update-alternatives --set javac $JAVACBIN 160 | fi 161 | echo "DONE (Java)" 162 | 163 | if [ x"$LOKIFY" == "x1" ];then 164 | 165 | # Loki specific 166 | LOKI="/home/xdajog/loki_tool" # the loki patch binary 167 | ABOOT="/home/xdajog/aboot.img" # the dd'ed image of aboot 168 | LOKINEED=boot.img # the file which should be patched. will auto adjusted when you choosen 'recovery' 169 | LOKITYPE=boot # the loki patch type. will auto adjusted when you choosen 'recovery' but not when 'mr_twrp' 170 | 171 | # Loki check 172 | if [ ! -f "$LOKI" ]||[ ! -f "$ABOOT" ];then 173 | echo missing loki binary. That means we can NOT lokifying for you! 174 | read DUMMY 175 | LOKIOK=3 176 | else 177 | echo "Great you have loki in place! So we are able to do loki for you at the end!" 178 | LOKIOK=0 179 | fi 180 | else 181 | echo "Will not doing lokify because LOKIFY is not set." 182 | LOKIFY=0 183 | LOKIOK=0 184 | fi 185 | 186 | sec=$2 187 | 188 | # check the targets 189 | case $1 in 190 | otapackage|bootimage|systemimage|userdataimage) 191 | echo $1 choosen 192 | BUILDEXEC="$BUILDEXEC $1" 193 | ;; 194 | multirom|trampoline|multirom_zip) 195 | echo $1 choosen 196 | BUILDEXEC="$BUILDEXEC $1" 197 | LOKIOK=1 198 | echo LOKI disabled because of your above choice 199 | ;; 200 | recovery) 201 | echo $1 choosen 202 | BUILDEXEC="$BUILDEXEC ${1}image" 203 | LOKINEED=recovery.img 204 | LOKITYPE=recovery 205 | ;; 206 | mr_twrp) 207 | echo $1 choosen 208 | BUILDEXEC="$BUILDEXEC recoveryimage" 209 | LOKINEED=recovery.img 210 | echo 211 | echo "***********************************************************" 212 | echo "PLEASE ENTER THE LOKI TYPE (can be 'boot' or 'recovery'):" 213 | read LOKITYPE 214 | echo "***********************************************************" 215 | ;; 216 | mr_full) 217 | echo $1 choosen 218 | BUILDEXEC="$BUILDEXEC recoveryimage multirom trampoline" 219 | LOKINEED=recovery.img 220 | echo 221 | echo "***********************************************************" 222 | echo "PLEASE ENTER THE LOKI TYPE (can be 'boot' or 'recovery'):" 223 | read LOKITYPE 224 | echo "***********************************************************" 225 | ;; 226 | free) 227 | echo "***********************************************************" 228 | echo "Enter your build choice (will NOT be verified!)" 229 | echo "Can be multiple choices - separated by space:" 230 | read BARG 231 | BUILDEXEC="$BUILDEXEC $BARG" 232 | echo "Do you want to LOKI? If so enter the Loki Type (recovery|boot) otherwise ENTER:" 233 | read "LOKITYPE" 234 | [ -z "$LOKITYPE" ]&& LOKIOK=1 235 | echo "***********************************************************" 236 | ;; 237 | kernelonly) 238 | OUTDIR=./out 239 | CDIR=$(pwd) 240 | KARG="undef" 241 | 242 | echo "$1 with arg: $2 choosen" 243 | KARG="$2" 244 | 245 | while [ -z "$UARCH" ];do 246 | read -p "No UARCH variable given so which architecture (x86 | x64)?" UARCH 247 | done 248 | 249 | [ _"$UARCH" == "_x64" ]&& RARCH=arm64 250 | [ _"$UARCH" == "_x86" ]&& RARCH=arm 251 | [ -z "$RARCH" ]&& echo -e "\n\nERROR: no valid arch defined!! x64 or x86 are the only valid\n\n" && exit 3 252 | 253 | [ -z "$KDIR" ] && KDIR="kernel/$BUILDID/" 254 | test -d $KDIR 255 | END=$? 256 | while [ $END -ne 0 ];do 257 | test -d $KDIR 258 | if [ $? -ne 0 ];then 259 | echo "expected kernel source $KDIR does not exists please enter the correct one:" 260 | read -p "kernel source dir> " KDIR 261 | test -d $KDIR 262 | END=$? 263 | fi 264 | done 265 | cd $KDIR && echo "changed work directory to $KDIR" 266 | # check optional given args 267 | case "$KARG" in 268 | clean|mrproper) 269 | echo "CLEANING before make!" 270 | make mrproper 271 | make clean 272 | rm -Rf $OUTDIR 273 | mkdir -p $OUTDIR 274 | ;; 275 | " "|""|undef) 276 | echo "No args given so no cleanup before doing the work.." 277 | ;; 278 | *) 279 | echo 280 | read -p "The given arg(s) $KARG will be IGNORED as those are not valid! Press ENTER to continue." DUMMY 281 | ;; 282 | esac 283 | mkdir -p $OUTDIR 284 | 285 | while [ -z "$KCONF" ]||[ ! -r arch/$RARCH/configs/$KCONF ];do 286 | echo "config $KCONF invalid or not defined!" 287 | ls -la arch/$RARCH/configs/$KCONF 288 | echo "No KCONF given so please enter your kernel defconfig filename:" 289 | read "KCONF" 290 | done 291 | 292 | if [ "$RARCH" == "arm64" ];then 293 | # default is Toolchain UBER 4.9 and requires properly synced sources 294 | [ -z "$CCPATH" ] && CCPATH=$CDIR/prebuilts/gcc/linux-x86/aarch64-linux-android-4.9-kernel/bin 295 | [ -z "$CCPREFIX" ] && CCPREFIX="aarch64-linux-android-" 296 | TC="UBER4.9" 297 | else 298 | if [ "$RARCH" == "arm" ];then 299 | # TODO: make the TC selectable.. 300 | CCPATH="$CDIR/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8/bin" 301 | CCPREFIX="arm-eabi-" 302 | else 303 | echo -e "\n\nERROR: no valid ARCH defined! Restart and choose either x86 or x64!!\n\n" 304 | exit 3 305 | fi 306 | fi 307 | while [ ! -d ${CCPATH} ];do 308 | echo "cross compile path invalid or not defined!" 309 | echo "CCPATH: $CCPATH" 310 | echo "Please enter the toolchain path" 311 | read -p "(FULL path required!) " CCPATH 312 | done 313 | # where the kernel resists 314 | ZIMAGE_DIR=$OUTDIR/arch/$RARCH/boot/ 315 | 316 | export ARCH=$RARCH 317 | export TARGET_PRODUCT=${BUILDID#*/}_${USER} 318 | export TARGET_KERNEL_CONFIG=$KCONF 319 | export CROSS_COMPILE="${CCPATH}/${CCPREFIX}" 320 | export KCONF=$KCONF 321 | 322 | # build kernel device tree 323 | MBTOOLS="$CDIR/prebuilts/devtools/mkbootimg_tools" 324 | [ ! -d $MBTOOLS ]&& MBTOOLS="$CDIR/$EXDIR/mkbootimg_tools" 325 | KERNOUT=$OUTDIR/kernel 326 | DTDIR="$CDIR/device/$BUILDID" 327 | mkdir -p $KERNOUT 328 | 329 | # Need to have KDTB set with the main call! 330 | if [ "$RARCH" == "arm64" ];then 331 | DTBIMAGE="dtb" 332 | 333 | make -j$MAXCPU O="$OUTDIR" $KCONF -Werror && echo "makefile done. now starting the machines... " \ 334 | && make O="$OUTDIR" -j$MAXCPU -Werror \ 335 | && echo "make completed successfully! Now copying the kernel to your device tree folder" \ 336 | && cp -v $ZIMAGE_DIR/Image.gz-dtb $DTDIR/Image.gz-dtb.new \ 337 | && cp -v $ZIMAGE_DIR/Image $DTDIR/Image.new \ 338 | && echo "Now starting DTB creation" \ 339 | && $MBTOOLS/dtbToolCM -3 -o $KERNOUT/$DTBIMAGE -s 2048 -p $OUTDIR/scripts/dtc/ $OUTDIR/arch/$RARCH/boot/dts/ \ 340 | && cp -v $KERNOUT/$DTBIMAGE $DTDIR/dt.img-new \ 341 | && chmod 664 $DTDIR/dt.img-new \ 342 | && md5sum $KERNOUT/$DTBIMAGE $DTDIR/dt.img-new $ZIMAGE_DIR/Image.gz-dtb $DTDIR/Image.gz-dtb.new \ 343 | && echo -e "\nAll done successfull!!\n\n\t--> KERNEL:\t$DTDIR/Image.gz-dtb.new\n\t\t\t$DTDIR/Image.new\n\t--> DTB:\t$DTDIR/dt.img-new\n\n" 344 | #&& $MBTOOLS/dtbToolCM -2 -o $KERNOUT/$DTBIMAGE -s 2048 -p $OUTDIR/scripts/dtc/ $OUTDIR/arch/$RARCH/boot/dts/ \ 345 | else 346 | make O="$OUTDIR" $KCONF && echo "makefile done. now starting the machines... " \ 347 | && make O="$OUTDIR" -j$MAXCPU zImage \ 348 | && echo "make completed successfully! Now copying the kernel to your device tree folder" \ 349 | && cp $ZIMAGE_DIR/zImage $DTDIR/zImage.new \ 350 | && md5sum $ZIMAGE_DIR/zImage $DTDIR/zImage.new \ 351 | && echo -e "\nAll done successfull!!\n\n\t--> KERNEL:\t$DTDIR/zImage.new\n" 352 | 353 | fi 354 | 355 | echo TARGET_PRODUCT was $TARGET_PRODUCT 356 | cd $CDIR 357 | echo "changed work directory back to root" 358 | LOKIOK=1 359 | echo LOKI disabled because of kernelonly 360 | 361 | exit 362 | ;; 363 | clean|installclean) 364 | echo will do $1 only.. 365 | make $1 366 | [ -d kernel/$BUILDID/out ]&& rm -R kernel/$BUILDID/out 367 | [ -d $KDIR/out ]&& rm -R $KDIR/out 368 | exit 2 369 | ;; 370 | *) 371 | F_HELP 372 | exit 2 373 | ;; 374 | esac 375 | 376 | if [ ! -z "$sec" ];then 377 | case $sec in 378 | clean) 379 | echo will $sec before 380 | make $sec 381 | [ -d kernel/$BUILDID/out ]&& rm -R kernel/$BUILDID/out 382 | ;; 383 | installclean) 384 | echo will $sec before 385 | make $sec 386 | [ -d kernel/$BUILDID/out ]&& rm -R kernel/$BUILDID/out 387 | ;; 388 | *) 389 | echo unknown clean arg aborted 390 | exit 3 391 | ;; 392 | esac 393 | fi 394 | 395 | source $SRCDIR && lunch $BUILDWHAT && time $BUILDEXEC 396 | 397 | BUILDEND=$? 398 | 399 | echo "... BUILD ended with errorlevel = $BUILDEND" 400 | 401 | if [ $LOKIFY -eq 1 ] && [ $LOKIOK -eq 0 ]&&[ $BUILDEND -eq 0 ];then 402 | echo "Lokifying ($LOKINEED as $LOKITYPE)..." 403 | $LOKI patch $LOKITYPE $ABOOT out/target/product/fx3q/$LOKINEED out/target/product/fx3q/${LOKINEED}.lokied 404 | else 405 | echo "... skipping loki" 406 | fi 407 | 408 | exit $BUILDEND 409 | -------------------------------------------------------------------------------- /xtrasforcherrypicker.py: -------------------------------------------------------------------------------- 1 | # Strings in blacklist should be in lower case 2 | BLACKLIST = [ 3 | "device_", 4 | "kernel_", 5 | "_vendor", 6 | "jenkins", 7 | "crowdin", 8 | "google", 9 | "samsung", 10 | "ota", 11 | "prebuilts", 12 | "qcom", 13 | "telephony", 14 | "updater", 15 | "_update_engine", 16 | "partsbin", 17 | "deviceparts", 18 | "messaging", 19 | "jamesdspmanager", 20 | ] 21 | UPSTREAM = [ 22 | "art", 23 | "bionic", 24 | "bootable_recovery", 25 | "build_make", 26 | "build_soong", 27 | "device_qcom_sepolicy", 28 | "external_tinycompress", 29 | "frameworks_av", 30 | "frameworks_base", 31 | "frameworks_native", 32 | "frameworks_opt_net_ims", 33 | "frameworks_opt_net_wifi", 34 | "frameworks_opt_telephony", 35 | "hardware_interfaces", 36 | "hardware_lineage_interfaces", 37 | "hardware_libhardware", 38 | "packages_apps_Bluetooth", 39 | "packages_apps_Contacts", 40 | "packages_apps_DeskClock", 41 | "packages_apps_Dialer", 42 | "packages_apps_ExactCalculator", 43 | "packages_apps_Jelly", 44 | "packages_apps_Messaging", 45 | "packages_apps_PhoneCommon", 46 | "packages_apps_Snap", 47 | "packages_apps_Settings", 48 | "packages_apps_ThemePicker", 49 | "packages_apps_Updater", 50 | "packages_apps_WallpaperPicker2", 51 | "packages_providers_DownloadProvider", 52 | "packages_providers_MediaProvider", 53 | "packages_services_Telecomm", 54 | "packages_services_Telephony", 55 | "prebuilts_tools-lineage", 56 | "system_bt", 57 | "system_core", 58 | "system_netd", 59 | "system_sepolicy", 60 | "system_vold", 61 | "system_update_engine", 62 | "vendor_lineage", 63 | ] 64 | # Strings in whitelist should be in lower case 65 | WHITELIST = [ 66 | "vendor_du", 67 | "vendor_lineage", 68 | "_support", 69 | "telephonyprovider", 70 | ] 71 | --------------------------------------------------------------------------------