├── .gitignore ├── LICENSE ├── README.md ├── asus └── flo │ ├── libacdbloader.mk │ ├── proprietary-blobs.txt │ └── tzapps.mdt.mk ├── bytecode.sh ├── deps ├── bin │ └── simg2img └── jar │ ├── baksmali │ ├── baksmali.jar │ ├── smali │ └── smali.jar ├── generate-vendor.sh ├── lge └── hammerhead │ ├── libacdbloader.mk │ └── proprietary-blobs.txt ├── log.sh └── mk.sh /.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | vendor/ 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2017 Preetam J. D'Souza 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 | Apache License 16 | Version 2.0, January 2004 17 | http://www.apache.org/licenses/ 18 | 19 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 20 | 21 | 1. Definitions. 22 | 23 | "License" shall mean the terms and conditions for use, reproduction, 24 | and distribution as defined by Sections 1 through 9 of this document. 25 | 26 | "Licensor" shall mean the copyright owner or entity authorized by 27 | the copyright owner that is granting the License. 28 | 29 | "Legal Entity" shall mean the union of the acting entity and all 30 | other entities that control, are controlled by, or are under common 31 | control with that entity. For the purposes of this definition, 32 | "control" means (i) the power, direct or indirect, to cause the 33 | direction or management of such entity, whether by contract or 34 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 35 | outstanding shares, or (iii) beneficial ownership of such entity. 36 | 37 | "You" (or "Your") shall mean an individual or Legal Entity 38 | exercising permissions granted by this License. 39 | 40 | "Source" form shall mean the preferred form for making modifications, 41 | including but not limited to software source code, documentation 42 | source, and configuration files. 43 | 44 | "Object" form shall mean any form resulting from mechanical 45 | transformation or translation of a Source form, including but 46 | not limited to compiled object code, generated documentation, 47 | and conversions to other media types. 48 | 49 | "Work" shall mean the work of authorship, whether in Source or 50 | Object form, made available under the License, as indicated by a 51 | copyright notice that is included in or attached to the work 52 | (an example is provided in the Appendix below). 53 | 54 | "Derivative Works" shall mean any work, whether in Source or Object 55 | form, that is based on (or derived from) the Work and for which the 56 | editorial revisions, annotations, elaborations, or other modifications 57 | represent, as a whole, an original work of authorship. For the purposes 58 | of this License, Derivative Works shall not include works that remain 59 | separable from, or merely link (or bind by name) to the interfaces of, 60 | the Work and Derivative Works thereof. 61 | 62 | "Contribution" shall mean any work of authorship, including 63 | the original version of the Work and any modifications or additions 64 | to that Work or Derivative Works thereof, that is intentionally 65 | submitted to Licensor for inclusion in the Work by the copyright owner 66 | or by an individual or Legal Entity authorized to submit on behalf of 67 | the copyright owner. For the purposes of this definition, "submitted" 68 | means any form of electronic, verbal, or written communication sent 69 | to the Licensor or its representatives, including but not limited to 70 | communication on electronic mailing lists, source code control systems, 71 | and issue tracking systems that are managed by, or on behalf of, the 72 | Licensor for the purpose of discussing and improving the Work, but 73 | excluding communication that is conspicuously marked or otherwise 74 | designated in writing by the copyright owner as "Not a Contribution." 75 | 76 | "Contributor" shall mean Licensor and any individual or Legal Entity 77 | on behalf of whom a Contribution has been received by Licensor and 78 | subsequently incorporated within the Work. 79 | 80 | 2. Grant of Copyright License. Subject to the terms and conditions of 81 | this License, each Contributor hereby grants to You a perpetual, 82 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 83 | copyright license to reproduce, prepare Derivative Works of, 84 | publicly display, publicly perform, sublicense, and distribute the 85 | Work and such Derivative Works in Source or Object form. 86 | 87 | 3. Grant of Patent License. Subject to the terms and conditions of 88 | this License, each Contributor hereby grants to You a perpetual, 89 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 90 | (except as stated in this section) patent license to make, have made, 91 | use, offer to sell, sell, import, and otherwise transfer the Work, 92 | where such license applies only to those patent claims licensable 93 | by such Contributor that are necessarily infringed by their 94 | Contribution(s) alone or by combination of their Contribution(s) 95 | with the Work to which such Contribution(s) was submitted. If You 96 | institute patent litigation against any entity (including a 97 | cross-claim or counterclaim in a lawsuit) alleging that the Work 98 | or a Contribution incorporated within the Work constitutes direct 99 | or contributory patent infringement, then any patent licenses 100 | granted to You under this License for that Work shall terminate 101 | as of the date such litigation is filed. 102 | 103 | 4. Redistribution. You may reproduce and distribute copies of the 104 | Work or Derivative Works thereof in any medium, with or without 105 | modifications, and in Source or Object form, provided that You 106 | meet the following conditions: 107 | 108 | (a) You must give any other recipients of the Work or 109 | Derivative Works a copy of this License; and 110 | 111 | (b) You must cause any modified files to carry prominent notices 112 | stating that You changed the files; and 113 | 114 | (c) You must retain, in the Source form of any Derivative Works 115 | that You distribute, all copyright, patent, trademark, and 116 | attribution notices from the Source form of the Work, 117 | excluding those notices that do not pertain to any part of 118 | the Derivative Works; and 119 | 120 | (d) If the Work includes a "NOTICE" text file as part of its 121 | distribution, then any Derivative Works that You distribute must 122 | include a readable copy of the attribution notices contained 123 | within such NOTICE file, excluding those notices that do not 124 | pertain to any part of the Derivative Works, in at least one 125 | of the following places: within a NOTICE text file distributed 126 | as part of the Derivative Works; within the Source form or 127 | documentation, if provided along with the Derivative Works; or, 128 | within a display generated by the Derivative Works, if and 129 | wherever such third-party notices normally appear. The contents 130 | of the NOTICE file are for informational purposes only and 131 | do not modify the License. You may add Your own attribution 132 | notices within Derivative Works that You distribute, alongside 133 | or as an addendum to the NOTICE text from the Work, provided 134 | that such additional attribution notices cannot be construed 135 | as modifying the License. 136 | 137 | You may add Your own copyright statement to Your modifications and 138 | may provide additional or different license terms and conditions 139 | for use, reproduction, or distribution of Your modifications, or 140 | for any such Derivative Works as a whole, provided Your use, 141 | reproduction, and distribution of the Work otherwise complies with 142 | the conditions stated in this License. 143 | 144 | 5. Submission of Contributions. Unless You explicitly state otherwise, 145 | any Contribution intentionally submitted for inclusion in the Work 146 | by You to the Licensor shall be under the terms and conditions of 147 | this License, without any additional terms or conditions. 148 | Notwithstanding the above, nothing herein shall supersede or modify 149 | the terms of any separate license agreement you may have executed 150 | with Licensor regarding such Contributions. 151 | 152 | 6. Trademarks. This License does not grant permission to use the trade 153 | names, trademarks, service marks, or product names of the Licensor, 154 | except as required for reasonable and customary use in describing the 155 | origin of the Work and reproducing the content of the NOTICE file. 156 | 157 | 7. Disclaimer of Warranty. Unless required by applicable law or 158 | agreed to in writing, Licensor provides the Work (and each 159 | Contributor provides its Contributions) on an "AS IS" BASIS, 160 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 161 | implied, including, without limitation, any warranties or conditions 162 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 163 | PARTICULAR PURPOSE. You are solely responsible for determining the 164 | appropriateness of using or redistributing the Work and assume any 165 | risks associated with Your exercise of permissions under this License. 166 | 167 | 8. Limitation of Liability. In no event and under no legal theory, 168 | whether in tort (including negligence), contract, or otherwise, 169 | unless required by applicable law (such as deliberate and grossly 170 | negligent acts) or agreed to in writing, shall any Contributor be 171 | liable to You for damages, including any direct, indirect, special, 172 | incidental, or consequential damages of any character arising as a 173 | result of this License or out of the use or inability to use the 174 | Work (including but not limited to damages for loss of goodwill, 175 | work stoppage, computer failure or malfunction, or any and all 176 | other commercial damages or losses), even if such Contributor 177 | has been advised of the possibility of such damages. 178 | 179 | 9. Accepting Warranty or Additional Liability. While redistributing 180 | the Work or Derivative Works thereof, You may choose to offer, 181 | and charge a fee for, acceptance of support, warranty, indemnity, 182 | or other liability obligations and/or rights consistent with this 183 | License. However, in accepting such obligations, You may act only 184 | on Your own behalf and on Your sole responsibility, not on behalf 185 | of any other Contributor, and only if You agree to indemnify, 186 | defend, and hold each Contributor harmless for any liability 187 | incurred by, or claims asserted against, such Contributor by reason 188 | of your accepting any such warranty or additional liability. 189 | 190 | END OF TERMS AND CONDITIONS 191 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # android-generate-vendor 2 | 3 | Scripts to extract vendor files from a factory image and generate vendor 4 | makefiles for AOSP. 5 | 6 | ## Why? 7 | 8 | Building custom Android ROMs for a device is harder than it appears. Although Android 9 | is open-source under the Android Open Source Project (AOSP), devices ship dozens of 10 | closed-source binaries ("blobs") that are needed to fully enable all device hardware. 11 | Obtaining these blobs can be...painful. 12 | 13 | Even with friendly devices like the Nexus line that distribute these binaries, there 14 | are cases of missing blobs, requiring ROM builders to manually extract these from factory 15 | images. The Nexus 5 (hammerhead), for example, is missing at least two APKs and three shared 16 | libraries in the distributed vendor binaries. 17 | 18 | These scripts aim to make the process of extracting vendor files and including them in AOSP 19 | builds simple and scalable. 20 | 21 | ## Caveats 22 | 23 | Right now, we only handle devices that ship all blobs in `/system`. Devices that 24 | use a separate vendor partition are unsupported right now; please see the excellent 25 | [android-prepare-vendor](https://github.com/anestisb/android-prepare-vendor) to deal 26 | with vendor partitions for the latest Nexus devices. 27 | 28 | ## Supported Devices 29 | 30 | * [Nexus 5 (hammerhead)](lge/hammerhead/proprietary-blobs.txt) 31 | * [Nexus 7 2013 Wi-Fi (flo)](asus/flo/proprietary-blobs.txt) 32 | 33 | ## Dependencies 34 | 35 | * [android-simg2img](https://github.com/anestisb/android-simg2img) 36 | * [smali](https://github.com/JesusFreke/smali) 37 | 38 | These are included under [deps](deps) for your convenience. 39 | 40 | ## Examples 41 | 42 | Generating a vendor tree for hammerhead build M4B30Z: 43 | 44 | ``` 45 | $ ./generate-vendor.sh -d hammerhead -i hammerhead-m4b30z-factory-625c027b.zip 46 | I: setting up output dir './vendor/lge/hammerhead'... 47 | I: preparing factory image... 48 | W: requesting sudo for loop mount... 49 | I: generating vendor makefiles... 50 | I: extracting vendor files from image... 51 | I: de-optimizing system/app/qcrilmsgtunnel/qcrilmsgtunnel.apk... 52 | I: de-optimizing system/app/shutdownlistener/shutdownlistener.apk... 53 | I: de-optimizing system/app/TimeService/TimeService.apk... 54 | I: de-optimizing system/framework/qcrilhook.jar... 55 | I: calculating checksums... 56 | I: all tasks completed successfully 57 | I: cleaning up... 58 | ``` 59 | 60 | ...you will end up with a clean vendor tree for your device: 61 | 62 | ``` 63 | $ tree -L 2 vendor/lge/hammerhead 64 | vendor/lge/hammerhead 65 | |-- Android.mk 66 | |-- device-partial.mk 67 | |-- device-vendor.mk 68 | |-- sha1sums.txt 69 | `-- system 70 | |-- app 71 | |-- bin 72 | |-- etc 73 | |-- framework 74 | |-- lib 75 | `-- vendor 76 | 77 | 7 directories, 4 files 78 | ``` 79 | 80 | Just copy the vendor directory to your AOSP workspace and you're good to go! 81 | 82 | ## License 83 | 84 | [Apache 2.0](LICENSE) 85 | -------------------------------------------------------------------------------- /asus/flo/libacdbloader.mk: -------------------------------------------------------------------------------- 1 | # Copyright 2013 The Android Open Source Project 2 | # Copyright 2017 Preetam J. D'Souza 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | ifeq ($(TARGET_DEVICE),flo) 17 | include $(CLEAR_VARS) 18 | LOCAL_MODULE := libacdbloader 19 | LOCAL_SRC_FILES := system/lib/libacdbloader.so 20 | LOCAL_MODULE_SUFFIX := .so 21 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES 22 | LOCAL_MODULE_PATH := $(TARGET_OUT)/lib 23 | LOCAL_MODULE_TAGS := optional 24 | LOCAL_MODULE_OWNER := asus 25 | 26 | # Create symbolic link because user space can access persist directory, 27 | # while kernel ALSA drivers can only access the /system/etc/firmware directory 28 | LOCAL_POST_INSTALL_CMD := \ 29 | mkdir -p $(TARGET_OUT_ETC)/firmware/wcd9310; \ 30 | ln -sf /data/misc/audio/wcd9310_anc.bin \ 31 | $(TARGET_OUT_ETC)/firmware/wcd9310/wcd9310_anc.bin; \ 32 | ln -sf /data/misc/audio/mbhc.bin \ 33 | $(TARGET_OUT_ETC)/firmware/wcd9310/wcd9310_mbhc.bin 34 | 35 | include $(BUILD_PREBUILT) 36 | endif 37 | -------------------------------------------------------------------------------- /asus/flo/proprietary-blobs.txt: -------------------------------------------------------------------------------- 1 | # ----------------------------------------------------------------------------- 2 | # Blobs - based on device/asus/flo/proprietary-blobs.txt 3 | 4 | system/bin/ATFWD-daemon 5 | system/bin/bridgemgrd 6 | system/bin/btnvtool 7 | system/bin/diag_klog 8 | system/bin/diag_mdlog 9 | system/bin/ds_fmc_appd 10 | system/bin/efsks 11 | system/bin/hci_qcomm_init 12 | system/bin/irsc_util 13 | system/bin/ks 14 | system/bin/mm-qcamera-app 15 | system/bin/mm-qcamera-daemon 16 | system/bin/mm-qjpeg-enc-test 17 | system/bin/mm-qomx-ienc-test 18 | system/bin/mpdecision 19 | system/bin/netmgrd 20 | system/bin/nl_listener 21 | system/bin/port-bridge 22 | system/bin/qcks 23 | system/bin/qmuxd 24 | system/bin/qseecomd 25 | system/bin/radish 26 | system/bin/rmt_storage 27 | system/bin/sensors.qcom 28 | system/bin/thermald 29 | system/bin/usbhub 30 | system/bin/usbhub_init 31 | system/etc/DxHDCP.cfg 32 | system/etc/firmware/vidc_1080p.fw 33 | system/etc/firmware/vidc.b00 34 | system/etc/firmware/vidc.b01 35 | system/etc/firmware/vidc.b02 36 | system/etc/firmware/vidc.b03 37 | system/etc/firmware/vidcfw.elf 38 | system/etc/firmware/vidc.mdt 39 | system/etc/gps.conf 40 | system/lib/hw/flp.msm8960.so 41 | system/lib/hw/gps.msm8960.so 42 | system/lib/hw/sensors.msm8960.so 43 | system/lib/libacdbdata.so 44 | # system/lib/libacdbloader.so --> libacdbloader.mk 45 | system/lib/libAKM.so 46 | system/lib/libaudcal.so 47 | system/lib/libaudioalsa.so 48 | system/lib/libchromatix_ov5693_common.so 49 | system/lib/libchromatix_ov5693_default_video.so 50 | system/lib/libchromatix_ov5693_preview.so 51 | system/lib/libCommandSvc.so 52 | system/lib/libconfigdb.so 53 | system/lib/libcsd-client.so 54 | system/lib/libdiag.so 55 | system/lib/libdrmdiag.so 56 | system/lib/libdrmfs.so 57 | system/lib/libdrmtime.so 58 | system/lib/libdsi_netctrl.so 59 | system/lib/libdsprofile.so 60 | system/lib/libdss.so 61 | system/lib/libdsucsd.so 62 | system/lib/libdsutils.so 63 | system/lib/libgps.utils.so 64 | system/lib/libI420colorconvert.so 65 | system/lib/libidl.so 66 | system/lib/libloc_core.so 67 | system/lib/libloc_eng.so 68 | system/lib/libmm-abl.so 69 | system/lib/libmmcamera2_stats_algorithm.so 70 | system/lib/libmmcamera_image_stab.so 71 | system/lib/libmmcamera_mi1040.so 72 | system/lib/libmmcamera_ov5693.so 73 | system/lib/libmm-color-convertor.so 74 | system/lib/libnetmgr.so 75 | system/lib/liboemcrypto.so 76 | system/lib/libqcci_legacy.so 77 | system/lib/libqdi.so 78 | system/lib/libqdp.so 79 | system/lib/libqmi_cci.so 80 | system/lib/libqmi_client_qmux.so 81 | system/lib/libqmi_common_so.so 82 | system/lib/libqmi_csi.so 83 | system/lib/libqmi_csvt_srvc.so 84 | system/lib/libqmi_encdec.so 85 | system/lib/libqmiservices.so 86 | system/lib/libqmi.so 87 | system/lib/libQSEEComAPI.so 88 | system/lib/libsensor1.so 89 | system/lib/libsensor_reg.so 90 | system/lib/libsensor_user_cal.so 91 | system/lib/libstagefright_hdcp.so 92 | system/lib/libxml.so 93 | system/vendor/firmware/a300_pfp.fw 94 | system/vendor/firmware/a300_pm4.fw 95 | system/vendor/firmware/bcm2079x-b5_firmware.ncd 96 | system/vendor/firmware/bcm2079x-b5_pre_firmware.ncd 97 | system/vendor/firmware/discretix/dxhdcp2.b00 98 | system/vendor/firmware/discretix/dxhdcp2.b01 99 | system/vendor/firmware/discretix/dxhdcp2.b02 100 | system/vendor/firmware/discretix/dxhdcp2.b03 101 | system/vendor/firmware/discretix/dxhdcp2.mdt 102 | system/vendor/firmware/dsps.b00 103 | system/vendor/firmware/dsps.b01 104 | system/vendor/firmware/dsps.b02 105 | system/vendor/firmware/dsps.b03 106 | system/vendor/firmware/dsps.b04 107 | system/vendor/firmware/dsps.b05 108 | system/vendor/firmware/dsps.mdt 109 | system/vendor/firmware/gss.b00 110 | system/vendor/firmware/gss.b01 111 | system/vendor/firmware/gss.b02 112 | system/vendor/firmware/gss.b03 113 | system/vendor/firmware/gss.b04 114 | system/vendor/firmware/gss.b05 115 | system/vendor/firmware/gss.b06 116 | system/vendor/firmware/gss.b07 117 | system/vendor/firmware/gss.b08 118 | system/vendor/firmware/gss.b09 119 | system/vendor/firmware/gss.b10 120 | system/vendor/firmware/gss.b11 121 | system/vendor/firmware/gss.mdt 122 | system/vendor/firmware/keymaster/keymaster.b00 123 | system/vendor/firmware/keymaster/keymaster.b01 124 | system/vendor/firmware/keymaster/keymaster.b02 125 | system/vendor/firmware/keymaster/keymaster.b03 126 | system/vendor/firmware/keymaster/keymaster.mdt 127 | system/vendor/firmware/q6.b00 128 | system/vendor/firmware/q6.b01 129 | system/vendor/firmware/q6.b03 130 | system/vendor/firmware/q6.b04 131 | system/vendor/firmware/q6.b05 132 | system/vendor/firmware/q6.b06 133 | system/vendor/firmware/q6.mdt 134 | system/vendor/firmware/tzapps.b00 135 | system/vendor/firmware/tzapps.b01 136 | system/vendor/firmware/tzapps.b02 137 | system/vendor/firmware/tzapps.b03 138 | # system/vendor/firmware/tzapps.mdt --> tzapps.mdt.mk 139 | system/vendor/firmware/wcnss.b00 140 | system/vendor/firmware/wcnss.b01 141 | system/vendor/firmware/wcnss.b02 142 | system/vendor/firmware/wcnss.b04 143 | system/vendor/firmware/wcnss.b05 144 | system/vendor/firmware/wcnss.mdt 145 | system/vendor/lib/egl/eglsubAndroid.so 146 | system/vendor/lib/egl/libEGL_adreno.so 147 | system/vendor/lib/egl/libGLESv1_CM_adreno.so 148 | system/vendor/lib/egl/libGLESv2_adreno.so 149 | system/vendor/lib/egl/libplayback_adreno.so 150 | system/vendor/lib/egl/libq3dtools_adreno.so 151 | system/vendor/lib/libadreno_utils.so 152 | system/vendor/lib/libbccQTI.so 153 | system/vendor/lib/libC2D2.so 154 | system/vendor/lib/libc2d30-a3xx.so 155 | system/vendor/lib/libc2d30.so 156 | system/vendor/lib/libCB.so 157 | system/vendor/lib/libdrmdecrypt.so 158 | system/vendor/lib/libgemini.so 159 | system/vendor/lib/libgeofence.so 160 | system/vendor/lib/libgsl.so 161 | system/vendor/lib/libimage-jpeg-enc-omx-comp.so 162 | system/vendor/lib/libimage-omx-common.so 163 | system/vendor/lib/libizat_core.so 164 | system/vendor/lib/libllvm-qcom.so 165 | system/vendor/lib/libloc_api_v02.so 166 | system/vendor/lib/libloc_ds_api.so 167 | system/vendor/lib/libmmcamera2_c2d_module.so 168 | system/vendor/lib/libmmcamera2_cpp_module.so 169 | system/vendor/lib/libmmcamera2_iface_modules.so 170 | system/vendor/lib/libmmcamera2_imglib_modules.so 171 | system/vendor/lib/libmmcamera2_isp_modules.so 172 | system/vendor/lib/libmmcamera2_pproc_modules.so 173 | system/vendor/lib/libmmcamera2_sensor_modules.so 174 | system/vendor/lib/libmmcamera2_stats_modules.so 175 | system/vendor/lib/libmmcamera2_vpe_module.so 176 | system/vendor/lib/libmmcamera2_wnr_module.so 177 | system/vendor/lib/libmmcamera_faceproc.so 178 | system/vendor/lib/libmmcamera_imglib.so 179 | system/vendor/lib/libmmipl.so 180 | system/vendor/lib/libmmjpeg.so 181 | system/vendor/lib/libmmqjpeg_codec.so 182 | system/vendor/lib/libmmstillomx.so 183 | system/vendor/lib/liboemcamera.so 184 | system/vendor/lib/libqomx_jpegenc.so 185 | system/vendor/lib/librs_adreno_sha1.so 186 | system/vendor/lib/librs_adreno.so 187 | system/vendor/lib/libRSDriver_adreno.so 188 | system/vendor/lib/libsc-a3xx.so 189 | -------------------------------------------------------------------------------- /asus/flo/tzapps.mdt.mk: -------------------------------------------------------------------------------- 1 | # Copyright 2013 The Android Open Source Project 2 | # Copyright 2017 Preetam J. D'Souza 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | ifeq ($(TARGET_DEVICE),flo) 17 | include $(CLEAR_VARS) 18 | LOCAL_MODULE := tzapps.mdt 19 | LOCAL_MODULE_OWNER := asus 20 | LOCAL_SRC_FILES := system/vendor/firmware/tzapps.mdt 21 | LOCAL_MODULE_TAGS := optional 22 | LOCAL_MODULE_CLASS := ETC 23 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/firmware 24 | 25 | LOCAL_POST_INSTALL_CMD := \ 26 | mkdir -p $(TARGET_OUT)/etc/firmware/; \ 27 | ln -sf /system/vendor/firmware/tzapps.b00 $(TARGET_OUT)/etc/firmware/tzapps.b00; \ 28 | ln -sf /system/vendor/firmware/tzapps.b01 $(TARGET_OUT)/etc/firmware/tzapps.b01; \ 29 | ln -sf /system/vendor/firmware/tzapps.b02 $(TARGET_OUT)/etc/firmware/tzapps.b02; \ 30 | ln -sf /system/vendor/firmware/tzapps.b03 $(TARGET_OUT)/etc/firmware/tzapps.b03; \ 31 | ln -sf /system/vendor/firmware/tzapps.mdt $(TARGET_OUT)/etc/firmware/tzapps.mdt; 32 | 33 | include $(BUILD_PREBUILT) 34 | endif 35 | -------------------------------------------------------------------------------- /bytecode.sh: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017 Preetam J. D'Souza 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | # bytecode utilities 18 | 19 | bytecode_is_optimized () { 20 | local readonly bytecode="$1" 21 | 22 | # optimized bytecode modules do not have classes.dex 23 | return $(unzip -l "$bytecode" | grep -e "classes[[:digit:]]*.dex" | wc -l) 24 | } 25 | 26 | bytecode_deodex () { 27 | local readonly bytecode="$1" 28 | local readonly deodexed_bytecode="$2" 29 | local readonly boot_oat="$3" 30 | local readonly output_dir="${4:-smali}" 31 | 32 | local readonly bytecode_dirname="$(dirname "$bytecode")" 33 | local readonly bytecode_basename="$(basename "$bytecode")" 34 | local readonly bytecode_name="${bytecode_basename%.*}" 35 | local readonly bytecode_odex="$(find "$bytecode_dirname" -name "${bytecode_name}.odex")" 36 | local readonly bytecode_smali_dir="${output_dir}/${bytecode_name}" 37 | 38 | # de-optimize .odex -> .dex, and disassemble 39 | baksmali deodex "$bytecode_odex" -b "$boot_oat" -o "$bytecode_smali_dir" 40 | 41 | # v2.1.0 42 | #"$BAKSMALI" -x -c boot.oat -d "$(dirname "$boot_oat")" "$bytecode_odex" -o "$bytecode_smali_dir" 43 | 44 | # assemble back into classes.dex 45 | smali assemble "$bytecode_smali_dir" -o "${bytecode_smali_dir}/classes.dex" 46 | 47 | # v2.1.0 48 | #"$SMALI" "$bytecode_smali_dir" -o "${bytecode_smali_dir}/classes.dex" 49 | 50 | # re-pack bytecode with classes.dex 51 | mkdir -p "$(dirname "$deodexed_bytecode")" 52 | cp "$bytecode" "$deodexed_bytecode" 53 | zip -gj "$deodexed_bytecode" "${bytecode_smali_dir}/classes.dex" >/dev/null 54 | } 55 | -------------------------------------------------------------------------------- /deps/bin/simg2img: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdsouza/android-generate-vendor/787ac54924e31ca5dd83f79a7a293cd149147183/deps/bin/simg2img -------------------------------------------------------------------------------- /deps/jar/baksmali: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (C) 2007 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 | # As per the Apache license requirements, this file has been modified 18 | # from its original state. 19 | # 20 | # Such modifications are Copyright (C) 2010 Ben Gruver, and are released 21 | # under the original license 22 | 23 | # This script is a wrapper around baksmali.jar, so you can simply call 24 | # "baksmali", instead of java -jar baksmali.jar. It is heavily based on 25 | # the "dx" script from the Android SDK 26 | 27 | # Set up prog to be the path of this script, including following symlinks, 28 | # and set up progdir to be the fully-qualified pathname of its directory. 29 | prog="$0" 30 | while [ -h "${prog}" ]; do 31 | newProg=`/bin/ls -ld "${prog}"` 32 | newProg=`expr "${newProg}" : ".* -> \(.*\)$"` 33 | if expr "x${newProg}" : 'x/' >/dev/null; then 34 | prog="${newProg}" 35 | else 36 | progdir=`dirname "${prog}"` 37 | prog="${progdir}/${newProg}" 38 | fi 39 | done 40 | oldwd=`pwd` 41 | progdir=`dirname "${prog}"` 42 | cd "${progdir}" 43 | progdir=`pwd` 44 | prog="${progdir}"/`basename "${prog}"` 45 | cd "${oldwd}" 46 | 47 | 48 | jarfile=baksmali.jar 49 | libdir="$progdir" 50 | if [ ! -r "$libdir/$jarfile" ] 51 | then 52 | echo `basename "$prog"`": can't find $jarfile" 53 | exit 1 54 | fi 55 | 56 | javaOpts="" 57 | 58 | # If you want DX to have more memory when executing, uncomment the following 59 | # line and adjust the value accordingly. Use "java -X" for a list of options 60 | # you can pass here. 61 | # 62 | javaOpts="-Xmx256M" 63 | 64 | # Alternatively, this will extract any parameter "-Jxxx" from the command line 65 | # and pass them to Java (instead of to dx). This makes it possible for you to 66 | # add a command-line parameter such as "-JXmx256M" in your ant scripts, for 67 | # example. 68 | while expr "x$1" : 'x-J' >/dev/null; do 69 | opt=`expr "$1" : '-J\(.*\)'` 70 | javaOpts="${javaOpts} -${opt}" 71 | shift 72 | done 73 | 74 | if [ "$OSTYPE" = "cygwin" ] ; then 75 | jarpath=`cygpath -w "$libdir/$jarfile"` 76 | else 77 | jarpath="$libdir/$jarfile" 78 | fi 79 | 80 | exec java $javaOpts -jar "$jarpath" "$@" 81 | -------------------------------------------------------------------------------- /deps/jar/baksmali.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdsouza/android-generate-vendor/787ac54924e31ca5dd83f79a7a293cd149147183/deps/jar/baksmali.jar -------------------------------------------------------------------------------- /deps/jar/smali: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (C) 2007 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 | # As per the Apache license requirements, this file has been modified 18 | # from its original state. 19 | # 20 | # Such modifications are Copyright (C) 2010 Ben Gruver, and are released 21 | # under the original license 22 | 23 | # This script is a wrapper for smali.jar, so you can simply call "smali", 24 | # instead of java -jar smali.jar. It is heavily based on the "dx" script 25 | # from the Android SDK 26 | 27 | # Set up prog to be the path of this script, including following symlinks, 28 | # and set up progdir to be the fully-qualified pathname of its directory. 29 | prog="$0" 30 | while [ -h "${prog}" ]; do 31 | newProg=`/bin/ls -ld "${prog}"` 32 | newProg=`expr "${newProg}" : ".* -> \(.*\)$"` 33 | if expr "x${newProg}" : 'x/' >/dev/null; then 34 | prog="${newProg}" 35 | else 36 | progdir=`dirname "${prog}"` 37 | prog="${progdir}/${newProg}" 38 | fi 39 | done 40 | oldwd=`pwd` 41 | progdir=`dirname "${prog}"` 42 | cd "${progdir}" 43 | progdir=`pwd` 44 | prog="${progdir}"/`basename "${prog}"` 45 | cd "${oldwd}" 46 | 47 | 48 | jarfile=smali.jar 49 | libdir="$progdir" 50 | if [ ! -r "$libdir/$jarfile" ] 51 | then 52 | echo `basename "$prog"`": can't find $jarfile" 53 | exit 1 54 | fi 55 | 56 | javaOpts="" 57 | 58 | # If you want DX to have more memory when executing, uncomment the following 59 | # line and adjust the value accordingly. Use "java -X" for a list of options 60 | # you can pass here. 61 | # 62 | javaOpts="-Xmx512M" 63 | 64 | # Alternatively, this will extract any parameter "-Jxxx" from the command line 65 | # and pass them to Java (instead of to dx). This makes it possible for you to 66 | # add a command-line parameter such as "-JXmx256M" in your ant scripts, for 67 | # example. 68 | while expr "x$1" : 'x-J' >/dev/null; do 69 | opt=`expr "$1" : '-J\(.*\)'` 70 | javaOpts="${javaOpts} -${opt}" 71 | shift 72 | done 73 | 74 | if [ "$OSTYPE" = "cygwin" ] ; then 75 | jarpath=`cygpath -w "$libdir/$jarfile"` 76 | else 77 | jarpath="$libdir/$jarfile" 78 | fi 79 | 80 | exec java $javaOpts -jar "$jarpath" "$@" 81 | -------------------------------------------------------------------------------- /deps/jar/smali.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdsouza/android-generate-vendor/787ac54924e31ca5dd83f79a7a293cd149147183/deps/jar/smali.jar -------------------------------------------------------------------------------- /generate-vendor.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright 2017 Preetam J. D'Souza 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 | 18 | set -e 19 | set -u 20 | 21 | source bytecode.sh 22 | source mk.sh 23 | source log.sh 24 | 25 | readonly SCRIPT_NAME="$(basename "$0")" 26 | readonly SCRIPT_DIR="$(readlink -f $(dirname "$0"))" 27 | 28 | # included dependencies 29 | readonly SIMG2IMG="${SCRIPT_DIR}/deps/bin/simg2img" 30 | 31 | # some useful paths -- all relative to $WORKDIR 32 | readonly TMP_DIR="tmp" 33 | readonly IMAGE_DIR="${TMP_DIR}/factory" 34 | readonly SMALI_TMP_DIR="${TMP_DIR}/smali" 35 | readonly VENDOR_MK="device-vendor.mk" 36 | readonly BLOBS_MK="device-partial.mk" 37 | readonly MODULES_MK="Android.mk" 38 | readonly CHECKSUMS="sha1sums.txt" 39 | 40 | # globals 41 | VENDOR="" 42 | BLOBS="" 43 | VENDOR_DIR="" 44 | DEVICE_DIR="" 45 | WORKDIR="" 46 | 47 | # user options 48 | OPT_DEVICE="" 49 | OPT_IMAGE="" 50 | OPT_OUT="." 51 | OPT_INSPECT=false 52 | 53 | help () { 54 | cat </dev/null 69 | [ "$OPT_INSPECT" = true ] || rm -rf "$TMP_DIR" 70 | } 71 | 72 | extract_file () { 73 | local readonly file="$1" 74 | local readonly dest="$2" 75 | 76 | mkdir -p "$(dirname "$dest")" 77 | cp "$file" "$dest" 78 | } 79 | 80 | extract_bytecode () { 81 | local readonly bytecode="$1" 82 | local readonly dest="$2" 83 | 84 | if bytecode_is_optimized "$bytecode" ; then 85 | iecho " de-optimizing $dest..." 86 | PATH="${SCRIPT_DIR}/deps/jar:${PATH}" bytecode_deodex \ 87 | "$bytecode" "$dest" "${IMAGE_DIR}/system/framework/arm/boot.oat" "${TMP_DIR}/smali" 88 | else 89 | # just mirror the un-optimized apk over exactly 90 | extract_file "$bytecode" "$dest" 91 | fi 92 | } 93 | 94 | extract_blob () { 95 | local readonly blob="$1" 96 | local readonly dest="$2" 97 | 98 | local readonly blob_extension="${blob##*.}" 99 | 100 | case "$blob_extension" in 101 | apk) 102 | extract_bytecode "$blob" "$dest" 103 | mk_add_apk "$dest" "$VENDOR" "$OPT_DEVICE" 104 | ;; 105 | jar) 106 | extract_bytecode "$blob" "$dest" 107 | mk_add_jar "$dest" "$VENDOR" "$OPT_DEVICE" 108 | ;; 109 | *) 110 | extract_file "$blob" "$dest" 111 | mk_mirror_file "$dest" "$VENDOR" 112 | ;; 113 | esac 114 | } 115 | 116 | while [ $# -gt 0 ]; do 117 | case "$1" in 118 | -d|--device) OPT_DEVICE="$2"; shift 2 ;; 119 | -i|--image) OPT_IMAGE="$2"; shift 2 ;; 120 | -o|--out) OPT_OUT="$2"; shift 2 ;; 121 | --inspect) OPT_INSPECT=true; shift ;; 122 | -h|--help) help; exit 2 ;; 123 | --) shift; break ;; 124 | -*) fecho "unrecognized option $1"; exit 2 ;; 125 | *) break; 126 | esac 127 | done 128 | 129 | VENDOR="$(find "$SCRIPT_DIR" -type d -name "$OPT_DEVICE" | xargs -r dirname | xargs -r basename)" 130 | if [ -z "$VENDOR" ] ; then 131 | fecho "invalid device: '$OPT_DEVICE'" 132 | exit 2 133 | fi 134 | 135 | if [ ! -f "$OPT_IMAGE" ] ; then 136 | fecho "invalid image file: '$OPT_IMAGE'" 137 | exit 2 138 | fi 139 | 140 | VENDOR_DIR="vendor/${VENDOR}/${OPT_DEVICE}" 141 | DEVICE_DIR="${SCRIPT_DIR}/${VENDOR}/${OPT_DEVICE}" 142 | BLOBS="${DEVICE_DIR}/proprietary-blobs.txt" 143 | WORKDIR="${OPT_OUT}/${VENDOR_DIR}" 144 | 145 | 146 | iecho "setting up output dir '$WORKDIR'..." 147 | mkdir -p "$WORKDIR" 148 | pushd "$WORKDIR" &>/dev/null 149 | 150 | trap cleanup EXIT 151 | 152 | iecho "preparing factory image..." 153 | mkdir -p "$IMAGE_DIR" 154 | unzip -j "$OPT_IMAGE" -d "$IMAGE_DIR" >/dev/null 155 | pushd "$IMAGE_DIR" &>/dev/null 156 | unzip image-*.zip system.img >/dev/null 157 | "$SIMG2IMG" system.img system-raw.img 158 | mkdir system 159 | wecho " requesting sudo for loop mount..." 160 | sudo mount -o loop system-raw.img system 161 | popd &>/dev/null 162 | 163 | iecho "generating vendor makefiles..." 164 | mk_init "$VENDOR_DIR" 165 | 166 | iecho "extracting vendor files from image..." 167 | for blob in $(grep -v "#" < "$BLOBS") ; do # skips empty lines 168 | image_blob="${IMAGE_DIR}/${blob}" 169 | [ -f "$image_blob" ] || { 170 | wecho " missing file from image: $blob" 171 | continue 172 | } 173 | 174 | extract_blob "$image_blob" "$blob" 175 | done 176 | 177 | custom_modules=$(find "$DEVICE_DIR" -type f -name "*.mk") 178 | for module in $custom_modules ; do 179 | blob="$(grep LOCAL_SRC_FILES "$module" | cut -d ' ' -f 3)" 180 | image_blob="${IMAGE_DIR}/${blob}" 181 | 182 | iecho " extracting custom module $blob..." 183 | 184 | extract_file "$image_blob" "$blob" 185 | mk_add_custom_module "$module" 186 | done 187 | 188 | iecho "calculating checksums..." 189 | { 190 | echo "# $(basename "$OPT_IMAGE")" 191 | find -xdev ! -path "./$TMP_DIR*" ! -path "./$CHECKSUMS" -type f | sort | xargs sha1sum 192 | } > "$CHECKSUMS" 193 | 194 | iecho "all tasks completed successfully" 195 | -------------------------------------------------------------------------------- /lge/hammerhead/libacdbloader.mk: -------------------------------------------------------------------------------- 1 | # Copyright 2013 The Android Open Source Project 2 | # Copyright 2017 Preetam J. D'Souza 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | ifeq ($(TARGET_DEVICE),hammerhead) 17 | include $(CLEAR_VARS) 18 | LOCAL_MODULE := libacdbloader 19 | LOCAL_SRC_FILES := system/vendor/lib/libacdbloader.so 20 | LOCAL_MODULE_SUFFIX := .so 21 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES 22 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/lib 23 | LOCAL_MODULE_TAGS := optional 24 | LOCAL_MODULE_OWNER := lge 25 | 26 | # Create symbolic link because user space can access persist directory, 27 | # while kernel ALSA drivers can only access the /system/etc/firmware directory 28 | LOCAL_POST_INSTALL_CMD := \ 29 | mkdir -p $(TARGET_OUT_ETC)/firmware/wcd9320; \ 30 | ln -sf /data/misc/audio/wcd9320_anc.bin \ 31 | $(TARGET_OUT_ETC)/firmware/wcd9320/wcd9320_anc.bin; \ 32 | ln -sf /data/misc/audio/mbhc.bin \ 33 | $(TARGET_OUT_ETC)/firmware/wcd9320/wcd9320_mbhc.bin 34 | 35 | include $(BUILD_PREBUILT) 36 | endif 37 | -------------------------------------------------------------------------------- /lge/hammerhead/proprietary-blobs.txt: -------------------------------------------------------------------------------- 1 | # ----------------------------------------------------------------------------- 2 | # Bytecode 3 | 4 | # apps 5 | system/app/qcrilmsgtunnel/qcrilmsgtunnel.apk 6 | system/app/shutdownlistener/shutdownlistener.apk 7 | system/app/TimeService/TimeService.apk 8 | system/app/UpdateSetting/UpdateSetting.apk 9 | 10 | # priv-apps 11 | system/priv-app/OmaDmclient/OmaDmclient.apk 12 | system/priv-app/SprintHiddenMenu/SprintHiddenMenu.apk 13 | 14 | # libs 15 | system/framework/qcrilhook.jar 16 | system/framework/serviceitems.jar 17 | 18 | # ----------------------------------------------------------------------------- 19 | # Blobs - based on device/lge/hammerhead/proprietary-blobs.txt 20 | 21 | system/bin/bridgemgrd 22 | system/bin/diag_klog 23 | system/bin/diag_mdlog 24 | system/bin/ds_fmc_appd 25 | system/bin/irsc_util 26 | system/bin/mm-qcamera-daemon 27 | system/bin/mpdecision 28 | system/bin/netmgrd 29 | system/bin/nl_listener 30 | system/bin/port-bridge 31 | system/bin/qmuxd 32 | system/bin/qseecomd 33 | system/bin/radish 34 | system/bin/rmt_storage 35 | system/bin/sensors.qcom 36 | system/bin/subsystem_ramdump 37 | system/bin/thermal-engine-hh 38 | system/bin/time_daemon 39 | system/bin/usbhub 40 | system/bin/usbhub_init 41 | system/etc/acdbdata/MTP/MTP_Bluetooth_cal.acdb 42 | system/etc/firmware/cpp_firmware_v1_1_1.fw 43 | system/etc/firmware/cpp_firmware_v1_1_6.fw 44 | system/etc/firmware/cpp_firmware_v1_2_0.fw 45 | system/etc/acdbdata/MTP/MTP_General_cal.acdb 46 | system/etc/acdbdata/MTP/MTP_Global_cal.acdb 47 | system/etc/acdbdata/MTP/MTP_Handset_cal.acdb 48 | system/etc/acdbdata/MTP/MTP_Hdmi_cal.acdb 49 | system/etc/acdbdata/MTP/MTP_Headset_cal.acdb 50 | system/etc/permissions/qcrilhook.xml 51 | system/etc/qcril.db 52 | system/etc/sensor_def_hh.conf 53 | system/etc/acdbdata/MTP/MTP_Speaker_cal.acdb 54 | system/lib/hw/flp.msm8974.so 55 | system/lib/hw/gps.msm8974.so 56 | system/lib/libadsprpc.so 57 | system/lib/libchromatix_imx179_common.so 58 | system/lib/libchromatix_imx179_default_video.so 59 | system/lib/libchromatix_imx179_preview.so 60 | system/lib/libchromatix_imx179_snapshot.so 61 | system/lib/libchromatix_mt9m114b_common.so 62 | system/lib/libchromatix_mt9m114b_default_video.so 63 | system/lib/libchromatix_mt9m114b_preview.so 64 | system/lib/libchromatix_mt9m114b_snapshot.so 65 | system/lib/libdrmdiag.so 66 | system/lib/libdrmfs.so 67 | system/lib/libdrmtime.so 68 | system/lib/libgps.utils.so 69 | system/lib/libI420colorconvert.so 70 | system/lib/libloc_core.so 71 | system/lib/libloc_eng.so 72 | system/lib/libmm-abl.so 73 | system/lib/libmm-color-convertor.so 74 | system/lib/libmmcamera_hdr_lib.so 75 | system/lib/libmmcamera_image_stab.so 76 | system/lib/libmmcamera_imx179.so 77 | system/lib/libmmcamera_mt9m114b.so 78 | system/lib/libmmcamera_wavelet_lib.so 79 | system/lib/libmmQSM.so 80 | system/lib/liboemcrypto.so 81 | system/lib/libQSEEComAPI.so 82 | system/lib/libril-qc-qmi-1.so 83 | system/lib/libstagefright_hdcp.so 84 | system/lib/libxml.so 85 | system/vendor/bin/vss_init 86 | system/vendor/firmware/a330_pfp.fw 87 | system/vendor/firmware/a330_pm4.fw 88 | system/vendor/firmware/adsp.b00 89 | system/vendor/firmware/adsp.b01 90 | system/vendor/firmware/adsp.b02 91 | system/vendor/firmware/adsp.b03 92 | system/vendor/firmware/adsp.b04 93 | system/vendor/firmware/adsp.b05 94 | system/vendor/firmware/adsp.b06 95 | system/vendor/firmware/adsp.b07 96 | system/vendor/firmware/adsp.b08 97 | system/vendor/firmware/adsp.b09 98 | system/vendor/firmware/adsp.b10 99 | system/vendor/firmware/adsp.b11 100 | system/vendor/firmware/adsp.b12 101 | system/vendor/firmware/adsp.mdt 102 | system/vendor/firmware/bcm2079x-b5_firmware.ncd 103 | system/vendor/firmware/bcm2079x-b5_pre_firmware.ncd 104 | system/vendor/firmware/bcm4335c0.hcd 105 | system/vendor/firmware/bu24205_LGIT_VER_2_DATA1.bin 106 | system/vendor/firmware/bu24205_LGIT_VER_2_DATA2.bin 107 | system/vendor/firmware/bu24205_LGIT_VER_2_DATA3.bin 108 | system/vendor/firmware/bu24205_LGIT_VER_3_CAL.bin 109 | system/vendor/firmware/bu24205_LGIT_VER_3_DATA1.bin 110 | system/vendor/firmware/bu24205_LGIT_VER_3_DATA2.bin 111 | system/vendor/firmware/bu24205_LGIT_VER_3_DATA3.bin 112 | system/vendor/firmware/cmnlib.b00 113 | system/vendor/firmware/cmnlib.b01 114 | system/vendor/firmware/cmnlib.b02 115 | system/vendor/firmware/cmnlib.b03 116 | system/vendor/firmware/cmnlib.mdt 117 | system/vendor/firmware/keymaster/keymaster.b00 118 | system/vendor/firmware/keymaster/keymaster.b01 119 | system/vendor/firmware/keymaster/keymaster.b02 120 | system/vendor/firmware/keymaster/keymaster.b03 121 | system/vendor/firmware/keymaster/keymaster.mdt 122 | system/vendor/firmware/venus.b00 123 | system/vendor/firmware/venus.b01 124 | system/vendor/firmware/venus.b02 125 | system/vendor/firmware/venus.b03 126 | system/vendor/firmware/venus.b04 127 | system/vendor/firmware/venus.mdt 128 | system/vendor/lib/egl/eglsubAndroid.so 129 | system/vendor/lib/egl/libEGL_adreno.so 130 | system/vendor/lib/egl/libGLESv1_CM_adreno.so 131 | system/vendor/lib/egl/libGLESv2_adreno.so 132 | system/vendor/lib/egl/libplayback_adreno.so 133 | system/vendor/lib/egl/libq3dtools_adreno.so 134 | system/vendor/lib/hw/sensors.msm8974.so 135 | # system/vendor/lib/libacdbloader.so --> libacdbloader.mk 136 | system/vendor/lib/libacdbrtac.so 137 | system/vendor/lib/libadiertac.so 138 | system/vendor/lib/libadreno_utils.so 139 | system/vendor/lib/libAKM8963.so 140 | system/vendor/lib/libaudcal.so 141 | system/vendor/lib/libC2D2.so 142 | system/vendor/lib/libc2d30-a3xx.so 143 | system/vendor/lib/libc2d30.so 144 | system/vendor/lib/libCB.so 145 | system/vendor/lib/libCommandSvc.so 146 | system/vendor/lib/libconfigdb.so 147 | system/vendor/lib/libdiag.so 148 | system/vendor/lib/libdrmdecrypt.so 149 | system/vendor/lib/libdsi_netctrl.so 150 | system/vendor/lib/libdsutils.so 151 | system/vendor/lib/libFuzzmmstillomxenc.so 152 | system/vendor/lib/libgeofence.so 153 | system/vendor/lib/libgsl.so 154 | system/vendor/lib/libidl.so 155 | system/vendor/lib/libizat_core.so 156 | system/vendor/lib/libjpegdhw.so 157 | system/vendor/lib/libjpegehw.so 158 | system/vendor/lib/libllvm-qcom.so 159 | system/vendor/lib/libbccQTI.so 160 | system/vendor/lib/libloc_api_v02.so 161 | system/vendor/lib/libloc_ds_api.so 162 | system/vendor/lib/libmmcamera2_c2d_module.so 163 | system/vendor/lib/libmmcamera2_cpp_module.so 164 | system/vendor/lib/libmmcamera2_iface_modules.so 165 | system/vendor/lib/libmmcamera2_imglib_modules.so 166 | system/vendor/lib/libmmcamera2_isp_modules.so 167 | system/vendor/lib/libmmcamera2_pproc_modules.so 168 | system/vendor/lib/libmmcamera2_sensor_modules.so 169 | system/vendor/lib/libmmcamera2_stats_algorithm.so 170 | system/vendor/lib/libmmcamera2_stats_modules.so 171 | system/vendor/lib/libmmcamera2_vpe_module.so 172 | system/vendor/lib/libmmcamera2_wnr_module.so 173 | system/vendor/lib/libmmcamera_faceproc.so 174 | system/vendor/lib/libmmcamera_imglib.so 175 | system/vendor/lib/libmmcamera_imx179_eeprom.so 176 | system/vendor/lib/libmmipl.so 177 | system/vendor/lib/libmmjpeg.so 178 | system/vendor/lib/libmmqjpeg_codec.so 179 | system/vendor/lib/libnetmgr.so 180 | system/vendor/lib/liboemcamera.so 181 | system/vendor/lib/libqcci_legacy.so 182 | system/vendor/lib/libqdi.so 183 | system/vendor/lib/libqdp.so 184 | system/vendor/lib/libqmi.so 185 | system/vendor/lib/libqmiservices.so 186 | system/vendor/lib/libqmi_cci.so 187 | system/vendor/lib/libqmi_client_qmux.so 188 | system/vendor/lib/libqmi_common_so.so 189 | system/vendor/lib/libqmi_csi.so 190 | system/vendor/lib/libqmi_encdec.so 191 | system/vendor/lib/libqomx_jpegenc.so 192 | system/vendor/lib/libril-qcril-hook-oem.so 193 | system/vendor/lib/libRSDriver_adreno.so 194 | system/vendor/lib/librs_adreno.so 195 | system/vendor/lib/librs_adreno_sha1.so 196 | system/vendor/lib/libsc-a3xx.so 197 | system/vendor/lib/libsensor1.so 198 | system/vendor/lib/libsensor_reg.so 199 | system/vendor/lib/libsensor_user_cal.so 200 | system/vendor/lib/libTimeService.so 201 | system/vendor/lib/libtime_genoff.so 202 | system/vendor/lib/libvss_common_core.so 203 | system/vendor/lib/libvss_common_idl.so 204 | system/vendor/lib/libvss_common_iface.so 205 | system/vendor/lib/libvss_nv_core.so 206 | system/vendor/lib/libvss_nv_idl.so 207 | system/vendor/lib/libvss_nv_iface.so 208 | 209 | # ----------------------------------------------------------------------------- 210 | # Missing blobs from nexus binaries 211 | 212 | # needed for serviceitems.jar 213 | system/etc/permissions/serviceitems.xml 214 | 215 | # needed for qseecomd 216 | system/lib/librpmb.so 217 | system/lib/libssd.so 218 | 219 | # needed for thermal-engine 220 | system/vendor/lib/libthermalioctl.so 221 | -------------------------------------------------------------------------------- /log.sh: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017 Preetam J. D'Souza 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | # logging utilities 18 | 19 | readonly TCOL_RED="$(tput setaf 1)" 20 | readonly TCOL_GREEN="$(tput setaf 2)" 21 | readonly TCOL_YELLOW="$(tput setaf 3)" 22 | readonly TCOL_DEF="$(tput op)" 23 | 24 | iecho () { echo "${TCOL_GREEN}I${TCOL_DEF}: $@"; } 25 | decho () { echo "D: $@"; } 26 | wecho () { echo "${TCOL_YELLOW}W${TCOL_DEF}: $@"; } 27 | fecho () { echo >&2 "${TCOL_RED}E${TCOL_DEF}: $@"; } 28 | -------------------------------------------------------------------------------- /mk.sh: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017 Preetam J. D'Souza 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | # Android.mk utilities 18 | 19 | readonly _VENDOR_MK="device-vendor.mk" 20 | readonly _BLOBS_MK="device-partial.mk" 21 | readonly _MODULES_MK="Android.mk" 22 | 23 | _VENDOR_DIR="" 24 | 25 | _mk_echo_autogen_header () { 26 | # TODO define $SCRIPT_NAME 27 | echo "# $(date --rfc-3339=date): autogenerated by $SCRIPT_NAME - DO NOT EDIT" 28 | } 29 | 30 | _mk_init_vendor_mk () { 31 | local readonly vendor_dir="$1" 32 | 33 | cat > "$_VENDOR_MK" < "$_MODULES_MK" < "$_BLOBS_MK" <> "$_VENDOR_MK" 62 | } 63 | 64 | _mk_is_priv_apk () { 65 | local path="$1" 66 | echo "$path" | grep -q 'priv-app' 67 | } 68 | 69 | 70 | mk_init () { 71 | local readonly vendor_dir="$1" 72 | 73 | _VENDOR_DIR="$vendor_dir" 74 | _mk_init_vendor_mk "$vendor_dir" 75 | _mk_init_blobs_mk 76 | } 77 | 78 | _mk_add_apk () { 79 | local readonly apk="$1" 80 | local readonly owner="$2" 81 | local readonly device="$3" 82 | 83 | local readonly apk_basename="$(basename "$apk")" 84 | local readonly apk_module="${apk_basename%.*}" 85 | 86 | [ -f "$_MODULES_MK" ] || _mk_init_module_mk 87 | 88 | { 89 | echo 90 | echo "ifeq (\$(TARGET_DEVICE),$device)" 91 | echo "include \$(CLEAR_VARS)" 92 | echo "LOCAL_MODULE := $apk_module" 93 | echo "LOCAL_MODULE_TAGS := optional" 94 | echo "LOCAL_BUILT_MODULE_STEM := package.apk" 95 | echo "LOCAL_MODULE_OWNER := $owner" 96 | echo "LOCAL_MODULE_CLASS := APPS" 97 | echo "LOCAL_SRC_FILES := $apk" 98 | echo "LOCAL_CERTIFICATE := platform" 99 | echo "LOCAL_MODULE_SUFFIX := \$(COMMON_ANDROID_PACKAGE_SUFFIX)" 100 | echo "include \$(BUILD_PREBUILT)" 101 | echo "endif" 102 | } >> "$_MODULES_MK" 103 | 104 | _mk_add_module_depends "$apk_module" 105 | } 106 | 107 | _mk_add_priv_apk () { 108 | local readonly apk="$1" 109 | local readonly owner="$2" 110 | local readonly device="$3" 111 | 112 | local readonly apk_basename="$(basename "$apk")" 113 | local readonly apk_module="${apk_basename%.*}" 114 | 115 | [ -f "$_MODULES_MK" ] || _mk_init_module_mk 116 | 117 | { 118 | echo 119 | echo "ifeq (\$(TARGET_DEVICE),$device)" 120 | echo "include \$(CLEAR_VARS)" 121 | echo "LOCAL_MODULE := $apk_module" 122 | echo "LOCAL_MODULE_TAGS := optional" 123 | echo "LOCAL_BUILT_MODULE_STEM := package.apk" 124 | echo "LOCAL_MODULE_OWNER := $owner" 125 | echo "LOCAL_MODULE_CLASS := APPS" 126 | echo "LOCAL_SRC_FILES := $apk" 127 | echo "LOCAL_CERTIFICATE := platform" 128 | echo "LOCAL_PRIVILEGED_MODULE := true" 129 | echo "LOCAL_MODULE_SUFFIX := \$(COMMON_ANDROID_PACKAGE_SUFFIX)" 130 | echo "include \$(BUILD_PREBUILT)" 131 | echo "endif" 132 | } >> "$_MODULES_MK" 133 | 134 | _mk_add_module_depends "$apk_module" 135 | } 136 | 137 | mk_add_apk () { 138 | local readonly apk="$1" 139 | local readonly owner="$2" 140 | local readonly device="$3" 141 | 142 | if _mk_is_priv_apk "$apk" ; then 143 | _mk_add_priv_apk "$apk" "$owner" "$device" 144 | else 145 | _mk_add_apk "$apk" "$owner" "$device" 146 | fi 147 | } 148 | 149 | mk_add_jar () { 150 | local readonly jar="$1" 151 | local readonly owner="$2" 152 | local readonly device="$3" 153 | 154 | local readonly jar_basename="$(basename "$jar")" 155 | local readonly jar_module="${jar_basename%.*}" 156 | 157 | [ -f "$_MODULES_MK" ] || _mk_init_module_mk 158 | 159 | { 160 | echo 161 | echo "ifeq (\$(TARGET_DEVICE),$device)" 162 | echo "include \$(CLEAR_VARS)" 163 | echo "LOCAL_MODULE := $jar_module" 164 | echo "LOCAL_MODULE_TAGS := optional" 165 | echo "LOCAL_MODULE_OWNER := $owner" 166 | echo "LOCAL_MODULE_CLASS := JAVA_LIBRARIES" 167 | echo "LOCAL_SRC_FILES := $jar" 168 | echo "LOCAL_MODULE_SUFFIX := \$(COMMON_JAVA_PACKAGE_SUFFIX)" 169 | echo "include \$(BUILD_PREBUILT)" 170 | echo "endif" 171 | } >> "$_MODULES_MK" 172 | 173 | _mk_add_module_depends "$jar_module" 174 | } 175 | 176 | mk_add_custom_module () { 177 | local readonly mk="$1" 178 | 179 | local readonly mk_basename="$(basename "$mk")" 180 | local readonly module="${mk_basename%.*}" 181 | 182 | [ -f "$_MODULES_MK" ] || _mk_init_module_mk 183 | 184 | # strip comments and append to modules makefile 185 | grep -v "#" < "$mk" >> "$_MODULES_MK" 186 | 187 | _mk_add_module_depends "$module" 188 | } 189 | 190 | mk_mirror_file () { 191 | local readonly file="$1" 192 | local readonly owner="$2" 193 | 194 | [ -f "$_BLOBS_MK" ] || _mk_init_blobs_mk 195 | 196 | echo " ${_VENDOR_DIR}/${file}:${file}:${owner} \\" >> "$_BLOBS_MK" 197 | } 198 | --------------------------------------------------------------------------------