1.官方流程

## 标准流程 ##下载完代码以后, 在开源项目根目录, 执行以下命令初始化开发环境:$ source build/envsetup.sh创建一个新的机型工程的目录(以demo为例), 后续的移植都在机型目录完成。$ mkdir -p devices/demo
$ cd devices/demo按照如下步骤,完成一个新机型的适配:$ flyme config      # 生成机型配置文件Makefile
$ flyme newproject  # 生成新机型目录
$ flyme patchall    # 自动插桩
$ flyme fullota     # 生成适配完成的ROM包## 冲突处理 ##自动插桩可能会造成代码合并冲突。冲突会以下面的形式标注出来, 开发者需要在厂商的文件中手工解决这些冲突。<<<<<<< VENDOR原厂的代码块
=======Flyme的代码块
>>>>>>> BOSP## 版本升级 ##可以跟随官方发布的最新ROM包,将已经是适配完成的机型升级到最新版本:$ flyme cleanall
$ flyme upgrade

2.个人总结流程及注意事项

  1. 连接手机,打开usb调试,运行flyme config,生成makefile,关于makefile配置
# Makefile Reference
# Please use this file as the project Makefile reference##############################################################################
# The value decides which base device should choose for patchall and upgrade.
# You can configure the property according to your device.
# The default value is base.
# Support values: base, base_cm, base_mt6592 and other devices in the future.
#-----------------------------------------------------------------------------
BASE := base_cm##############################################################################
# The value is used for resource adapter with the aapt tool.
# It depends on the device's resolution.
# The default value is hdpi.
#-----------------------------------------------------------------------------
DENSITY := xhdpi##############################################################################
# The value is used to config the bootanimation.
# It depends on the device's resolution, such as 480x854, 540x960, 720x1280, 1080x1920.
# The default value is nothing.
#-----------------------------------------------------------------------------
RESOLUTION := 720x1280##############################################################################
# The value decides whether use prebuilt image or pack from the BOOT or RECOVERY directory in the vendor directory.
# Support values: boot, recovery or nothing.
# The default value is boot.
# When the value is boot or recovery, the system of build will pack boot.img or recovery.img
# from the BOOT or vendor RECOVERY in the vendor directory which might contain your changes.
# When the value is nothing, the system of build will check boot.img or recovery.img in the project root directory.
# If the boot.img or recovery.img exists, the system of build will use a prebuilt boot.img or recovery.img.
# If the boot.img or recovery.img doesn't exists, the system of build will do nothing.
#-----------------------------------------------------------------------------
vendor_modify_images := boot##############################################################################
# The value decides the directory which you want to remove in the vendor directory for the ota package.
# The default value is app or pri-app which not need to configure.
# You can configure the directory name which relative to the vendor/system directory.
#-----------------------------------------------------------------------------
#vendor_remove_dirs := vendor/operator/app##############################################################################
# The value decides the file which you want to remove in the vendor directory for the ota package.
# The default value is nothing.
# You can configure the file name which relative to the vendor/system directory.
#-----------------------------------------------------------------------------
#vendor_remove_files := bin/zchgd##############################################################################
# The value decides the vendor apk which you want to save in the vendor directory for the ota package.
# The default value is Bluetooth.
# You can configure the apk name in the vendor/system/app or vendor/system/pri-app directory.
#-----------------------------------------------------------------------------
vendor_saved_apps := Bluetooth KeyChain HTMLViewer UserDictionaryProvider BackupRestoreConfirmation \FusedLocation PrintSpooler SharedStorageBackup  ExternalStorageProvider InputDevices \ProxyHandler Shell DefaultContainerService WAPPushManager Stk TimeService qcrilmsgtunnel##############################################################################
# The value decides which vendor apk you want to modify.
# The modify jar will build from the directory named the vendor apk name in the current project root directory.
# eg: vendor_modify_apps := FMRadio
# You need ro decode FMRadio.apk to the project directory(use apktool d FMRadio.apk) first,
# and then you can make it by:   make FMRadio
#-----------------------------------------------------------------------------
#vendor_modify_apps := FMRadio##############################################################################
# The value decides which vendor jar you want to modify.
# The modify jar will build from the *.jar.out directory in the current project root directory.
# eg: vendor_modify_jars := android.policy
# You need to decode android.policy.jar to the project directory (use apktool d android.policy.jar) first,
# and then you can make it by:   make android.policy
#-----------------------------------------------------------------------------
vendor_modify_jars := android.policy framework services telephony-common wifi-service##############################################################################
# The value decides which board system directory you want to save.
# The default value is nothing.
# You can configure the board system directory path which relative to the system directory in the board release.
#-----------------------------------------------------------------------------
#board_saved_dirs := media/audio/ui##############################################################################
# The value decides which board system file you want to save.
# The default value is nothing.
# You can configure the board system file path which relative to the system directory in the board release.
# You should add "lib64/libwebviewchromium.so" for 64 bit system.
#-----------------------------------------------------------------------------
board_saved_files := lib/libwebviewchromium.so  lib64/libwebviewchromium.so  bin/bootanimation  bin/shutdownanimation  media/bootanimation.zip  media/shutdownanimation.zip##############################################################################
# The value decides which board system apk you want to remove.
# The default value is nothing.
# You can configure the board system apk name in the value.
#-----------------------------------------------------------------------------
#board_remove_apps := LogReport##############################################################################
# The value decides which apk you want to modify, when the apk is based on the board system apk.
# The default value is Phone.
# You can configure the board system apk name in the value.
# You can modify the apk with the smali.part file or other method.
# You may need to check if the apk in the BOARD_MODIFY_RESID_APPS(you can see it in build/configs/board_default.mk).
# If in, you may need to change the resource id to "#type@name#t" or "#type@name#a" by the command idtoname.
# The command idtoname how to use: first use "apktool d source/system/framework/framework-res.apk other/TMP/framework-res",
# and then use "idtoname other/TMP/framework-res/res/values/public_master.xml XXXX/smali"(XXXX is the directory where you decode board system apk).
#-----------------------------------------------------------------------------
board_modify_apps := TeleService Keyguard SystemUI Telecom FlymeLauncher MmsService TelephonyProvider##############################################################################
# The value decides which jar you want to modify, when the jar is based on the board framework jar.
# The default value is nothing.
# You can modify the jar with the smali.part file or other method.
# You may need to check if the jar in the BOARD_MODIFY_RESID_APPS(you can see it in build/configs/board_default.mk).
# If in, you may need to change the resource id to "#type@name#t" or "#type@name#a" by the command idtoname.
# The command idtoname how to use: first use "apktool d source/system/framework/framework-res.apk other/TMP/framework-res",
# and then use "idtoname other/TMP/framework-res/res/values/public_master.xml XXXX/smali"(XXXX is the directory where you decode board system jar).
#-----------------------------------------------------------------------------
#board_modify_jars := android.policy##############################################################################
# The value decides which property you will override in the build.prop.
# The default value is nothing.
# You can add the property name in the value from the build.prop.
#-----------------------------------------------------------------------------# The property decide whether hide the soft mainkeys.
# If 1, hide the soft mainkeys. If 0, display the soft mainkeys.
# You should configure the property according to your device.
#override_property += \
#    qemu.hw.mainkeys=0# The value of the property ro.flyme.romer will be contained in the ota package name.
# The default value is Unofficial.
# You should configure the property according to your ID, ie, replace "Unofficial" with your ID.
# The property ro.product.model_romer decide your ID on the backend server which statistical data for your device.
# The default value is Nexus-5_Unofficial.
# You should configure the property according to your device and your ID with replace the "Nexus-5_Unofficial".
override_property += \ro.flyme.romer=wlking \ro.product.model_romer=Lenovo_k30T_wlking##############################################################################
# The value decides which property you will remove from the build.prop.
# The default value is nothing.
# You can add the property name in the value from the build.prop.
#-----------------------------------------------------------------------------
# remove_property += \
#     dev.defaultwallpaper##############################################################################
# Defines whether uses assertions in /META-INF/com/google/android/updater-script of the OTA package.
# Assertions is used to verify the validity of the OTA package.
# Set it to be false when you want to escape the verification.
# Default: true
#-----------------------------------------------------------------------------
#USE_ASSERTIONS_IN_UPDATER_SCRIPT := false##############################################################################
# Defines whether reduces useless resources, only keep the resources of preferred configuration, like current density or locale.
# If set to be true, it will cost much more time to build out a system.img of which the size is reduced.
# Default: false
#-----------------------------------------------------------------------------
#REDUCE_RESOURCES := true##############################################################################
# Defines whether produces an image zipfile suitable for use with 'fastboot update'.
# Default: false
#-----------------------------------------------------------------------------
#PRODUCE_IMAGES_FOR_FASTBOOT := true##############################################################################
# Defines whether generates a block-based OTA, system.img.dat in DAT format will be produced.
# Will fall back to a file-based OTA if the target_files is older and doesn't support block-based OTAs.
# Default: false
#-----------------------------------------------------------------------------
#PRODUCE_BLOCK_BASED_OTA := trueinclude $(PORT_BUILD)/main.mk

2.完成Makefile配置后,将机型的boot.img和recovery.img放入机型目录,然后执行flyme patchall

3.将base_cm目录下的FlymeLauncher、Keyguard、MmsService、SystemUI、Telecom、TeleService、overlay、custom_app.sh、custom_jar.sh文件夹和文件复制到机型目录,然后进行手动patch

4.手动patch完成后,运行flyme fullota进行打包,完成后删除刷机脚本的机型验证方可刷入

5.刷入后,运行adb logcat >1.txt进行log分析

6.打包时遇到问题:

    I: Using Apktool 2.0.0-RC4I: Checking whether sources has changed...I: Smaling smali folder into classes.dex...Exception in thread "main" org.jf.util.ExceptionWithContext: Unsigned short value out of range: 71412at org.jf.dexlib2.writer.DexDataWriter.writeUshort(DexDataWriter.java:116)at org.jf.dexlib2.writer.InstructionWriter.write(InstructionWriter.java:312)at org.jf.dexlib2.writer.DexWriter.writeCodeItem(DexWriter.java:990)at org.jf.dexlib2.writer.DexWriter.writeDebugAndCodeItems(DexWriter.java:769)at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:222)at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:200)at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:57)at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:41)at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:354)at brut.androlib.Androlib.buildSources(Androlib.java:294)at brut.androlib.Androlib.build(Androlib.java:280)at brut.androlib.Androlib.build(Androlib.java:255)at brut.apktool.Main.cmdBuild(Main.java:225)at brut.apktool.Main.main(Main.java:84)

很多开发者之前遇到过framework.jar的函数超过限制,需要拆分,所以在Android 5.0以下的版本,会有诸如framework2.jar, framework-ext.jar, secondary-framework.jar这样的framework拆分包。但Android 5.0不再拆分jar包,而是直接拆分dex包,所以在framework.jar包中,会包含 classes.dex和classes2.dex这两个dex包,同样是为了解决函数超过限制的问题。

当其中某一个dex包的函数数量超过限制,在做apktool重编译时,就会出现如上错误。只需要将部分文件挪到另一个dex包中便可解决这个报错。
(引用:http://blog.chinaunix.net/uid-26816751-id-4933923.html)

Flyme patchrom项目笔记相关推荐

  1. 《BI项目笔记》用Excel2013连接和浏览OLAP多维数据集

    <BI项目笔记>用Excel2013连接和浏览OLAP多维数据集 原文:<BI项目笔记>用Excel2013连接和浏览OLAP多维数据集 用Excel2013连接和浏览OLAP ...

  2. 《BI项目笔记》创建标准维度、维度自定义层次结构

    原文:<BI项目笔记>创建标准维度.维度自定义层次结构

  3. 【Andorid X 项目笔记】动态设置ViewPager的Adapter问题(2)

    由于没有找到嵌套FragmentActivity的方法,只好打算用不同的FragmentPagerAdapter来动态切换ViewPager的,如下: /**      * 首页切换的三个界面     ...

  4. 《BI项目笔记》数据源视图设置

    原文:<BI项目笔记>数据源视图设置 目的 数据源视图是物理源数据库和分析维度与多维数据集之间的逻辑数据模型.在创建数据源视图时,需要在源数据库中指定包含创建维度和多维数据集所需要的数据表 ...

  5. baidu patchrom项目开发详细教程(Being updated)

    linux64位android开发环境 baidu patchrom项目开发 by: doswhy [百度云ROM官方项目组修订] by: colinchen 学习修改 *************** ...

  6. 【Andorid X 项目笔记】禁用ListView的Fling功能(1)

    前言 新的项目正在紧张开发中,初步估计2个月时间开发完成第一版,我负责Android端开发,由于不便过早公布,本系列将命名为"X项目笔记",并于项目结束后最终公布名称.本系列主要记 ...

  7. AppFuse项目笔记(1)

    AppFuse项目笔记(1) 一.Appfuse简介 Appfuse是Matt Raible 开发的一个指导性的入门级J2EE框架,它对如何集成流行的Spring.Hibernate.ibatis.s ...

  8. 品优购项目笔记(十四):微信支付

    品优购项目笔记(十四) 订单 订单三张表关系 提交订单 二维码 介绍 优势 容错级别 qrious二维码生成插件 微信支付 微信支付流程 项目支付流程 生成支付链接 查询是否支付成功 订单 订单三张表 ...

  9. UNIAPP实战项目笔记43 购物车页面修改收货地址和修改默认地址

    UNIAPP实战项目笔记43 购物车页面修改收货地址和修改默认地址 实际案例图片 修改收货地址和修改默认地址页面布局和功能 具体内容图片自己替换哈,随便找了个图片的做示例 用到了vuex的状态机,具体 ...

  10. 仿牛客社区项目笔记-帖子模块(核心)

    仿牛客社区项目笔记-帖子模块(核心) 1. 帖子模块 1.1 过滤敏感词 1.2 发布帖子 1.3 帖子详情 1.4 显示评论 1.5 添加评论 1.6 私信列表 1.7 发送私信 1. 帖子模块 分 ...

最新文章

  1. mysql 支持 pdo_使php支持pdo_mysql_睿合科技
  2. 闪电网络介绍以及试用 (上)
  3. 102 二叉树层序遍历
  4. boost::sort模块使用 string_sort 使用复杂的多部分键对结构进行排序
  5. Dubbo 常见服务治理策略
  6. 树状数组的相关知识 及 求逆序对的运用
  7. windows编程 识别拖动_Quicker 解锁新姿势!Windows 还能这么用?
  8. 朝鲜黑客被指从黑市购买Oracle Solaris 0day,入侵企业网络
  9. so文件动态加载注意事项
  10. [转]Kaldi语音识别
  11. Kotlin中变量不同于Java: var 对val(KAD 02)
  12. x-pack 功能介绍及配置传输层安全性(TLS / SSL)
  13. linux 内核同步机制之complete
  14. Java零基础进阶教程分享,人手一套的javase实用视频教程
  15. 超细!详解AD13:如何从零开始画出一个PCB(电路板)
  16. ASP.net 2.0 中 WebResource.axd 管理资源的一些知识点
  17. 唐人街徒步:在异国情调的纽约感受浓厚的中式气息
  18. APISpace 绕口令API
  19. html复选框打钩行变颜色,Excel 单元格打勾会变颜色,开发工具的复选框这样玩...
  20. vi 撤销上一步操作

热门文章

  1. 大一时写的东西 哈哈~~~~~~~~~~~~
  2. JavaScript基本第一天总结
  3. PHP容器--Pimple运行流程浅析
  4. 李白打酒 递归 C语言
  5. Intellj IDEA 设置默认maven版本
  6. Fragment already added解决
  7. word中实现奇数页和偶数页页眉不同,奇数页使用本章编号和标题,偶数页使用其他统一文字
  8. TSW(Tencent Server Web)源码阅读指南
  9. 古代十二时辰,时辰,时辰对照表,十二时辰与时间对照表,12时辰,时辰表
  10. 一款基于RFID的固定资产管理系统