Introduction

For latest Android Nexus devices (N5x, N6p, N9 LTE/WiFi), Google is no longer providing vendor binary archives to be included into AOSP build tree. Officially it is claimed that all vendor proprietary blobs have been moved to /vendor partition, which allegedly doesn't need building from users. Unfortunately, that is not the case since quite a few proprietary executables, DSOs and APKs/JARs located under /system are required in order to have a fully functional set of images, although missing from AOSP public tree. Additionally, if vendor.img is not generated when system.img is prepared for build, a few bits are broken that also require manual fixing (various symbolic links between two partitions, bytecode product packages, vendor shared libs dependencies, etc.).

Everyone's hope is that Google will revise this policy for Nexus devices. However until then, missing blobs need to be manually extracted from factory images, processed and included into AOSP tree. These processing steps are evolving into a total nightmare considering that all recent factory images have their bytecode (APKs, JARs) pre-optimized to reduce boot time and their original classes.dex stripped to reduce disk size. As such, these missing prebuilt components need to be repaired/de-optimized prior to be included, since AOSP build is not capable to import pre-optimized bytecode modules as part of the makefile tree.

Scripts & tools included in this repository aim to automate the extraction, processing and generation of vendor specific data using factory images as input. Data from vendor partition are mirrored to blob includes via a compatible makefile structure, so that vendor.img can be generated from AOSP builds while specially annotating the vendor APKs to maintain pre-signed certificates and not pre-optimize. If you have modified the build process (such as CyanogenMod) you might need to apply additional changes in device configurations / makefiles.

The main concept of this tool-set is to apply all required changes in vendor makefiles leaving the AOSP source code tree & build chain untouched. Hacks in AOSP tree, such as those applied by CyanogenMod, are painful to maintain and very fragile.

Repository data are LICENSE free, use them as you want at your own risk. Feedback & patches are more than welcome though.

Status update (12 Feb 2017)

As of 7.1 release Google has started publishing again a set of vendor blobs for supported Nexus & Pixel devices. Unfortunately the distributed blobs still miss some functionality when compiled under AOSP:

  • Vendor partition is distributed in a form that does not allow to enable verified boot (dm-verity) against it
  • Distributed blobs do not include APK bytecode vendor packages, only some jar files. It is still unclear to what extend device functionalities are broken.
  • Due to missing proprietary modules, required modules present in AOSP are not included as active dependencies resulting into skipped functionality (e.g. IMS, RCS)

Required steps summary

The process to extract and import vendor proprietary blobs requires to:

  1. Obtain device matching factory images archive from Google developer website (scripts/download-nexus-image.sh)
  • Users need to accept Google ToS for Nexus factory images
  1. Extract images from archive, convert from sparse to raw, mount with fuse-ext2 & extract data (scripts/extract-factory-images.sh)
  • All vendor partition data are mirrored in order to generate a production identical vendor.img
  1. Repair bytecode (APKs/JARs) from factory system image (scripts/system-img-repair.sh) using one of supported bytecode de-optimization methods (see next paragraph for details)
  2. Generate vendor proprietary includes & makefiles compatible with AOSP build tree (scripts/generate-vendor.sh)
  • Extra care in Makefile rules to not break compatibility among supported AOSP branches

execute-all.sh runs all previous steps with required order. As an alternative to download images from Google's website, script can also read factory images from file-system location using the -i|--img flag.

-k|--keep flag can be used if you want to keep extracted intermediate files for further investigation. Keep in mind that if used the mount-points from fuse-ext2 are not unmounted. So be sure that you manually remove them (or run the script again without the flag) when done.

All scripts can be executed from OS X, Linux & other Unix-based systems as long as fuse-ext2, bash 4.x and other utilized command line tools are installed. Scripts will abort if any of the required tools is missing from the host.

Scripts include individual usage info and additional flags that be used for targeted advanced actions, bugs investigation & development of new features.

Supported bytecode de-optimization methods

oatdump (Default for API-24 or --oatdump flag)

Use oatdump host tool (platform/art project from AOSP) to extract DEX bytecode from OAT's ELF .rodata section. Extracted DEX is not identical to original since DEX-to-DEX compiler transformations have already been applied when code was pre-optimized (more info here). dexrepair is also used to repair the extracted DEX file CRC checksum prior to appending bytecode back to matching APK package from which it has been originally stripped. More info about this method here.

baksmali / smali (--smali flag)

Use baksmali disassembler against target OAT file to generate a smali syntaxed output. Disassembling process relies on boot framework files (which are automatically include) to resolve class dependencies. Baksmali output is then forwarded to smali assembler to generate a functionally equivalent DEX bytecode file.

SmaliEx [DEPRECATED] (Default for API-23 or --smaliex flag)

SmaliEx is an automation tool that is using baksmali/smali at the background and is smoothly handling all the required disassembler/assembler iterations and error handling. Unfortunately due to not quickly catching-up with upstream smali & dexlib it has been deprecated for now.

Configuration files explained

Naked vs GPlay

Naked configuration group (enabled by default when using the master script) includes data & module targets required to have a functional device from AOSP without using Google Play Services / Google Apps. On the other hand GPlay configuration group (enabled with -g|--gplay flag from master script) has additional blobs & module targets which are required only when GApps are installed (either manually post-boot or included as additional vendor blobs).

system-proprietary-blobs-apiXX.txt

List of files to be appended at the PRODUCT_COPY_FILES list. These files are effectively copied across as is from source vendor directory to configured AOSP build output directory.

bytecode-proprietary-apiXX.txt

List of bytecode archive files to extract from factory images, repair and generate individual target modules to be included in vendor makefile structure.

dep-dso-proprietary-blobs-apiXX.txt

Pre-built shared libraries (*.so) extracted from factory images that are included as a separate local module. Multi-lib support & paths are automatically generated based on the evidence collected while crawling factory images extracted partitions. Files enlisted here will excluded from PRODUCT_COPY_FILES and instead added to the PRODUCT_PACKAGES list.

vendor-config-apiXX.txt

Additional makefile flags to be appended at the dynamically generated BoardConfigVendor.mk These flags are useful in case we want to override some default values set at original BoardConfig.mk without editing the source file.

extra-modules-apiXX.txt

Additional target modules (with compatible structure based on rule build type) to be appended at master vendor Android.mk.

Supported devices

Device API 23 API 24 API 25
N5x bullhead smaliex
smali
oatdump
oatdump
smali
oatdump
smali
N6p angler smaliex
smali
oatdump
oatdump
smali
oatdump
smali
N9 flounder
WiFi (volantis)
smaliex
smali
oatdump
oatdump
smali
oatdump
smali
N9 flounder
LTE (volantisg)
smaliex
smali
oatdump
oatdump
smali
oatdump
smali
Pixel sailfish N/A N/A oatdump
smali
Pixel XL marlin N/A N/A oatdump
smali
  • Open issues exist for Pixel devices
  • Pixel XL marlin support has not been tested against physical device from author due to lack of hardware.

Contributing

If you want to contribute to device configuration files, please test against the target device before any pull request.

Change Log

  • 0.2.0 - TBC
  • Support for Pixel devices
  • Output can be directly set to AOSP SRC ROOT
  • Experimental debugfs support as an alternative to fuse-ext2
  • Bug fixes when processing symbolic links from vendor partition
  • Preserve symbolic links when processing vendor partition
  • Android 7.1 support for Nexus devices (API-25)
  • Follow HTTP redirects when downloading factory images
  • 0.1.7 - 8 Oct 2016
  • Nexus 9 LTE (volantisg) support
  • Offer option to de-optimize all packages under /system despite configuration settings
  • Deprecate SmaliEx and use baksmali/smali as an alternative method to deodex bytecode
  • Improve supported bytecode deodex methods modularity - users can now override default methods
  • Global flag to disable /system LOCAL_DEX_PREOPT overrides from vendor generate script
  • Respect LOCAL_MULTILIB 32 or both when 32bit bytecode prebuilts detected at 64bit devices
  • 0.1.6 - 4 Oct 2016
  • Download automation compatibility with refactored Google Nexus images website
  • Bug fixes when generating from OS X
  • 0.1.5 - 25 Sep 2016
  • Fixes issue with symlinks resolve when output path with spaces
  • Fixes bug when repairing multi-dex APKs with oatdump method
  • Introduced sorted data processing so that output is diff friendly
  • Include baseband & bootloader firmware at vendor blobs
  • Various performance optimizations
  • 0.1.4 - 17 Sep 2016
  • Split configuration into 2 groups: Naked & GPlay
  • Fix extra modules being ignored bug
  • 0.1.3 - 14 Sep 2016
  • Fix missing output path normalization which was corrupting symbolic links
  • 0.1.2 - 12 Sep 2016
  • Fix JAR META-INF repaired archives deletion bug
  • Improved fuse mount error handling
  • FAQ for common fuse mount issues
  • Extra defensive checks for /vendor/priv-app chosen signing certificate
  • 0.1.1 - 12 Sep 2016
  • Unbound variable bug fix when early error abort
  • 0.1.0 - 11 Sep 2016
  • Nougat API-24 support
  • Utilize fuse-ext2 to drop required root permissions
  • Implement new bytecode repair method
  • Read directly data from mount points - deprecate local rsync copies for speed
  • Add OS X support (requires OSXFuse)
  • Improved device configuration layers / files
  • AOSP compatibility bug fixes & performance optimizations

Warnings

  • Scripts do NOT require root permissions to run. If you're facing problems with fuse-ext2 configuration at your environment, check the following FAQ section.
  • No binary vendor data against supported devices will be maintained in this repository. Scripts provide all necessary automation to generate them yourself.
  • No promises on how the device configuration files will be maintained. Feel free to contribute if you detect that something is broken/missing or not required.
  • Host tool binaries are provided for convenience, although with no promises that will be kept up-to-date. Prefer to adjust your env. with upstream versions and keep them updated.
  • If you experience already defined type of errors when AOSP makefiles are included, you have other vendor makefiles that define the same packages (e.g. hammerhead vs bullhead from LGE). This issue is due to the developers of conflicted vendor makefiles didn't bother to wrap them with ifeq ($(TARGET_DEVICE),<device_model>). Wrap conflicting makefiles with device matching clauses to resolve the issue.
  • If Smali or SmaliEx de-optimization method is chosen, Java 8 is required for the bytecode repair process to work.
  • Bytecode repaired with oatdump method cannot be pre-optimized when building AOSP. As such generated targets have LOCAL_DEXPREOPT := false. This is because host dex2oat is invoked with more strict flags and results into aborting when front-end reaches already optimized instructions. You can use --force-opt flag if you have modified the defailt host dex2oat bytecode precompile flags.
  • If you're planning to deliver OTA updates for Nexus 5x, you need to manually extract update-binary from a factory OTA archive since it's missing from AOSP tree due to some proprietary LG code.
  • Nexus 9 WiFi (volantis) & Nexus 9 LTE (volantisg) vendor blobs cannot co-exist under same AOSP root directory. Since AOSP defines a single flounder target for both boards lots of definitions will conflict and create problems when building. As such ensure that only one of them is present when building for desired target. Generated makefiles include an additional defensive check that will raise a compiler error when both are detected under same AOSP root.
  • If tool output is not set to AOSP root directory, prefer rsync instead of cp or mv commands to copy the generated directory structure to different location. Some device configurations (e.g. Pixel/Pixel XL) share some root directories and might break if cp or mv are against the wrong base paths.

Frequently Spotted Issues

fuse-ext2

  • fusermount: failed to open /etc/fuse.conf: Permission denied
  • FIX-1: Add low privilege username to fuse group (e.g.: # usermod -a -G fuse anestisb)
  • FIX-2: Change file permissions - # chmod +r /etc/fuse.conf
  • fusermount: option allow_other only allowed if 'user_allow_other' is set in /etc/fuse.conf
  • Edit /etc/fuse.conf and write/uncomment the user_allow_other flag

Examples

API-24 (Nougat) N9 WiFi (alias volantis) flounder vendor generation after downloading factory image from website

$ ./execute-all.sh -d flounder -a volantis -b NRD91D -o /fast-datavault/nexus-vendor-blobs
[*] Setting output base to '/fast-datavault/nexus-vendor-blobs/flounder/nrd91d'

--{ Google Terms and Conditions
Downloading of the system image and use of the device software is subject to the
Google Terms of Service [1]. By continuing, you agree to the Google Terms of
Service [1] and Privacy Policy [2]. Your downloading of the system image and use
of the device software may also be subject to certain third-party terms of
service, which can be found in Settings > About phone > Legal information, or as
otherwise provided.

[1] https://www.google.com/intl/en/policies/terms/
[2] https://www.google.com/intl/en/policies/privacy/

[?] I have read and agree with the above terms and conditions - ACKNOWLEDGE [y|n]: y
[*] Downloading image from 'https://dl.google.com/dl/android/aosp/volantis-nrd91d-factory-a27db9bc.zip'
--2016-10-05 21:53:17--  https://dl.google.com/dl/android/aosp/volantis-nrd91d-factory-a27db9bc.zip
Resolving dl.google.com (dl.google.com)... 173.194.76.93, 173.194.76.190, 173.194.76.136, ...
Connecting to dl.google.com (dl.google.com)|173.194.76.93|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 793140236 (756M) [application/zip]
Saving to: ‘/fast-datavault/nexus-vendor-blobs/flounder/nrd91d/volantis-nrd91d-factory-a27db9bc.zip’

s/flounder/nrd91d/volantis-nrd91d-factory-a27db9bc.zip  96%[======================================================================================================================>    ] 733.49M  1.22MB/s    eta 19s    ^/fast-datavault/nexus-vendor-blobs/flounder/nrd91d/vol 100%[==========================================================================================================================>] 756.40M  1.19MB/s    in 10m 21s

2016-10-05 22:03:39 (1.22 MB/s) - ‘/fast-datavault/nexus-vendor-blobs/flounder/nrd91d/volantis-nrd91d-factory-a27db9bc.zip’ saved [793140236/793140236]

[*] Processing with 'API-24 config-naked' configuration
[*] Extracting '/fast-datavault/nexus-vendor-blobs/flounder/nrd91d/volantis-nrd91d-factory-a27db9bc.zip'
[*] Unzipping 'image-volantis-nrd91d.zip'
[!] No baseband firmware present - skipping
[!] System partition doesn't contain any pre-optimized files - link to original partition
[*] Generating blobs for vendor/htc/flounder
[*] Copying radio files '/fast-datavault/nexus-vendor-blobs/flounder/nrd91d/vendor/htc/flounder'
[*] Copying product files & generating 'flounder-vendor-blobs.mk' makefile
[*] Generating 'device-vendor.mk'
[*] Generating 'AndroidBoardVendor.mk'
  [*] Bootloader:3.48.0.0139
[*] Generating 'BoardConfigVendor.mk'
[*] Generating 'vendor-board-info.txt'
[*] Generating 'Android.mk'
[*] Gathering data from 'vendor/app' APK/JAR pre-builts
[*] Generating signatures file
[*] All actions completed successfully
[*] Import '/fast-datavault/nexus-vendor-blobs/flounder/nrd91d/vendor' to AOSP root

API-23 (Marshmallow) N5x vendor generation using factory image from file-system

$ ./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
[*] Setting output base to '/fast-datavault/nexus-vendor-blobs/bullhead/mtc20k'
[*] Processing with 'API-23 config-naked' configuration
[*] Extracting '/fast-datavault/nexus-vendor-blobs/bullhead/mtc20k/bullhead-mtc20k-factory-4a950470.zip'
[*] Unzipping 'image-bullhead-mtc20k.zip'
[*] '20' bytecode archive files will be repaired
[*] Repairing bytecode under /system partition using oat2dex method
[*] Preparing environment for 'arm' ABI
[*] Preparing environment for 'arm64' ABI
[*] Start processing system partition & de-optimize pre-compiled bytecode
[!] '/framework/cneapiclient.jar' not pre-optimized with sanity checks passed - copying without changes
[!] '/framework/framework-res.apk' not pre-optimized & without 'classes.dex' - copying without changes
[*] '/framework/framework.jar' is multi-dex - adjusting recursive archive adds
[!] '/framework/rcsimssettings.jar' not pre-optimized with sanity checks passed - copying without changes
[!] '/framework/rcsservice.jar' not pre-optimized with sanity checks passed - copying without changes
[*] System partition successfully extracted & repaired at '/fast-datavault/nexus-vendor-blobs/bullhead/mtc20k/factory_imgs_repaired_data'
[*] Generating blobs for vendor/lge/bullhead
[*] Copying radio files '/fast-datavault/nexus-vendor-blobs/bullhead/mtc20k/vendor/lge/bullhead'
[*] Copying product files & generating 'bullhead-vendor-blobs.mk' makefile
[*] Generating 'device-vendor.mk'
[*] Generating 'AndroidBoardVendor.mk'
  [*] Bootloader:BHZ10r
  [*] Baseband:M8994F-2.6.32.1.13
[*] Generating 'BoardConfigVendor.mk'
[*] Generating 'vendor-board-info.txt'
[*] Generating 'Android.mk'
[*] Gathering data from 'vendor/app' APK/JAR pre-builts
[*] Gathering data from 'proprietary/app' APK/JAR pre-builts
[*] Gathering data from 'proprietary/framework' APK/JAR pre-builts
[*] Gathering data from 'proprietary/priv-app' APK/JAR pre-builts
[*] Generating signatures file
[*] All actions completed successfully
[*] Import '/fast-datavault/nexus-vendor-blobs/bullhead/mtc20k/vendor' to AOSP root


简介

对于最新的Android Nexus设备(N5x,N6p,N9 LTE / WiFi),Google已不再 提供供应商二进制存档以包含在AOSP构建树中。 据官方声称,所有供应商专有的Blob已被移至 / vendor 分区,据称不需要从用户构建。 不幸的是,由于很多专有的可执行文件DSO,​​情况并非如此 并且需要位于 / system 下的APKs / JAR才能完整 功能集的图像,虽然从AOSP公共树丢失。另外,如果 当 system.img 准备构建时,不会生成 vendor.img ,几位 被破坏,也需要手动固定(两个之间的各种符号链接 分区,字节码产品包,供应商共享库依赖关系等)。

每个人都希望Google 将修改这项针对Nexus设备的政策。 然而,直到那时,需要从工厂手工提取缺少的斑点 图像,处理并包含在AOSP树中。这些处理步骤正在发展 考虑到所有最近的工厂图像都有他们的整体噩梦 字节码(APKs,JAR)预优化以减少启动时间及其原始 剥离了 classes.dex 以减少磁盘大小。因此,这些缺失预建 由于AOSP的构建,组件需要在被包括之前被修复/去优化 不能将预先优化的字节码模块作为makefile树的一部分导入。

脚本&amp;该存储库中包含的工具旨在自动化提取, 使用工厂图像处理和生成供应商特定数据 输入。来自供应商分区的数据通过兼容性镜像到blob包 makefile结构,使得可以从AOSP构建时生成 vendor.img 特别注释供应商APK以维护预先签名的证书 预优化。如果您修改了构建过程(如CyanogenMod),则可以 可能需要对设备配置/ makefile进行其他更改。

此工具集的主要概念是在供应商中应用所有必需的更改 离开AOSP源代码树&amp;建造链不变。 AOSP中的黑客 树,例如由CyanogenMod应用的树,很难保持和非常脆弱。

存储库数据是免费的,请使用它们,因为您自己承担风险。反馈&amp; 补丁更受欢迎。

状态更新(2017年2月12日)

自7.1版起,Google已经开始再次发布一系列供应商的BLOB 支持Nexus&amp;像素设备不幸的是,分布式的小块仍然错过 在AOSP下编译时的一些功能:

  • 供应商分区以不允许启用验证的表单分发 启动(dm-verity)对它
  • 分发的blob不包括APK字节码供应商软件包,只包含一些jar文件。它 对于什么扩展设备功能的破坏仍然不清楚。
  • 由于缺少专有模块,AOSP中所需的模块不是 作为导致跳过的功能(例如IMS,RCS)的活动依赖关系
必需步骤摘要

提取和导入供应商专有blob的过程需要:

  1. Obtain device matching factory images archive from Google developer website (scripts/download-nexus-image.sh)
  • 用户需要接受Nexus工厂图片的Google ToS
  1. Extract images from archive, convert from sparse to raw, mount with fuse-ext2 & extract data (scripts/extract-factory-images.sh)
  • 所有供应商分区数据都是镜像的,以便生成相同的代码。vendor.img
  1. Repair bytecode (APKs/JARs) from factory system image (scripts/system-img-repair.sh) using one of supported bytecode de-optimization methods (see next paragraph for details)
  2. Generate vendor proprietary includes & makefiles compatible with AOSP build tree (scripts/generate-vendor.sh)
  • 特别注意Makefile规则不会破坏支持的AOSP分支之间的兼容性

execute-all.sh 以所需的顺序运行所有以前的步骤。作为替代 从Google的网站下载图片,脚本也可以从中读取工厂图片 文件系统位置使用 -i | –img 标志。

-k | –keep 标志可以使用,如果你想保留提取的中间文件进一步 调查请记住,如果使用,fuse-ext2的安装点未被卸载。 所以请确保手动删除它们(或者在没有标志的情况下再次运行脚本)。

所有脚本都可以从OS X,Linux&amp;其他基于Unix的系统一样长 作为 fuse-ext2 ,安装了bash 4.x和其他使用的命令行工具。 如果主机中缺少任何必需的工具,脚本将中止。

脚本包括个人使用信息和用于的其他标志 针对性的高级动作,错误调查&amp;开发新功能。

支持的字节码去优化方法

oatdump(API-24或 - oatdump 标志的默认值)

使用oatdump主机工具(来自AOSP的 platform / art 项目)来提取OAT的DEX字节码 ELF .rodata 部分。从DEX到DEX编译器,提取的DEX与原始DEX不同 当代码被预先优化时,已经应用了转换 (更多信息,请此处)。 dexrepair 也用于修复提取的 DEX文件CRC校验和之前将字节码追加到匹配的APK包中 它最初被剥离。有关此方法的更多信息此处

/ svg> baksmali / smali( - smali 标志)

使用baksmali反汇编器对目标OAT文件生成一个smali语法输出。 拆装过程依赖于启动框架文件(自动包含) 以解决类依赖性。然后将Baksmali输出转发给smali汇编器 以生成功能相当的DEX字节码文件。

SmaliEx [DEPRECATED] (API-23或 - smaliex < / code> flag)

SmaliEx是一种在后台使用baksmali / smali的自动化工具 顺利地处理所有所需的反汇编器/汇编器迭代和错误处理。 不幸的是由于不快速赶上上游smali&amp; dexlib一直是 现在已经弃用了。

配置文件解释

裸体与GPlay

裸配置组(使用主脚本时默认启用) 包括数据&amp;从AOSP获得功能设备所需的模块目标 而不使用Google Play服务/ Google Apps。另一方面,GPlay 配置组(从主脚本启用 -g | –gplay 标志)具有附加功能 斑点和仅在安装GApps时才需要模块目标(也可以 手动后引导或作为额外的供应商Blob包含)。

系统专有 - blobs-apiXX.txt

要附加在 PRODUCT_COPY_FILES 列表中的文件列表。这些文件是 有效地从源供应商目录复制到配置的AOSP 构建输出目录。

bytecode-owned-apiXX.txt

从工厂图像中提取的字节码存档文件列表,修复和生成 单独的目标模块要包含在供应商makefile结构中。

dep-dso-owned-blobs-apiXX.txt

从包含的工厂图像中提取的预构建共享库(* .so) 作为单独的本地模块。多库支持&amp;自动生成路径 基于在抓取工厂图像时收集的证据提取的分区。 在这里登记的文件将从 PRODUCT_COPY_FILES 中排除,而不是添加到 PRODUCT_PACKAGES 列表。

vendor-config-apiXX.txt

在动态生成的 BoardConfigVendor.mk 附加的makefile标志 这些标志是有用的,以防我们想覆盖一些设置的默认值 原始 BoardConfig.mk 而不编辑源文件。

extra-modules-apiXX.txt

其他目标模块(具有基于规则构建类型的兼容结构)至 在主厂商 Android.mk 附加

支持的设备

Device API 23 API 24 API 25
N5x bullhead smaliex
smali
oatdump
oatdump
smali
oatdump
smali
N6p angler smaliex
smali
oatdump
oatdump
smali
oatdump
smali
N9 flounder
WiFi (volantis)
smaliex
smali
oatdump
oatdump
smali
oatdump
smali
N9 flounder
LTE (volantisg)
smaliex
smali
oatdump
oatdump
smali
oatdump
smali
Pixel sailfish N/A N/A oatdump
smali
Pixel XL marlin N/A N/A oatdump
smali
  • 打开问题 存在于像素设备
  • Pixel XL marlin支持尚未针对作者的物理设备进行测试 由于缺乏硬件。

贡献

如果您想对设备配置文件做出贡献,请测试 任何拉动请求之前的目标设备。

更改日志

  • 0.2.0 - TBC
  • 支持像素设备
  • 输出可以直接设置为AOSP SRC ROOT
  • 实验debugfs支持作为fuse-ext2的替代方案
  • 处理来自供应商分区
  • 的符号链接时修复错误
  • 在处理供应商分区时保留符号链接
  • Android 7.1支持Nexus设备(API-25)
  • 下载工厂图片时按照HTTP重定向
  • 0.1.7 - 2016年10月8日
  • Nexus 9 LTE(volantisg)支持
  • 提供选项,以尽可能优化/系统配置设置下的所有软件包
  • 弃用SmaliEx并使用baksmali / smali作为deodex字节码的替代方法
  • 改进支持的字节码deodex方法模块化 - 用户现在可以覆盖默认方法
  • 禁用/系统代码的全局标志LOCAL_DEX_PREOPT 覆盖供应商生成脚本
  • 在64位设备检测到32位字节代码预处理时,尊重 LOCAL_MULTILIB 32 两者
  • 0.1.6 - 2016年10月4日
  • 下载与重构的Google Nexus图片网站的自动兼容性
  • 从OS X生成时修复错误
  • 0.1.5 - 2016年9月25日
  • 修正使用空格
  • 的输出路径时,符号链接解决问题
  • 修复使用oatdump方法
  • 的multi-dex APK进行修复
  • 引入排序数据处理,使得输出不兼容
  • 包括基带&amp;引导程序固件在供应商blobs
  • 各种性能优化
  • 0.1.4 - 2016年9月17日
  • 将配置分成两组:裸体&amp; GPlay
  • 修复被忽略的额外模块错误
  • 0.1.3 - 2016年9月14日
  • 修正错误的输出路径规范化,这正在破坏符号链接
  • 0.1.2 - 2012年9月12日
  • 修复JAR META-INF修复的存档删除错误
  • 改进了保险丝安装错误处理
  • 常见的熔断器安装问题常见问题
  • / vendor / priv-app选择的签名证书的额外防御性检查
  • 0.1.1 - 2016年9月12日
  • 早期错误中止时不绑定变量错误修复
  • 0.1.0 - 11 Sep 2016
  • Nougat API-24支持
  • 利用fuse-ext2删除所需的root权限
  • 实施新的字节码修复方法
  • 从安装点直接读取数据 - 不要使用本地rsync副本以获取速度
  • 添加OS X支持(需要OSXFuse)
  • 改进的设备配置层/文件
  • AOSP兼容性错误修复和性能优化

警告

  • 脚本 NOT 需要root权限才能运行。如果你面临问题 在您的环境中使用 fuse-ext2 配置,请查看以下FAQ部分。
  • 在此维护不支持的设备的二进制供应商数据 存储库脚本提供所有必要的自动化功能,以便自己生成。
  • 不保证设备配置文件的维护方式。感觉自由 如果您检测到某物被破坏/丢失或不需要,则作出贡献。
  • 主机工具二进制文件是为方便起见,尽管没有任何承诺 这将保持最新。喜欢调整你的环境与上游版本和 保持更新。
  • 如果在AOSP makefile中有已经定义的类型的错误 包括,您有其他供应商makefile定义相同的包(例如, 来自LGE的锤头与牛头)。这个问题是由于开发者的 冲突的供应商makefile没有打扰他们 ifeq($(TARGET_DEVICE),&lt; device_model&gt;)。包装冲突的makefile与 设备匹配条款来解决问题。
  • 如果选择Smali或SmaliEx去优化方法,则需要Java 8 字节码修复过程工作。
  • 使用oatdump方法修复的字节码不能在构建AOSP时进行预优化。 因为这样生成的目标具有 LOCAL_DEXPREOPT:= false 。这是因为主机 dex2oat被调用具有更严格的标志和结果在前端终止 达到已经优化的说明。你可以使用 - force-opt 标志 修改了defailt主机dex2oat字节码预编译标志。
  • 如果您打算为Nexus 5x提供OTA更新,则需要手动提取 update-binary 来自工厂OTA存档,因为AOSP树由于某些原因丢失了 专有的LG代码。
  • Nexus 9 WiFi(volantis)&amp; Nexus 9 LTE(volantisg)供应商blob不能共存 相同的AOSP根目录。由于AOSP为两个板定义了单个比目鱼 许多定义会在构建时产生冲突并产生问题。这样确保 当建立所需目标时,只有其中一个存在。生成的makefile 包括一个额外的防御检查,当两者都会导致编译器错误 在相同的AOSP根下检测到。
  • 如果工具输出未设置为AOSP根目录,则更喜欢 rsync 将生成的目录结构复制到不同的 cp mv 命令 位置。某些设备配置(例如Pixel / Pixel XL)共享一些根 目录,如果 cp mv 针对错误的基本路径,可能会中断。

经常发现的问题

fuse-ext2

  • fusermount:无法打开/etc/fuse.conf:Permission denied
  • FIX-1:为保险丝组添加低权限用户名(例如:#usermod -a -G fuse anestisb
  • FIX-2:更改文件权限 - #chmod + r /etc/fuse.conf
  • 只有在/etc/fuse.conf中设置’user_allow_other’时,才允许选项allow_other选项allow_other
  • 编辑 /etc/fuse.conf ,并写入/取消注释 user_allow_other 标志

示例

API -24(Nougat)N9 WiFi(别名volantis)从网站下载工厂图片后的鲽鱼供应商一代

$ ./execute-all.sh -d flounder -a volantis -b NRD91D -o /fast-datavault/nexus-vendor-blobs
[*] Setting output base to '/fast-datavault/nexus-vendor-blobs/flounder/nrd91d'

–{ Google Terms and Conditions Downloading of the system image and use of the device software is subject to the Google Terms of Service [1]. By continuing, you agree to the Google Terms of Service [1] and Privacy Policy [2]. Your downloading of the system image and use of the device software may also be subject to certain third-party terms of service, which can be found in Settings > About phone > Legal information, or as otherwise provided.

[1] https://www.google.com/intl/en/policies/terms/ [2] https://www.google.com/intl/en/policies/privacy/

[?] I have read and agree with the above terms and conditions - ACKNOWLEDGE [y|n]: y [*] Downloading image from 'https://dl.google.com/dl/android/aosp/volantis-nrd91d-factory-a27db9bc.zip&#39; –2016-10-05 21:53:17– https://dl.google.com/dl/android/aosp/volantis-nrd91d-factory-a27db9bc.zip Resolving dl.google.com (dl.google.com)… 173.194.76.93, 173.194.76.190, 173.194.76.136, … Connecting to dl.google.com (dl.google.com)|173.194.76.93|:443… connected. HTTP request sent, awaiting response… 200 OK Length: 793140236 (756M) [application/zip] Saving to: ‘/fast-datavault/nexus-vendor-blobs/flounder/nrd91d/volantis-nrd91d-factory-a27db9bc.zip’

s/flounder/nrd91d/volantis-nrd91d-factory-a27db9bc.zip 96%[======================================================================================================================> ] 733.49M 1.22MB/s eta 19s ^/fast-datavault/nexus-vendor-blobs/flounder/nrd91d/vol 100%[==========================================================================================================================>] 756.40M 1.19MB/s in 10m 21s

2016-10-05 22:03:39 (1.22 MB/s) - ‘/fast-datavault/nexus-vendor-blobs/flounder/nrd91d/volantis-nrd91d-factory-a27db9bc.zip’ saved [793140236793140236]

[] Processing with 'API-24 config-naked' configuration [] Extracting '/fast-datavault/nexus-vendor-blobs/flounder/nrd91d/volantis-nrd91d-factory-a27db9bc.zip' [] Unzipping 'image-volantis-nrd91d.zip' [!] No baseband firmware present - skipping [!] System partition doesn't contain any pre-optimized files - link to original partition [] Generating blobs for vendor/htc/flounder [] Copying radio files '/fast-datavault/nexus-vendor-blobs/flounder/nrd91d/vendor/htc/flounder' [] Copying product files & generating 'flounder-vendor-blobs.mk' makefile [] Generating 'device-vendor.mk' [] Generating 'AndroidBoardVendor.mk' [] Bootloader:3.48.0.0139 [] Generating 'BoardConfigVendor.mk' [] Generating 'vendor-board-info.txt' [] Generating 'Android.mk' [] Gathering data from 'vendor/app' APK/JAR pre-builts [] Generating signatures file [] All actions completed successfully [] Import '/fast-datavault/nexus-vendor-blobs/flounder/nrd91d/vendor' to AOSP root

API-23(棉花糖)N5x供应商生成使用工厂图像从文件系统< / h3>
$ ./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
[] Setting output base to '/fast-datavault/nexus-vendor-blobs/bullhead/mtc20k'
[] Processing with 'API-23 config-naked' configuration
[] Extracting '/fast-datavault/nexus-vendor-blobs/bullhead/mtc20k/bullhead-mtc20k-factory-4a950470.zip'
[] Unzipping 'image-bullhead-mtc20k.zip'
[] '20' bytecode archive files will be repaired
[] Repairing bytecode under /system partition using oat2dex method
[] Preparing environment for 'arm' ABI
[] Preparing environment for 'arm64' ABI
[] Start processing system partition & de-optimize pre-compiled bytecode
[!] '/framework/cneapiclient.jar' not pre-optimized with sanity checks passed - copying without changes
[!] '/framework/framework-res.apk' not pre-optimized & without 'classes.dex' - copying without changes
[] '/framework/framework.jar' is multi-dex - adjusting recursive archive adds
[!] '/framework/rcsimssettings.jar' not pre-optimized with sanity checks passed - copying without changes
[!] '/framework/rcsservice.jar' not pre-optimized with sanity checks passed - copying without changes
[] System partition successfully extracted & repaired at '/fast-datavault/nexus-vendor-blobs/bullhead/mtc20k/factory_imgs_repaired_data'
[] Generating blobs for vendor/lge/bullhead
[] Copying radio files '/fast-datavault/nexus-vendor-blobs/bullhead/mtc20k/vendor/lge/bullhead'
[] Copying product files & generating 'bullhead-vendor-blobs.mk' makefile
[] Generating 'device-vendor.mk'
[] Generating 'AndroidBoardVendor.mk'
  [] Bootloader:BHZ10r
  [] Baseband:M8994F-2.6.32.1.13
[] Generating 'BoardConfigVendor.mk'
[] Generating 'vendor-board-info.txt'
[] Generating 'Android.mk'
[] Gathering data from 'vendor/app' APK/JAR pre-builts
[] Gathering data from 'proprietary/app' APK/JAR pre-builts
[] Gathering data from 'proprietary/framework' APK/JAR pre-builts
[] Gathering data from 'proprietary/priv-app' APK/JAR pre-builts
[] Generating signatures file
[] All actions completed successfully
[] Import '/fast-datavault/nexus-vendor-blobs/bullhead/mtc20k/vendor' to AOSP root




相关问题推荐