{"id":32525648,"url":"https://github.com/anestisb/android-prepare-vendor","last_synced_at":"2025-10-28T09:52:01.794Z","repository":{"id":53267206,"uuid":"50767717","full_name":"anestisb/android-prepare-vendor","owner":"anestisb","description":"Set of scripts to automate AOSP compatible vendor blobs generation from factory images","archived":false,"fork":false,"pushed_at":"2020-02-02T23:51:25.000Z","size":12443,"stargazers_count":338,"open_issues_count":13,"forks_count":161,"subscribers_count":32,"default_branch":"master","last_synced_at":"2023-11-07T14:15:17.941Z","etag":null,"topics":["android","aosp","nexus-devices","pixel-devices","vendor-blobs"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anestisb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-01-31T09:51:46.000Z","updated_at":"2023-11-04T14:47:24.000Z","dependencies_parsed_at":"2022-08-13T02:30:51.691Z","dependency_job_id":null,"html_url":"https://github.com/anestisb/android-prepare-vendor","commit_stats":null,"previous_names":[],"tags_count":14,"template":null,"template_full_name":null,"purl":"pkg:github/anestisb/android-prepare-vendor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anestisb%2Fandroid-prepare-vendor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anestisb%2Fandroid-prepare-vendor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anestisb%2Fandroid-prepare-vendor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anestisb%2Fandroid-prepare-vendor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anestisb","download_url":"https://codeload.github.com/anestisb/android-prepare-vendor/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anestisb%2Fandroid-prepare-vendor/sbom","scorecard":{"id":195667,"data":{"date":"2025-08-11","repo":{"name":"github.com/anestisb/android-prepare-vendor","commit":"9dc54437d3152760c0aff2d2c309a474550e6cba"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.1,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":5,"reason":"Found 5/10 approved changesets -- score normalized to 5","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":1,"reason":"binaries present in source code","details":["Warn: binary detected: hostTools/Darwin/bin/dexrepair:1","Warn: binary detected: hostTools/Darwin/bin/jq:1","Warn: binary detected: hostTools/Darwin/bin/simg2img:1","Warn: binary detected: hostTools/Java/baksmali.jar:1","Warn: binary detected: hostTools/Java/oat2dex.jar:1","Warn: binary detected: hostTools/Java/smali.jar:1","Warn: binary detected: hostTools/Linux/bin/dexrepair:1","Warn: binary detected: hostTools/Linux/bin/jq:1","Warn: binary detected: hostTools/Linux/bin/simg2img:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":["Info: Possibly incomplete results: error parsing shell code: not a valid arithmetic operator: \": scripts/extract-factory-images.sh:0"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 25 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-16T21:46:53.701Z","repository_id":53267206,"created_at":"2025-08-16T21:46:53.701Z","updated_at":"2025-08-16T21:46:53.701Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281418064,"owners_count":26497723,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-28T02:00:06.022Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","aosp","nexus-devices","pixel-devices","vendor-blobs"],"created_at":"2025-10-28T09:51:49.663Z","updated_at":"2025-10-28T09:52:01.786Z","avatar_url":"https://github.com/anestisb.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Introduction\nFor the latest Android devices (Nexus and Pixel), Google is no longer providing\nvendor binary archives to be included into AOSP build tree. Officially it is\nclaimed that all vendor proprietary blobs have been moved to `/vendor`\npartition, which allegedly doesn't need building from users. Unfortunately, that\nis not the case since quite a few proprietary executables, DSOs and APKs/JARs\nlocated under `/system` are required in order to have a fully functional set of\nimages, although are missing from AOSP public tree. Additionally, if\n`vendor.img` is not generated when `system.img` is prepared for build, a few\nbits are broken that also require manual fixing (various symbolic links between\ntwo partitions, bytecode product packages, vendor shared library dependencies,\netc.).\n\nEveryone's hope is that Google **will revise** this policy for its devices.\nHowever until then, missing blobs need to be manually extracted from factory\nimages, processed and included into AOSP tree. These processing steps are\nevolving into a total nightmare considering that all recent factory images have\ntheir bytecode (APKs, JARs) pre-optimized to reduce boot time and their original\n`classes.dex` stripped to reduce disk size. As such, these missing prebuilt\ncomponents need to be repaired/de-optimized prior to be included, since AOSP\nbuild is not capable to import pre-optimized bytecode modules as part of the\nmakefile tree.\n\nScripts \u0026 tools included in this repository aim to automate the extraction,\nprocessing and generation of vendor specific data using factory images as\ninput. Data from vendor partition is mirrored to blob includes via a compatible\nmakefile structure, so that `vendor.img` can be generated from AOSP builds while\nspecially annotating the vendor APKs to maintain pre-signed certificates and not\npre-optimize. If you have modified the build process (such as CyanogenMod) you\nmight need to apply additional changes in device configurations / makefiles.\n\nThe main concept of this tool-set is to apply all required changes in vendor\nmakefiles leaving the AOSP source code tree \u0026 build chain untouched. Hacks in\nAOSP tree, such as those applied by CyanogenMod, are painful to maintain and\nvery fragile.\n\nRepository data is LICENSE free, use it as you want at your own risk. Feedback\n\u0026 patches are more than welcome though.\n\n\n### Status update (12 Feb 2017)\nAs of 7.1 release Google has started publishing again a set of vendor blobs for\nsupported Nexus \u0026 Pixel devices. Unfortunately the distributed blobs still miss\nsome functionality when compiled under AOSP:\n\n* Vendor partition is distributed in a form that does not allow to enable\nverified boot (dm-verity) against it\n* Distributed blobs do not include APK bytecode vendor packages, only some jar\nfiles. It is still unclear to what extent device functionalities are broken.\n* Due to missing proprietary modules, required modules present in AOSP are not\nincluded as active dependencies resulting into skipped functionality (e.g. IMS,\nRCS).\n\n### Status update (15 Sep 2017)\nAs of Oreo release (8.0) Google has improved the state of the proprietary vendor\nblobs for Pixel devices. State of supported Nexus devices has not changed much.\nFor Pixel devices most vendor specific resources have been moved to vendor\npartition and thus simplify \u0026 reduce the amount of work that needs to be done\nto include /system dependencies. Furthermore, the original bytecode is no longer\nstripped from the factory APKs, enabling an easier inclusion of these resources\nto the generated vendor makefiles.\n\n\n## Required steps summary\nThe process to extract and import vendor proprietary blobs requires to:\n\n1. Obtain device matching factory images archive from Google developer website\n(`scripts/download-nexus-image.sh`)\n   * Users need to accept Google ToS for Nexus factory images\n2. Extract images from archive, convert from sparse to raw, mount with ext4fuse\n\u0026 extract data (`scripts/extract-factory-images.sh`)\n   * All vendor partition data are mirrored in order to generate a production\n   identical `vendor.img`\n3. Repair bytecode (APKs/JARs) from factory system image (\n`scripts/system-img-repair.sh`) using one of supported bytecode de-optimization\nmethods (see next paragraph for details)\n4. Generate vendor proprietary includes \u0026 makefiles compatible with AOSP build\ntree (`scripts/generate-vendor.sh`)\n   * Extra care in Makefile rules to not break compatibility among supported\n   AOSP branches\n\n`execute-all.sh` runs all previous steps with required order. As an alternative\nto download images from Google's website, script can also read factory images\nfrom file-system location using the `-i|--img` flag.\n\n`-k|--keep` flag can be used if you want to keep extracted intermediate files\nfor further investigation. Keep in mind that if used the mount-points from\next4fuse are not unmounted. So be sure that you manually remove them (or run\nthe script again without the flag) when done.\n\nAll scripts can be executed from macOS, Linux \u0026 other Unix-based systems as long\nas bash 4.x and other utilized command line tools are installed. Scripts will\nabort if any of the required tools is missing from the host.\n\nScripts include individual usage info and additional flags that be used for\ntargeted advanced actions, bugs investigation \u0026 development of new features.\n\n## Supported bytecode de-optimization methods\n### oatdump (Default for API \u003e= 24 or `--oatdump` flag)\nUse oatdump host tool (`platform/art` project from AOSP) to extract DEX\nbytecode from OAT's ELF `.rodata` section. Extracted DEX is not identical to\noriginal since DEX-to-DEX compiler transformations have already been applied\nwhen code was pre-optimized (more info\n[here](https://github.com/anestisb/oatdump_plus#dex-to-dex-optimisations)).\n[dexrepair](https://github.com/anestisb/dexRepair) is also used to repair the\nextracted DEX file CRC checksum prior to appending bytecode back to matching\nAPK package from which it has been originally stripped. More info about this\nmethod [here](https://github.com/anestisb/android-prepare-vendor/issues/22).\n\n### baksmali / smali (`--smali` flag)\nUse baksmali disassembler against target OAT file to generate a smali syntaxed\noutput. Disassembling process relies on boot framework files (which are\nautomatically include) to resolve class dependencies. Baksmali output is then\nforwarded to smali assembler to generate a functionally equivalent DEX bytecode\nfile.\n\n### SmaliEx *[DEPRECATED]* (Default for API-23 or `--smaliex` flag)\nSmaliEx is an automation tool that is using baksmali/smali at the background and\nis smoothly handling all the required disassembler/assembler iterations and\nerror handling. Unfortunately due to not quickly catching-up with upstream smali\n\u0026 dexlib it has been deprecated for now.\n\n## Configuration files explained\n### Naked vs Full\nNaked configuration group (enabled by default when using the master script)\nincludes data \u0026 module targets required to have a functional device from AOSP\nwithout installing non-essential OEM packages. With this setup using Google Play\nServices / Google Apps will probably not work.\n\nOn the other hand the full configuration group (enabled with `-f|--full` flag\nfrom master script) has additional blobs \u0026 module targets which are normally\nmarked as non-essential, although might be required for some carriers or in case\nof GApps being installed (either manually post-boot or included as additional\nvendor blobs).\n\n\n## Supported devices\n| Device                          | API 23                      | API 24           | API 25           | API 26  | API 27  | API 28  |\n| ------------------------------- | --------------------------- | -----------------| -----------------| --------| --------| --------|\n| N5x bullhead                    | smaliex\u003cbr\u003esmali\u003cbr\u003eoatdump | oatdump\u003cbr\u003esmali | oatdump\u003cbr\u003esmali | oatdump | oatdump | N/A     |\n| N6p angler                      | smaliex\u003cbr\u003esmali\u003cbr\u003eoatdump | oatdump\u003cbr\u003esmali | oatdump\u003cbr\u003esmali | oatdump | oatdump | N/A     |\n| N9 flounder\u003cbr\u003e WiFi (volantis) | smaliex\u003cbr\u003esmali\u003cbr\u003eoatdump | oatdump\u003cbr\u003esmali | oatdump\u003cbr\u003esmali | N/A     | N/A     | N/A     |\n| N9 flounder\u003cbr\u003e LTE (volantisg) | smaliex\u003cbr\u003esmali\u003cbr\u003eoatdump | oatdump\u003cbr\u003esmali | oatdump\u003cbr\u003esmali | N/A     | N/A     | N/A     |\n| Pixel sailfish                  | N/A                         | N/A              | oatdump\u003cbr\u003esmali | oatdump | oatdump | oatdump |\n| Pixel XL marlin                 | N/A                         | N/A              | oatdump\u003cbr\u003esmali | oatdump | oatdump | oatdump |\n| Pixel 2 walleye                 | N/A                         | N/A              | N/A              | oatdump | oatdump | oatdump |\n| Pixel 2 XL taimen               | N/A                         | N/A              | N/A              | oatdump | oatdump | oatdump |\n| Pixel 3 blueline                | N/A                         | N/A              | N/A              | N/A     | N/A     | oatdump |\n| Pixel 3 XL crosshatch           | N/A                         | N/A              | N/A              | N/A     | N/A     | oatdump |\n| Pixel 3a sargo                  | N/A                         | N/A              | N/A              | N/A     | N/A     | oatdump |\n| Pixel 3a XL bonito              | N/A                         | N/A              | N/A              | N/A     | N/A     | oatdump |\n\n\nPlease check existing\n[issues](https://github.com/anestisb/android-prepare-vendor/issues) before\nreporting new ones\n\n## Contributing\nIf you want to contribute to device configuration files, please test against the\ntarget device before any pull request.\n\n## Change Log\n* 0.6.0 - TBC\n  * Android 9 (API-28) support for Pixel 3a (sargo) \u0026 Pixel 3a XL (bonito)\n  * Android 9 (API-28) support for Pixel 3 (blueline) \u0026 Pixel 3 XL (crosshatch)\n  * Improve support for deterministic builds (`--timestamp` option)\n  * Compatibility fixes in image downloader logic\n  * Create output directory if does not exist\n  * Remove prebuilts that are available in AOSP\n* 0.5.0 - 4 September 2018\n  * Android 9 (API-28) support for Pixel (sailfish), Pixel XL (marlin), Pixel 2 (walleye) \u0026 Pixel 2\n    XL (taimen)\n  * Developed an oatdump patch (see\n    [here](https://gist.github.com/anestisb/26ecf8ae13746dc476eddd8d04a5dd23)) to handle CompactDex\n    introduced in Android 9\n  * Use env's TMPDIR if set instead of defaulting to /tmp\n  * Restore option to mount with fuse-ext2 (`--fuse-ext2`)\n  * Add option to mount via loopback when running script as root\n  * oatdump repair method performance improvements\n  * Improve error handling and output formating\n* 0.4.1 - 11 August 2018\n  * Pixel 2 (walleye) support for API 26 \u0026 27\n  * Pixel 2 XL (taimen) support for API 26 \u0026 27 (credits to @deeproot2k)\n  * Improve debugfs error checking due to improper symlink parsing from some versions\n  * Deprecate fuse-ext2 and replace with ext4fuse\n  * Update simg2img binaries for Darwin \u0026 Linux\n* 0.4.0 - 9 December 2017\n  * Refactored configuration files\n  * API-27 support: Pixel, Pixel XL, Nexus 6p, Nexus 5x\n  * Various code cleanups\n* 0.3.0 - 9 October 2017\n  * Initial support for Android Oreo (API-26): Pixel, Pixel XL, Nexus 6p, Nexus\n  5x\n  * Add support for vendor overlays in order to override default AOSP resources\n  that are tweaked for specific devices\n* 0.2.1 - 1 July 2017\n  * Upgrade to smali/baksmali 2.2.1\n  * Add support to maintain presigned APKs\n  * Add missing AB partitions for Pixel OTA images\n  * Fixed Pixel TimeService bug by adding `system/app/TimeService.apk` to\n  extract list\n* 0.2.0 - 13 May 2017\n  * Renamed GPlay configuration to Full configuration\n  * Support for Pixel devices\n  * Output can be directly set to AOSP SRC ROOT\n  * Experimental debugfs support as an alternative to fuse-ext2\n  * Bug fixes when processing symbolic links from vendor partition\n  * Preserve symbolic links when processing vendor partition\n  * Android 7.1 support for Nexus devices (API-25)\n  * Follow HTTP redirects when downloading factory images\n* 0.1.7 - 8 Oct 2016\n  * Nexus 9 LTE (volantisg) support\n  * Offer option to de-optimize all packages under /system despite configuration\n  settings\n  * Deprecate SmaliEx and use baksmali/smali as an alternative method to deodex\n  bytecode\n  * Improve supported bytecode deodex methods modularity - users can now\n  override default methods\n  * Global flag to disable /system `LOCAL_DEX_PREOPT` overrides from vendor\n  generate script\n  * Respect `LOCAL_MULTILIB` `32` or `both` when 32bit bytecode prebuilts\n  detected at 64bit devices\n* 0.1.6 - 4 Oct 2016\n  * Download automation compatibility with refactored Google Nexus images\n  website\n  * Bug fixes when generating from OS X\n* 0.1.5 - 25 Sep 2016\n  * Fixes issue with symlinks resolve when output path with spaces\n  * Fixes bug when repairing multi-dex APKs with oatdump method\n  * Introduced sorted data processing so that output is diff friendly\n  * Include baseband \u0026 bootloader firmware at vendor blobs\n  * Various performance optimizations\n* 0.1.4 - 17 Sep 2016\n  * Split configuration into 2 groups: Naked \u0026 GPlay\n  * Fix extra modules being ignored bug\n* 0.1.3 - 14 Sep 2016\n  * Fix missing output path normalization which was corrupting symbolic links\n* 0.1.2 - 12 Sep 2016\n  * Fix JAR META-INF repaired archives deletion bug\n  * Improved fuse mount error handling\n  * FAQ for common fuse mount issues\n  * Extra defensive checks for /vendor/priv-app chosen signing certificate\n* 0.1.1 - 12 Sep 2016\n  * Unbound variable bug fix when early error abort\n* 0.1.0 - 11 Sep 2016\n  * Nougat API-24 support\n  * Utilize fuse-ext2 to drop required root permissions\n  * Implement new bytecode repair method\n  * Read directly data from mount points - deprecate local rsync copies for\n  speed\n  * Add OS X support (requires OSXFuse)\n  * Improved device configuration layers / files\n  * AOSP compatibility bug fixes \u0026 performance optimizations\n\n## Warnings\n* No binary vendor data against supported devices will be maintained in this\nrepository. Scripts provide all necessary automation to generate them yourself.\n* No promises on how the device configuration files will be maintained. Feel\nfree to contribute if you detect that something is broken, missing or not\nrequired.\n* Host tool binaries are provided for convenience, although with no promises\nthat will be kept up-to-date. Prefer to adjust your env. with upstream versions\nand keep them updated.\n* If you experience `already defined` type of errors when AOSP makefiles are\nincluded, you have other vendor makefiles that define the same packages (e.g.\nhammerhead vs bullhead for LGE vendor). This issue is due to other vendor\nmakefiles not wrapping them with `ifeq ($(TARGET_DEVICE),\u003cdevice_model\u003e)`.\nWrap conflicting makefiles with device matching clauses to resolve the issue.\n* If Smali or SmaliEx de-optimization method is chosen, Java 8 is required for\nthe bytecode repair process to work.\n* Bytecode repaired with oatdump method might not be able to be pre-optimized\nwhen building AOSP. As such generated targets have `LOCAL_DEXPREOPT := false`.\nThis is because host dex2oat is invoked with more strict flags and results into\naborting when front-end reaches already optimized instructions. You can use\n`--force-opt` flag if you have modified the default host dex2oat bytecode\npre-compilation flags.\n* If you're planning to deliver OTA updates for Nexus 5x, you need to manually\nextract `update-binary` from a factory OTA archive since it's missing from\nthe AOSP tree due to some proprietary LG code.\n* Nexus 9 WiFi (volantis) \u0026 Nexus 9 LTE (volantisg) vendor blobs cannot co-exist\nunder same AOSP root directory. Since AOSP defines a single flounder target for\nboth boards, lots of definitions will conflict and create problems when building.\nAs such ensure that only one of them is present when building for desired\ntarget. Generated makefiles include an additional defensive check that will\nraise a compiler error when both are detected under same AOSP root.\n* If tool output is not set to AOSP root directory, prefer `rsync` instead of\n`cp` or `mv` commands to copy the generated directory structure to different\nlocation. Some device configurations (e.g. Pixel/Pixel XL) share some root\ndirectories and might break if `cp` or `mv` are invoked with the wrong base\npaths.\n\n\n## Examples\n### API-24 (Nougat) N9 WiFi (alias volantis) flounder vendor generation after downloading factory image from website\n```\n$ ./execute-all.sh -d flounder -a volantis -b NRD91D -o /fast-datavault/nexus-vendor-blobs\n[*] Setting output base to '/fast-datavault/nexus-vendor-blobs/flounder/nrd91d'\n\n--{ Google Terms and Conditions\nDownloading of the system image and use of the device software is subject to the\nGoogle Terms of Service [1]. By continuing, you agree to the Google Terms of\nService [1] and Privacy Policy [2]. Your downloading of the system image and use\nof the device software may also be subject to certain third-party terms of\nservice, which can be found in Settings \u003e About phone \u003e Legal information, or as\notherwise provided.\n\n[1] https://www.google.com/intl/en/policies/terms/\n[2] https://www.google.com/intl/en/policies/privacy/\n\n[?] I have read and agree with the above terms and conditions - ACKNOWLEDGE [y|n]: y\n[*] Downloading image from 'https://dl.google.com/dl/android/aosp/volantis-nrd91d-factory-a27db9bc.zip'\n--2016-10-05 21:53:17--  https://dl.google.com/dl/android/aosp/volantis-nrd91d-factory-a27db9bc.zip\nResolving dl.google.com (dl.google.com)... 173.194.76.93, 173.194.76.190, 173.194.76.136, ...\nConnecting to dl.google.com (dl.google.com)|173.194.76.93|:443... connected.\nHTTP request sent, awaiting response... 200 OK\nLength: 793140236 (756M) [application/zip]\nSaving to: ‘/fast-datavault/nexus-vendor-blobs/flounder/nrd91d/volantis-nrd91d-factory-a27db9bc.zip’\n\ns/flounder/nrd91d/volantis-nrd91d-factory-a27db9bc.zip  96%[======================================================================================================================\u003e    ] 733.49M  1.22MB/s    eta 19s    ^/fast-datavault/nexus-vendor-blobs/flounder/nrd91d/vol 100%[==========================================================================================================================\u003e] 756.40M  1.19MB/s    in 10m 21s\n\n2016-10-05 22:03:39 (1.22 MB/s) - ‘/fast-datavault/nexus-vendor-blobs/flounder/nrd91d/volantis-nrd91d-factory-a27db9bc.zip’ saved [793140236/793140236]\n\n[*] Processing with 'API-24 config-naked' configuration\n[*] Extracting '/fast-datavault/nexus-vendor-blobs/flounder/nrd91d/volantis-nrd91d-factory-a27db9bc.zip'\n[*] Unzipping 'image-volantis-nrd91d.zip'\n[!] No baseband firmware present - skipping\n[!] System partition doesn't contain any pre-optimized files - link to original partition\n[*] Generating blobs for vendor/htc/flounder\n[*] Copying radio files '/fast-datavault/nexus-vendor-blobs/flounder/nrd91d/vendor/htc/flounder'\n[*] Copying product files \u0026 generating 'flounder-vendor-blobs.mk' makefile\n[*] Generating 'device-vendor.mk'\n[*] Generating 'AndroidBoardVendor.mk'\n  [*] Bootloader:3.48.0.0139\n[*] Generating 'BoardConfigVendor.mk'\n[*] Generating 'vendor-board-info.txt'\n[*] Generating 'Android.mk'\n[*] Gathering data from 'vendor/app' APK/JAR pre-builts\n[*] Generating signatures file\n[*] All actions completed successfully\n[*] Import '/fast-datavault/nexus-vendor-blobs/flounder/nrd91d/vendor' to AOSP root\n```\n\n### API-23 (Marshmallow) N5x vendor generation using factory image from file-system\n```\n$ ./execute-all.sh -d bullhead -i /fast-datavault/nexus-vendor-blobs/bullhead/mtc20k/bullhead-mtc20k-factory-4a950470.zip -b mtc20k -o /fast-datavault/nexus-vendor-blobs\n[*] Setting output base to '/fast-datavault/nexus-vendor-blobs/bullhead/mtc20k'\n[*] Processing with 'API-23 config-naked' configuration\n[*] Extracting '/fast-datavault/nexus-vendor-blobs/bullhead/mtc20k/bullhead-mtc20k-factory-4a950470.zip'\n[*] Unzipping 'image-bullhead-mtc20k.zip'\n[*] '20' bytecode archive files will be repaired\n[*] Repairing bytecode under /system partition using oat2dex method\n[*] Preparing environment for 'arm' ABI\n[*] Preparing environment for 'arm64' ABI\n[*] Start processing system partition \u0026 de-optimize pre-compiled bytecode\n[!] '/framework/cneapiclient.jar' not pre-optimized with sanity checks passed - copying without changes\n[!] '/framework/framework-res.apk' not pre-optimized \u0026 without 'classes.dex' - copying without changes\n[*] '/framework/framework.jar' is multi-dex - adjusting recursive archive adds\n[!] '/framework/rcsimssettings.jar' not pre-optimized with sanity checks passed - copying without changes\n[!] '/framework/rcsservice.jar' not pre-optimized with sanity checks passed - copying without changes\n[*] System partition successfully extracted \u0026 repaired at '/fast-datavault/nexus-vendor-blobs/bullhead/mtc20k/factory_imgs_repaired_data'\n[*] Generating blobs for vendor/lge/bullhead\n[*] Copying radio files '/fast-datavault/nexus-vendor-blobs/bullhead/mtc20k/vendor/lge/bullhead'\n[*] Copying product files \u0026 generating 'bullhead-vendor-blobs.mk' makefile\n[*] Generating 'device-vendor.mk'\n[*] Generating 'AndroidBoardVendor.mk'\n  [*] Bootloader:BHZ10r\n  [*] Baseband:M8994F-2.6.32.1.13\n[*] Generating 'BoardConfigVendor.mk'\n[*] Generating 'vendor-board-info.txt'\n[*] Generating 'Android.mk'\n[*] Gathering data from 'vendor/app' APK/JAR pre-builts\n[*] Gathering data from 'proprietary/app' APK/JAR pre-builts\n[*] Gathering data from 'proprietary/framework' APK/JAR pre-builts\n[*] Gathering data from 'proprietary/priv-app' APK/JAR pre-builts\n[*] Generating signatures file\n[*] All actions completed successfully\n[*] Import '/fast-datavault/nexus-vendor-blobs/bullhead/mtc20k/vendor' to AOSP root\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanestisb%2Fandroid-prepare-vendor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanestisb%2Fandroid-prepare-vendor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanestisb%2Fandroid-prepare-vendor/lists"}