├── .gitignore ├── LICENSE ├── README.md ├── ZipCenOp.jar ├── coron.patch ├── initbuild.sh └── wineqq.sh /.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # Files for the Dalvik VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # Generated files 12 | bin/ 13 | gen/ 14 | 15 | # Gradle files 16 | .gradle/ 17 | build/ 18 | 19 | # Local configuration file (sdk path, etc) 20 | local.properties 21 | 22 | # Proguard folder generated by Eclipse 23 | proguard/ 24 | 25 | # Log Files 26 | *.log 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2014 luo2888 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | AndroidDevEnvironment_Building_Tools 2 | ==================================== 3 | 4 | 安卓开发环境搭载工具 5 | 6 | 嘉豪仔_Kwan(kwangaho@gmail.com) 7 | 8 | 提供的一键搭载环境工具。 9 | 10 | 代码借鉴:https://github.com/ruling 11 | 12 | 维护者: 13 | 14 | 嘉豪仔_Kwan(https://github.com/GaHoKwan) 15 | 16 | 雨伞先生(https://github.com/APAR1992) 17 | 18 | 下载方法: 19 | 20 | git clone https://github.com/GaHoKwan/AndroidTools 21 | 22 | 使用方法: 23 | 24 | chmod a+x initbuild.sh 25 | 26 | source initbuild.sh 27 | -------------------------------------------------------------------------------- /ZipCenOp.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GaHoKwan/AndroidTools_Thermal/cb5f2082f2007e6320e0ce41a6c35244a61873e2/ZipCenOp.jar -------------------------------------------------------------------------------- /coron.patch: -------------------------------------------------------------------------------- 1 | --- help/help.xml 2 | +++ help.new/help.xml 3 | @@ -8,9 +8,9 @@ 4 | 5 | 6 | 7 | - Here is a long story, we have been telling it for a long time, and still believe somebody will continue it. 8 | + 这是一个很长的故事,我们已经讲了很长一段时间,但我们仍然相信有人会继续。 9 | 10 | - The tale of CORON will never stop. 11 | + CORON的故事永远不会停止 . 12 | 13 | ──────────────────────────────────────────────────────────────────────────────────── 14 | 15 | @@ -26,38 +26,38 @@ 16 | 17 | ──────────────────────────────────────────────────────────────────────────────────── 18 | 19 | - What is CORON? 20 | - * CORON is an open source project for Android ROM porting. 21 | - * With plentiful tools of CORON, developers could board ROM on target device in one step. 22 | - * In CORON, courses of Android porting is available, including video and online tutorials. 23 | + 什么是CORON? 24 | + * CORON是一个开源的Android ROM porting项目. 25 | + * 利用CORON丰富的工具,开发者可以在最快的时间里为一台设备适配上最新的百度云OS. 26 | + * 在CORON里,所有是课程都是可以利用的,包括视频课程和在线课程. 27 | 28 | - Why named CORON? 29 | + 为什么要叫CORON?(此处不作翻译) 30 | * CORON stands for CO-operated RON(m), born to be cooperative with ROM developers; 31 | * CORON stands for RON(m) Over Cloud, provides access of huge remote servers' ablity; 32 | * CORON is also an island, paradise of divers. It shows simple and tasteful feelings. 33 | 34 | - How to use CORON? 35 | - After setup enviornment of CORON, type command `coron` to see the usage. 36 | - The amazing tools may tell you it is so hard to put CORON down. 37 | - You local directory of CORON is like: 38 | + 怎样使用CORON? 39 | + 在初始化CORON环境之后,运行命令'coron'去查看使用方法. 40 | + 神器的工具会让你无法放得下CORON. 41 | + CORON的目录就像这样: 42 | 43 | - coron │ # The root of coron 44 | - ├── manifest │ # Introduce to coron, including tutorials 45 | + coron │ # 这是CORON的根目录 46 | + ├── manifest │ # CORON的介绍文件,包括教程的存放地点 47 | │ │ 48 | - ├── baidu │ # Holding all the baidu concerned 49 | + ├── baidu │ # 所有有关百度的支持 50 | │   ├── frameworks │ 51 | - │   │   └── overlay │ # Overlay resources of framework 52 | - │   └── release │ # Released Apks and Jars 53 | + │   │   └── overlay │ # 百度的框架资源存放地点 54 | + │   └── release │ # 已经发布的apk和jar,也叫百度底包 55 | │ │ 56 | - ├── devices │ # Holding all the porting devices 57 | - │   ├── base │ # The base of all other devices. 58 | - │   └── yourdevice │ # Your own device to be ported 59 | + ├── devices │ # 所有有关百度的参考机型 60 | + │   ├── base │ # 其他所有机型的插桩基础 61 | + │   └── yourdevice │ # 这是你的机型根目录 62 | │ │ 63 | - ├── build │ # Build environment 64 | - └── tools │ # Tools 65 | + ├── build │ # 环境工具 66 | + └── tools │ # 插桩工具 67 | 68 | - CORON open for you forever, hope some day you will join us. 69 | - * BBS : http://bbs.rom.baidu.com/forum-184-1.html 70 | + CORON永远为你敞开,希望有一天你会加入我们 71 | + * BBS论坛 : http://bbs.rom.baidu.com/forum-184-1.html 72 | * QQ : 307235260 73 | * GitHub : https://github.com/baidurom/manifest 74 | 75 | @@ -66,80 +66,77 @@ 76 | 77 | 78 | 79 | - Porting ROM in one step. All the progress of ROM porting will be concentrated in to one step. 80 | + 一键适配百度云OS,所有适配ROM的步骤都会集中在这一步! 81 | 82 | 83 | 84 | 85 | 86 | - Type `help name' to find out more about the `name'. 87 | + 输入 `help name' 去找到更多关于 `name'的. 88 | 89 | 90 | 91 | 92 | 93 | - Genearate the configuration for a new device. 94 | - A Makefile containing all the configurations will be generated. 95 | + 为新设备生成一个Makefile,这个Makefile将会包含所有的配置. 96 | 97 | 98 | 99 | 100 | 101 | - Generate the new project for a new device. 102 | - Only used when setup your device project. 103 | + 为新设备建立一个新项目,只能用在为设备建立新项目上. 104 | 105 | 106 | 107 | 108 | 109 | - Patch all the changes. 110 | - Incorpate all the changes from BOSP to AOSP into VENDOR. 111 | - BOSP : Code of Baidu Open Source Project 112 | - AOSP : Code Android Open Source Project 113 | - VENDOR: Code pulled out from the device 114 | + 应用所有的百度的修改(插桩). 115 | + 将AOSP和BOSP产生的修改合并到原厂代码上. 116 | + BOSP : 百度开源代码 117 | + AOSP : 安卓开源代码 118 | + VENDOR: 设备原厂代码 119 | 120 | - The codes of VENDOR are located in the root directory of your device. 121 | - The codes of AOSP and BOSP are located in the autopatch directory of your device. 122 | + 原厂代码位于你的机型根目录. 123 | + AOSP和BOSP位于机型根目录的autopatch目录里. 124 | 125 | 126 | 127 | 128 | 129 | - Resolve conflicts. 130 | - After patchall, conflicts might happen, autofix could help you 131 | - to resolve some of them automatically. 132 | + 解决冲突. 133 | + 运行patchall之后, reject冲突就会发生, autofix会自动帮你解决冲突. 134 | 135 | 136 | 137 | 138 | 139 | - Fully make out the ota package. 140 | - An OTA package will be generated, you could flash it into your device. 141 | + 制作一个完整的刷机包. 142 | + 一个完整的刷机包将会在out目录下生成,你应该把它刷入你的手机. 143 | 144 | 145 | 146 | 147 | 148 | - Patch the upgrade changes. You could upgrade your device to the latest. 149 | + 应用所有的更新修改,你可以升级你的设备到最新. 150 | 151 | 152 | 153 | 154 | 155 | 156 | - Porting changes from an existing device to another. 157 | + 从现有的设备参考制作百度云OS. 158 | 159 | 160 | 161 | 162 | 163 | - Clean the project output. 164 | + 清理项目输出的文件. 165 | 166 | 167 | 168 | 169 | 170 | - Clean all the project unneccessary files, inluding baidu/ and out/. 171 | + 清理项目不需要的文件,包括机型目录下的baidu目录和out目录. 172 | 173 | 174 | 175 | @@ -153,164 +150,164 @@ 176 | 177 | 178 | 179 | - Can not find device 180 | + 找不到设备 181 | 182 | 183 | - Please make sure your device has been connected. 184 | + 请确认你的设备已经连接. 185 | 186 | 187 | 188 | 189 | 190 | - Can not aquire ROOT permission 191 | + 无法获取root权限 192 | 193 | 194 | 195 | - See how to root your device: 196 | + 前往查看如何为设备获取root权限: 197 | [http://bbs.rom.baidu.com/thread-125299-1-1.html] 198 | 199 | - You could also use tool to root: 200 | + 你也可以使用工具去获取root权限: 201 | [http://root.baidu.com] 202 | 203 | 204 | 205 | 206 | 207 | - Unpack bootimg failed. Your boot.img or recovery.img might be imformal that could not be unpacked out. 208 | + 解包镜像失败,boot.img或者recovery.img非常规格式. 209 | 210 | 211 | - Solution Advice: 212 | + 建议解决方案: 213 | ---------------- 214 | - Using the following command to check whether your image can be unpacked: 215 | + 使用以下命令来确认镜像是否能被CORON解包: 216 | $ unpack_bootimg recovery.img 217 | 218 | - If unpack failed, use another recovery.img. 219 | + 如果解包失败,请使用其他镜像或者上网搜索解包方式. 220 | 221 | 222 | 223 | 224 | 225 | - Pack bootimg failed. Your boot.img or recovery.img might be imformal that could not be packed back. 226 | + 打包镜像失败,boot.img或者recovery.img非常规格式 227 | 228 | 229 | - Solution Advice: 230 | + 建议解决方案: 231 | ---------------- 232 | - Using the following command to check whether your image can be unpacked: 233 | + 使用以下命令来确认镜像是否能被打包: 234 | $ pack_bootimg image_out/ 235 | 236 | - If pack failed, unpack your boot image again. 237 | + 如果打包失败,请重新解包你的boot.img或者recovery.img. 238 | 239 | 240 | 241 | 242 | 243 | - devices/base not found! 244 | + 找不到devices/base! 245 | 246 | 247 | - Solution Advice: 248 | + 建议解决方案: 249 | ---------------- 250 | - Make sure you have synced the base from coron, and the path is devices/base. 251 | - If devices/base not exists, try to use "repo sync" to sync coron again. 252 | + 请确认devices/base有一个coron base. 253 | + 如果没有devices/base not, 请尝试使用 "repo sync" 去重新同步源码. 254 | 255 | - Or, you could use the following command to get devices/base separately: 256 | + 或者,你可以使用以下命令去单独同步devices/base: 257 | $ git clone https://github.com/baidurom/devices/base 258 | 259 | 260 | 261 | 262 | 263 | - Failed to pull boot.img and recovery.img from your phone. 264 | + 无法从手机里拉取 boot.img 和 recovery.img. 265 | 266 | 267 | - Check adb devices is fine and your phone is su root! 268 | + 请确保adb正常工作并让你的设备获取root权限! 269 | 270 | 271 | 272 | 273 | 274 | - Wrong parameters for this command.... 275 | + 命令参数错误.... 276 | 277 | 278 | - Please read the usage of this command or ask for help in http://bbs.rom.baidu.com 279 | + 请阅读这个命令的使用方法或者到百度云OS论坛寻求帮助 http://bbs.rom.baidu.com 280 | 281 | 282 | 283 | 284 | 285 | - Failed to autocomplete missed method in android.policy and Phone. 286 | + 未能为android.policy 和 Phone自动补全方法. 287 | 288 | 289 | - Please check you have Phone.apk and in vendor/system/app and it can be decode correctly. 290 | - try $ apktool d vendor/system/app/Phone.apk 291 | - If you don't have Phone.apk, it must be renamed to someoneelse, find it and rename to Phone.apk. 292 | - if the decode of Phone.apk is failed, just remove the Phone.apk in vendor/system/app, then go on! 293 | + 请检查是否有 Phone.apk 在 vendor/system/app 里,还要确认其是否能被反编译. 294 | + 尝试输入 $ apktool d vendor/system/app/Phone.apk 295 | + 如果你没有 Phone.apk, 那么它一定是被某人或者厂商修改了,请找到它并改名为 Phone.apk. 296 | + 如果反编译失败,请删除它,然后继续. 297 | 298 | 299 | 300 | 301 | 302 | - Failed to replace method to bosp. 303 | + 无法把函数方法替换成BOSP的. 304 | 305 | 306 | - Make sure both of the vendor and bosp have this smali file! 307 | - And the method name is fine, such as 308 | + 请确认原厂代码和BOSP中都含有这个smali文件! 309 | + 如果函数方法是正确的, 就像这样 310 | $ methodtobosp services.jar.out/smali/com/android/server/am/ActivityManagerService.smali 'moveTaskToFront(IILandroid/os/Bundle;)V' 311 | 312 | 313 | 314 | 315 | 316 | - Failed to replace smali file to bosp. 317 | + 无法把smali文件替换为BOSP的. 318 | 319 | 320 | - Make sure both of the vendor and bosp have this smali file! 321 | + 请确认原厂代码和BOSP中都含有这个smali文件! 322 | 323 | 324 | 325 | - 326 | + 327 | 328 | - Failed to replace smali file to bosp. 329 | + 无法把smali文件替换为BOSP的. 330 | 331 | 332 | - Make sure both of the vendor and bosp have this smali file! 333 | + 请确认原厂代码和BOSP中都含有这个smali文件! 334 | 335 | 336 | 337 | 338 | 339 | - Failed to use apktool build apk back. 340 | + 无法使用apktool回编译这个apk. 341 | 342 | 343 | - Make sure you don't install any framework resource after you decode the apk, 344 | - otherwise you should install the framework resource which match your apk, then build again 345 | + 请确认你在反编译这个apk后没有再安装过任何资源框架, 346 | + 你可以使用以下命令重新安装资源框架 347 | $ ifdir xxx/system/framework 348 | - Example: 349 | - If you want build out's apk, you better install out's framework first! 350 | + 例子: 351 | + 如果你想回编译原厂apk,那么你必须使用以下命令安装原厂的资源框架! 352 | $ ifdir out/merged_target_files/SYSTEM/framework/ 353 | 354 | 355 | 356 | 357 | 358 | - Failed to use apktool d xxx.apk. 359 | + 无法反编译这个apk. 360 | 361 | 362 | - Make sure the destination directory doesn't exist! 363 | - And install framework resource first 364 | + 请确认目标文件夹不存在! 365 | + 还有,在反编译之前,你必须先安装资源框架. 366 | $ ifdir xxx/system/framework 367 | - Example: 368 | - If you want decode baidu's apk, you better install baidu's framework first! 369 | + 例子: 370 | + 如果你想反编译百度的apk,那么你必须先使用以下命令安装百度的资源框架! 371 | $ ifdir baidu/system/framework 372 | 373 | 374 | 375 | 376 | 377 | - Failed to deodex ota.zip/target-files.zip. 378 | + 无法在ota.zip/target-files.zip里合并odex. 379 | 380 | 381 | - You can try to update the smali.jar and baksmali.jar in tools/apktools/, which can be download from http://code.google.com 382 | - If it doesn't work, you better find some other tools to deodex. 383 | + 请更新在tools/apktools/里的smali.jar和baksmali.jar, 可以在这里下载 http://code.google.com 384 | + 如果它无法工作 那么你可以寻找其他合并odex的工具. 385 | 386 | 387 | 388 | --- help/help_config.xml 389 | +++ help.new/help_config.xml 390 | @@ -4,18 +4,18 @@ 391 | 392 | 393 | 394 | - Error: makeconfig, command not found 395 | + 未能进行: makeconfig, 找不到命令 396 | 397 | 398 | - Solution Advice: 399 | + 建议解决方案: 400 | 401 | - 1. Make sure you have setup enviornment by execute: 402 | + 1. 请确认你是否运行了环境安装命令: 403 | $ source build/envsetup.sh 404 | 405 | - 2. makeconfig must be executable, to check it: 406 | + 2. 请确保makeconfig文件必须是可执行的: 407 | $ ls -l build/tools/makeconfig 408 | 409 | - you might make it executable by: 410 | + 你可以这样让makeconfig变成可执行文件: 411 | $ chmod a+x build/tools/makeconfig 412 | 413 | 414 | @@ -23,28 +23,28 @@ 415 | 416 | 417 | 418 | - Makefile already exist! 419 | + Makefile已经存在! 420 | 421 | 422 | - Remove Makefile and Retry. 423 | + 请把Makefile文件删除并最好准备. 424 | 425 | 426 | 427 | 428 | 429 | - The ota.zip is a incompatible ota package. 430 | + 这不是一个标准格式的卡刷包,coron不兼容该卡刷包! 431 | 432 | 433 | - Check whether META-INF and system directory are in ota.zip 434 | + 请检查META-INF和system文件夹是否在卡刷包里! 435 | 436 | 437 | 438 | 439 | 440 | - Mission Failed, as catching a Runtime Error. 441 | + 任务失败了,抓到一个运行时发生的错误. 442 | 443 | 444 | - Check the build log ! 445 | + 请检查日志文件(build log)! 446 | 447 | 448 | 449 | --- help/help_fullota.xml 450 | +++ help.new/help_fullota.xml 451 | @@ -4,20 +4,20 @@ 452 | 453 | 454 | 455 | - Failed to run ota_from_target_files to generate an ota zip from target-files.zip 456 | + 未能运行ota_from_target_files从target-files.zip生成一个ota.zip 457 | 458 | 459 | - If the exception is java.lang.OutOfMemoryError, you should add the follow line to your Makefile before include $(PORT_ROOT)/main.mk 460 | + 如果出现java.lang.OutOfMemoryError报错, 你应该在Makefile的include $(PORT_ROOT)/main.mk前面加上: 461 | SIGN_OTA := false 462 | 463 | 464 | 465 | 466 | 467 | - Failed to generate the system.img from target-files.zip. 468 | + 未能从target-files.zip上生成一个system.img. 469 | 470 | 471 | - You can add the follow line to your Makefile before include $(PORT_ROOT)/main.mk 472 | + 你应该在Makefile的include $(PORT_ROOT)/main.mk前面加上: 473 | NO_SYSTEM_IMG := true 474 | 475 | 476 | --- help/help_newproject.xml 477 | +++ help.new/help_newproject.xml 478 | @@ -3,64 +3,64 @@ 479 | 480 | 481 | 482 | - Can not find recovery.fstab ! 483 | + 找不到recovery分区表文件 recovery.fstab ! 484 | 485 | 486 | - Prepare a recovery.fstab in current project directory ! 487 | + 请准备好一个recovery分区表文件(recovery.fstab)放入当前工程目录! 488 | 489 | 490 | 491 | 492 | 493 | - Can not find ota.zip ! 494 | + 找不到 ota.zip ! 495 | 496 | 497 | - Prepare a ota.zip in current project directory ! 498 | + 请准备好一个recovery卡刷包(ota.zip)放在当前工程目录下 ! 499 | 500 | 501 | 502 | 503 | 504 | - The ota.zip is a incompatible ota package. 505 | + 这不是一个标准格式的卡刷包,coron不兼容该卡刷包! 506 | 507 | 508 | - Check whether META-INF and system directory are in ota.zip 509 | + 请检查META-INF和system文件夹是否在卡刷包里! 510 | 511 | 512 | 513 | 514 | 515 | - Can not find out/oem_target_files.zip ! 516 | + 找不到 out/oem_target_files.zip ! 517 | 518 | 519 | - Make clean, and Retry ! 520 | + 输入Make clean, 并做好准备 ! 521 | 522 | 523 | 524 | 525 | 526 | - Mission Failed, as catching a Runtime Error. 527 | + 任务失败了,抓到一个运行时发生的错误. 528 | 529 | 530 | - Check the build log ! 531 | + 请检查日志文件(build log)! 532 | 533 | 534 | 535 | 536 | 537 | - Can not find recovery.img ! 538 | + 找不到 recovery.img ! 539 | 540 | 541 | - Prepare a recovery.img or recovery.fstab in current project directory ! 542 | + 请准备好一个recovery镜像文件(recovery.img)或者recovery分区表文件(recovery.fstab)放在当前工程目录 ! 543 | 544 | 545 | 546 | 547 | 548 | - Can not find boot.img ! 549 | + 找不到 boot.img ! 550 | 551 | 552 | - Prepare a boot.img in current project directory, Or not set boot in vendor_modify_images[Makefile] ! 553 | + 请准备好一个boot.img内核镜像放在当前工程目录或者不要在Makefile的vendor_modify_images上设置boot ! 554 | 555 | 556 | 557 | --- help/help_patchall.xml 558 | +++ help.new/help_patchall.xml 559 | @@ -8,16 +8,16 @@ 560 | 561 | 562 | 563 | - 564 | + 565 | 566 | ──────────────────────────────────────────────────────────────────────────────────── 567 | 568 | - Advice: 569 | - 1. Although no conflict, mistakes still come out sometimes, 570 | - it depends on your device, VENDOR may change AOSP a lot. 571 | + 建议: 572 | + 1. 即使没有冲突(reject),但是错误有时候还是会出现的, 573 | + 这取决于你的手机厂商,他们通常都会对AOSP进行很多修改. 574 | 575 | - 2. You could go on to run fullota, flash the outcom into your device, 576 | - and then fix bugs depends on real-time logs. 577 | + 2. 你应该去运行fullota,刷入make出来的包, 578 | + 然后利用实时日志(log)去分析并修复bug. 579 | 580 | ──────────────────────────────────────────────────────────────────────────────────── 581 | 582 | @@ -27,26 +27,25 @@ 583 | 584 | ──────────────────────────────────────────────────────────────────────────────────── 585 | 586 | - Advice: 587 | - 1. Each conflict is marked out like: 588 | + 建议: 589 | + 1. 每个冲突(conflict)都会像这样标记出来: 590 | 591 | <<<<<<< VENDOR 592 | - Codes of VENDOR 593 | + 原厂代码 594 | ======= 595 | - Codes of BOSP 596 | + BOSP 597 | >>>>>>> BOSP 598 | 599 | - you'd better resolve all conflicts before going on with the following work. 600 | + 你最好在解决所有的冲突之前进行如下操作. 601 | 602 | - 2. You might follow three steps to resolve conflicts manually: 603 | - - compare VENDOR and REJECT to find out where conflicts happened; 604 | - - compare AOSP and BOSP to find out where Baidu changes; 605 | - - compare VENDOR and BOSP to decide how to resolve conflicts. 606 | + 2. 你可以按照这3个步骤来解决冲突: 607 | + - 对比原厂代码和reject冲突来寻找哪里发生冲突; 608 | + - 对比autopatch目录下的AOSP和BOSP来寻找百度云对AOSP作了什么修改; 609 | + - 对比原厂代码和BOSP来决定应该怎样去解决冲突. 610 | 611 | - 3. You might issue 'coron autofix' to resolve conflicts automatically 612 | + 3. 你可以使用'coron autofix'命令让它去自动解决冲突 613 | 614 | - If you do not know the definition of AOSP, BOSP or VENDOR, type the command 615 | - to see what are they: 616 | + 如果你不知道vendor(原厂代码),AOSP,BOSP是什么,请输入以下命令去看他们是什么: 617 | $ coron help patchall 618 | ──────────────────────────────────────────────────────────────────────────────────── 619 | 620 | --- help/help_upgrade.xml 621 | +++ help.new/help_upgrade.xml 622 | @@ -5,12 +5,12 @@ 623 | 624 | ──────────────────────────────────────────────────────────────────────────────────── 625 | 626 | - Advice: 627 | - 1. Although no conflict, mistakes still come out sometimes, 628 | - it depends on your device, VENDOR may change AOSP a lot. 629 | + 建议: 630 | + 1. 即使没有冲突(reject),但是错误有时候还是会出现的, 631 | + 这取决于你的手机厂商,他们通常都会对AOSP进行很多修改. 632 | 633 | - 2. You could go on to run fullota, flash the outcom into your device, 634 | - and then fix bugs depends on real-time logs. 635 | + 2. 你应该去运行fullota,刷入make出来的包, 636 | + 然后利用实时日志(log)去分析并修复bug. 637 | 638 | ──────────────────────────────────────────────────────────────────────────────────── 639 | 640 | @@ -20,21 +20,21 @@ 641 | 642 | ──────────────────────────────────────────────────────────────────────────────────── 643 | 644 | - Advice: 645 | - 1. Each conflict is marked out like: 646 | + 建议: 647 | + 1. 每个冲突(conflict)都会像这样标记出来: 648 | 649 | <<<<<<< VENDOR 650 | - Codes of VENDOR 651 | + 原厂代码 652 | ======= 653 | - Codes of BOSP 654 | + BOSP代码 655 | >>>>>>> BOSP 656 | 657 | - you'd better resolve all conflicts before going on with the following work. 658 | + 你最好在解决所有的冲突之前进行如下操作. 659 | 660 | - 2. You might follow three steps to resolve conflicts: 661 | - - compare VENDOR and REJECT to find out where conflicts happened; 662 | - - compare AOSP and BOSP to find out where Baidu changes; 663 | - - compare VENDOR and BOSP to decide how to resolve conflicts. 664 | + 2. 你可以按照这3个步骤来解决冲突: 665 | + - 对比原厂代码和reject冲突来寻找哪里发生冲突; 666 | + - 对比AOSP和BOSP来寻找百度云对AOSP做了什么修改; 667 | + - 对比原厂代码和BOSP来决定应该怎样去解决冲突. 668 | 669 | ──────────────────────────────────────────────────────────────────────────────────── 670 | 671 | -------------------------------------------------------------------------------- /initbuild.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo -e "\e[40;32;1m" 3 | clear 4 | username=`whoami` 5 | thisDir=`pwd` 6 | 7 | #Environment Tools 8 | addRulesFunc(){ 9 | read mIdVendor mIdProduct 10 | echo "SUBSYSTEM==\"usb\", ATTR{idVendor}==\""$mIdVendor"\", ATTR{idProduct}==\""$mIdProduct"\", MODE=\"0600\", OWNER=\"$username\"" | sudo tee -a /etc/udev/rules.d/51-android.rules 11 | sudo /etc/init.d/udev restart 12 | } 13 | 14 | addRules(){ 15 | clear 16 | lsusb 17 | echo -e "\nOK 上面列出了所有USB列表,大致内容如下:\n" 18 | echo -e "\033[40;37;7mBus 00x Device 00x: ID \033[40;34;7mxxxx\033[40;32;1m:\033[40;33;7mxxxx\033[40;30;0m \033[40;31;7mxxxxxxxxxxxxx\033[40;31;0m" 19 | echo -e "\e[40;32;1m" 20 | echo -e "如上,蓝色字符串为idVendor,黄色字符串为idProduct\n红色的是一些厂商信息(也可能没有)" 21 | echo -e "找第三个里面有没有你的手机厂商的名字,如:HUAWEI,ZTE 什么的" 22 | echo -e "当然没找到没关系,第三个什么都没有的就是了\n把idVendor和idProduct 打在下面,空格隔开,如:19d2 ffd0" 23 | echo -ne "\n输入:" 24 | addRulesFunc 25 | echo -e "添加成功" 26 | } 27 | 28 | installadbini(){ 29 | echo -e "正在安装adb_usb.ini环境" 30 | cd $thisDir 31 | git clone https://github.com/GaHoKwan/adbusbini 32 | if [ "$?" -ne "0" ];then 33 | echo -e "下载环境配置文件错误,请检查错误!" 34 | else 35 | sudo rm -rf ~/.android 36 | sudo mv $thisDir/adbusbini ~/.android 37 | fi 38 | } 39 | 40 | installadb(){ 41 | echo -e "\n配置adb环境变量..." 42 | sudo apt-get update 43 | sudo apt-get install android-tools-adb android-tools-fastboot 44 | installadbini 45 | curl https://raw.githubusercontent.com/GaHoKwan/Android-udev-rules/master/51-android.rules > $thisDir/51-android.rules 46 | cd $thisDir 47 | sudo cp 51-android.rules /etc/udev/rules.d/ 48 | sudo chmod a+rx /etc/udev/rules.d/51-android.rules 49 | sudo /etc/init.d/udev restart 50 | echo "export PATH=$PATH:~/bin/" | sudo tee -a /etc/profile 51 | source /etc/profile 52 | sudo adb kill-server 53 | sudo adb devices 54 | echo "\n配置环境完成" 55 | } 56 | 57 | installia32(){ 58 | if [ "$kind" == "" ]; then 59 | echo -e "\n开始安卓开发环境..." 60 | echo -e "请选择使用的系统版本:" 61 | echo -e "\t1. ubuntu 12.04 及以下(此项不安装编译环境)" 62 | echo -e "\t2. 其他(包括deepin等基于ubuntu的系统)" 63 | echo -en "选择:" 64 | read kind 65 | echo -e "\n开始配置32位运行环境..." 66 | fi 67 | if [ "$kind" == "1" ]; then 68 | sudo apt-get install ia32-libs 69 | elif [ "$kind" == "2" ]; then 70 | #start 71 | cd /etc/apt/sources.list.d #进入apt源列表 72 | echo "deb http://old-releases.ubuntu.com/ubuntu/ raring main restricted universe multiverse" | sudo tee ia32-libs-raring.list 73 | #添加ubuntu 13.04的源,因为13.10的后续版本废弃了ia32-libs 74 | sudo apt-get update #更新一下源 75 | if [ "$?" == "0" ]; then 76 | echo -e "下载完成" 77 | else 78 | echo -e "下载失败,正在重新尝试" 79 | sudo apt-get update 80 | fi 81 | sudo apt-get install ia32-libs #安装ia32-libs 82 | if [ "$?" == "0" ]; then 83 | echo -e "下载完成" 84 | else 85 | echo -e "下载失败,正在重新尝试" 86 | sudo apt-get install ia32-libs 87 | fi 88 | sudo rm ia32-libs-raring.list #恢复源 89 | sudo apt-get update #再次更新下源 90 | #end 91 | else 92 | initSystemConfigure 93 | fi 94 | } 95 | 96 | initSystemConfigure(){ 97 | clear 98 | echo -e "请输入你想安装的环境" 99 | echo -e "\t1.ia32运行库" 100 | echo -e "\t2.JavaSE(Oracle Java JDK)" 101 | echo -e "\t3.aosp&cm&recovery编译环境" 102 | echo -e "\t4.adb运行环境" 103 | echo -e "\t5.AndroidSDK运行环境" 104 | echo -e "\t6.hosts环境" 105 | echo -e "\t7.安卓开发必备环境(上面1234)" 106 | echo -ne "\n选择:" 107 | read configurechoose 108 | case $configurechoose in 109 | 1) 110 | installia32 111 | read -p "按回车键继续..." 112 | ;; 113 | 2) 114 | installJavaSE 115 | read -p "按回车键继续..." 116 | ;; 117 | 3) 118 | DevEnvSetup 119 | read -p "按回车键继续..." 120 | ;; 121 | 4) 122 | installadb 123 | read -p "按回车键继续..." 124 | ;; 125 | 5) 126 | installsdk 127 | ;; 128 | 6) 129 | addhosts 130 | read anykey 131 | ;; 132 | 7) 133 | echo -e "\n开始安卓开发环境..." 134 | echo -e "请选择使用的系统版本:" 135 | echo -e "注意:由于apt源的完整性不足,选择1则不会安装编译环境" 136 | echo -e "\t1. ubuntu 12.04 及以下(此项不安装编译环境)" 137 | echo -e "\t2. 其他(包括deepin等基于ubuntu14.04的系统)" 138 | echo -e "\t3. Linux mint 17(此项不安装ia32因为Mint系统自带)" 139 | echo -en "选择:" 140 | read kind 141 | if [ "$kind" == "1" ]; then 142 | installrepo 143 | installia32 144 | installJavaSE 145 | installadb 146 | elif [ "$kind" == "2" ]; then 147 | installrepo 148 | installia32 149 | installJavaSE 150 | installadb 151 | DevEnvSetup 152 | elif [ "$kind" == "3" ]; then 153 | installrepo 154 | installJavaSE 155 | installadb 156 | DevEnvSetup 157 | else 158 | initSystemConfigure 159 | fi 160 | read -p "按回车键继续..." 161 | ;; 162 | esac 163 | } 164 | 165 | addhosts(){ 166 | echo -e "安装或更新hosts请按1,还原hosts请按2" 167 | echo -ne "\n选择:" 168 | read hostchoose 169 | case $hostchoose in 170 | 1) 171 | curl https://raw.githubusercontent.com/txthinking/google-hosts/master/hosts > $thisDir/hosts 172 | sudo mv /etc/hosts /etc/hosts.bak 173 | sudo cp -f $thisDir/hosts /etc/hosts 174 | rm -rf $thisDir/hosts 175 | echo -e "hosts安装完成!" 176 | ;; 177 | 2) 178 | if [ `grep -rl youtube /etc/hosts` == "/etc/hosts" ]; then 179 | sudo mv /etc/hosts.bak /etc/hosts 180 | else 181 | echo -e "host已被还原过或者你没有安装过hosts" 182 | fi 183 | ;; 184 | esac 185 | read -p "按回车键继续..." 186 | } 187 | 188 | 189 | installsdk(){ 190 | echo 191 | echo "下载和配置 Android SDK!!" 192 | echo "请确保 unzip 已经安装" 193 | echo 194 | sudo apt-get install unzip -y 195 | if [ `getconf LONG_BIT` = "64" ];then 196 | echo 197 | echo "正在下载 Linux 64位 系统的Android SDK" 198 | wget http://dl.google.com/android/adt/adt-bundle-linux-x86_64-20140702.zip 199 | echo "下载完成!!" 200 | echo "展开文件" 201 | mkdir ~/adt-bundle 202 | mv adt-bundle-linux-x86_64-20140702.zip ~/adt-bundle/adt_x64.zip 203 | cd ~/adt-bundle 204 | unzip adt_x64.zip 205 | mv -f adt-bundle-linux-x86_64-20140702/* . 206 | echo "正在配置" 207 | echo -e '\n# Android tools\nexport PATH=${PATH}:~/adt-bundle/sdk/tools\nexport PATH=${PATH}:~/adt-bundle/sdk/platform-tools\nexport PATH=${PATH}:~/bin' >> ~/.bashrc 208 | echo -e '\nPATH="$HOME/adt-bundle/sdk/tools:$HOME/adt-bundle/sdk/platform-tools:$PATH"' >> ~/.profile 209 | echo "完成!!" 210 | else 211 | echo 212 | echo "正在下载 Linux 32位 系统的Android SDK" 213 | wget http://dl.google.com/android/adt/adt-bundle-linux-x86-20140702.zip 214 | echo "下载完成!!" 215 | echo "展开文件" 216 | mkdir ~/adt-bundle 217 | mv adt-bundle-linux-x86-20140702.zip ~/adt-bundle/adt_x86.zip 218 | cd ~/adt-bundle 219 | unzip adt_x86.zip 220 | mv -f adt-bundle-linux-x86_64-20140702/* . 221 | echo "正在配置" 222 | echo -e '\n# Android tools\nexport PATH=${PATH}:~/adt-bundle/sdk/tools\nexport PATH=${PATH}:~/adt-bundle/sdk/platform-tools\nexport PATH=${PATH}:~/bin' >> ~/.bashrc 223 | echo -e '\nPATH="$HOME/adt-bundle/sdk/tools:$HOME/adt-bundle/sdk/platform-tools:$PATH"' >> ~/.profile 224 | echo "完成!!" 225 | fi 226 | rm -Rf ~/adt-bundle/adt-bundle-linux-x86_64-20140702 227 | rm -Rf ~/adt-bundle/adt-bundle-linux-x86-20140702 228 | rm -f ~/adt-bundle/adt_x64.zip 229 | rm -f ~/adt-bundle/adt_x86.zip 230 | read -p "按回车键继续..." 231 | } 232 | 233 | installkitchen(){ 234 | echo "安装安卓厨房" 235 | sudo apt-get install git -y 236 | cd ~/ 237 | git clone https://github.com/kuairom/Android_Kitchen_cn 238 | if [ "$?" -ne "0" ];then 239 | read -p "安装失败,请检查报错信息,按回车键继续" 240 | main 241 | fi 242 | echo "安卓厨房已下载到主文件夹的Android_Kitchen_cn目录里!" 243 | read -p "按回车键继续..." 244 | } 245 | 246 | installJavaSE(){ 247 | sudo apt-get update 248 | echo -e "\n开始安装oracle java developement kit..." 249 | sleep 1 250 | sudo add-apt-repository ppa:webupd8team/java 251 | sudo apt-get update && sudo apt-get install oracle-java6-installer 252 | if [ "$?" == "0" ]; then 253 | echo -e "下载完成" 254 | else 255 | echo -e "下载失败,正在重新尝试" 256 | sudo apt-get install openjdk-7-jdk 257 | fi 258 | echo -e "\n安装openjdk7..." 259 | sleep 1 260 | sudo apt-get install openjdk-7-jdk 261 | if [ "$?" == "0" ]; then 262 | echo -e "下载完成" 263 | else 264 | echo -e "下载失败,正在重新尝试" 265 | sudo apt-get install openjdk-7-jdk 266 | fi 267 | read -p "按回车键继续..." 268 | echo 'alias jar-switch="sudo update-alternatives --config jar"' | sudo tee -a ~/.bashrc 269 | echo -e "你可以使用jar-switch命令来切换jar版本" 270 | echo 'alias java-switch="sudo update-alternatives --config java"' | sudo tee -a ~/.bashrc 271 | echo 'alias javac-switch="sudo update-alternatives --config javac"' | sudo tee -a ~/.bashrc 272 | echo 'alias javah-switch="sudo update-alternatives --config javah"' | sudo tee -a ~/.bashrc 273 | echo 'alias javap-switch="sudo update-alternatives --config javap"' | sudo tee -a ~/.bashrc 274 | source ~/.bashrc 275 | echo -e "你可以使用java(c/h/p)-switch命令来切换java(c/h/p)版本" 276 | } 277 | 278 | DevEnvSetup(){ 279 | echo -e "\n开始安装ROM编译环境..." 280 | sudo apt-get install bison ccache libc6 build-essential curl flex g++-multilib g++ gcc-multilib git-core gnupg gperf x11proto-core-dev tofrodos libx11-dev:i386 libgl1-mesa-dev libreadline6-dev:i386 libgl1-mesa-glx:i386 lib32ncurses5-dev libncurses5-dev:i386 lib32readLine-gplv2-dev lib32z1-dev libesd0-dev libncurses5-dev libsdl1.2-dev libwxgtk2.8-dev python-markdown libxml2 libxml2-utils lzop squashfs-tools xsltproc pngcrush schedtool zip zlib1g-dev:i386 zlib1g-dev 281 | if [ "$?" == "0" ]; then 282 | echo -e "下载完成" 283 | else 284 | echo -e "下载失败,正在重新尝试" 285 | DevEnvSetup 286 | fi 287 | sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so 288 | } 289 | 290 | #Development tools 291 | installrepo(){ 292 | mkdir -p ~/bin 293 | curl https://raw.githubusercontent.com/FlymeOS/manifest/lollipop-5.0/repo > ~/bin/repo 294 | chmod a+x ~/bin/repo 295 | } 296 | 297 | repoSource(){ 298 | if [ ! -f ~/bin/repo ]; then 299 | installrepo 300 | fi 301 | clear 302 | echo -e "------ 同步源码 ------" 303 | echo -e "请输入存放源码的地址(可直接把文件夹拖进来):" 304 | echo -ne "\n输入:" 305 | read sDir 306 | cd ${sDir//\'//} 307 | repo init -u https://github.com/FlymeOS/manifest.git -b lollipop-5.0 308 | repo sync-j4 309 | if [ "$?" == "0" ]; then 310 | echo -e "同步完成" 311 | else 312 | echo -e "同步失败,正在重新尝试" 313 | repo sync -c --no-clone-bundle -j4 314 | fi 315 | cd $thisDir 316 | read -p "按回车键继续..." 317 | } 318 | 319 | fastrepoSource(){ 320 | if [ ! -f ~/bin/repo ]; then 321 | installrepo 322 | fi 323 | clear 324 | echo -e "------ 跳过谷歌验证,快速同步源码 ------" 325 | echo -e "请输入存放源码的地址(可直接把文件夹拖进来):" 326 | echo -ne "\n输入:" 327 | read sDir 328 | cd ${sDir//\'//} 329 | repo init --repo-url git://github.com/FlymeOS/repo.git -u https://github.com/FlymeOS/manifest.git -b lollipop-5.0 --no-repo-verify 330 | repo sync -c --no-clone-bundle -j4 331 | if [ "$?" == "0" ]; then 332 | echo -e "同步完成" 333 | else 334 | echo -e "同步失败,正在重新尝试" 335 | repo sync -c --no-clone-bundle -j4 336 | fi 337 | read -p "按回车键继续..." 338 | cd $thisDir 339 | } 340 | 341 | logcat(){ 342 | echo -e "这是抓取log的工具,过程中按ctrl+c退出" 343 | echo -e "是否打开logcat颜色显示功能,不选择默认将不使用颜色(y/n)" 344 | read colorlogchoose 345 | if [ "$colorlogchoose" == "y" ]; then 346 | curl https://raw.githubusercontent.com/GaHoKwan/colored-adb-logcat/master/colored-adb-logcat.py > $thisDir/colored-adb-logcat.py 347 | chmod a+x $thisDir/colored-adb-logcat.py 348 | logcat="python colored-adb-logcat.py" 349 | else 350 | logcat="adb logcat -b main -b system -b radio" 351 | fi 352 | echo -e "正在切换模式..." 353 | sleep 1 354 | clear 355 | echo -e "这是抓取log的工具,过程中按ctrl+c退出" 356 | echo -e "\t\t1.把所有的log输出到$thisDir/log" 357 | echo -e "\t\t2.把你想过滤的内容输出到终端并保存到文件" 358 | echo -e "\t\t3.抓取VFY到文件" 359 | echo -e "\t\t4.抓取E/AndroidRuntime到文件" 360 | echo -e "\t\t5.抓取System.err到文件" 361 | echo -e "\t\t6.抓取E/错误log到文件" 362 | echo -ne "\n选择:" 363 | read logcatmode 364 | case $logcatmode in 365 | 1) 366 | $logcat > $thisDir/log 367 | ;; 368 | 2) 369 | echo -e "\n输入你想过滤的内容" 370 | read ignoretext 371 | $logcat |grep $ignoretext|tee $thisDir/log 372 | ;; 373 | 3) 374 | $logcat |grep -C 5 'VFY'|tee $thisDir/log 375 | ;; 376 | 4) 377 | $logcat |grep 'E/AndroidRuntime'|tee $thisDir/log 378 | ;; 379 | 5) 380 | $logcat |grep 'System.err'|tee $thisDir/log 381 | ;; 382 | 6) 383 | $logcat |grep -C 5 'E/'|tee $thisDir/log 384 | ;; 385 | *) 386 | main 387 | ;; 388 | esac 389 | } 390 | 391 | screencap(){ 392 | adb shell /system/bin/screencap -p /data/local/tmp/screenshot.png 393 | cd $thisDir 394 | adb pull /data/local/tmp/screenshot.png 395 | if [ "$?" == "0" ]; then 396 | echo -e "截图文件已经输出到$thisDir" 397 | else 398 | echo -e "截图错误,请检查adb是否正常工作" 399 | fi 400 | read -p "按回车键继续..." 401 | } 402 | 403 | zipcenop(){ 404 | echo -e "这是刷机包或者apk&jar伪加密工具" 405 | echo -e "请把需要加密的刷机包或者apk&jar拖进来" 406 | read cenopfile 407 | echo -ne "\n选择:" 408 | echo -e "输入1加密,输入2解密,输入任意字符退出" 409 | echo -ne "\n选择:" 410 | read cenopmode 411 | case $cenopmode in 412 | 1) 413 | java -jar $thisDir/ZipCenOp.jar e ${cenopfile//\'//} 414 | read -p "按回车键继续..." 415 | ;; 416 | 2) 417 | java -jar $thisDir/ZipCenOp.jar r ${cenopfile//\'//} 418 | read -p "按回车键继续..." 419 | ;; 420 | *) 421 | main 422 | ;; 423 | esac 424 | } 425 | 426 | clean(){ 427 | cd $thisDir 428 | echo -e "正在清理环境文件" 429 | rm -rf colored-adb-logcat.py 51-android.rules flyme.patch 430 | echo -e "输入c清理残留文件否则直接退出" 431 | echo -ne "\n输入c清理或者按回车退出:" 432 | read cleanchoose 433 | if [ "$cleanchoose" == "c" ]; then 434 | echo -e "正在清理残留文件" 435 | rm -rf log 436 | rm -rf screenshot.png 437 | read -p "按回车键继续..." 438 | fi 439 | echo -e "\e[0m" 440 | } 441 | 442 | main(){ 443 | clear 444 | echo -e "Android开发环境一键搭载脚本及开发工具" 445 | echo "--作者: 嘉豪仔_Kwan (QQ:625336209 微博:www.weibo.com/kwangaho)" 446 | echo -e " 输入命令号码 :\n" 447 | echo -e "\t\t1. 使用root权限启动adb" 448 | echo -e "\t\t2. 设置环境变量" 449 | echo -e "\t\t3. 安装安卓厨房(Android-Kitchen)" 450 | echo -e "\t\t4. 依然无法识别手机?没关系,选这个" 451 | echo -e "\t\t5. 同步源码" 452 | echo -e "\t\t6. 快速同步源码(跳过谷歌认证)" 453 | echo -e "\t\t7. 伪加密工具" 454 | echo -e "\t\t8. 抓取log工具" 455 | echo -e "\t\t9. 手机截图" 456 | echo -e "\t\t0. 离开脚本" 457 | echo -ne "\n选择:" 458 | read inp 459 | case $inp in 460 | 1) 461 | sudo adb kill-server 462 | sudo adb devices 463 | read -p "按回车键继续..." 464 | main 465 | ;; 466 | 2) 467 | initSystemConfigure 468 | main 469 | ;; 470 | 3) 471 | installkitchen 472 | main 473 | ;; 474 | 4) 475 | addRules 476 | main 477 | ;; 478 | 5) 479 | repoSource 480 | main 481 | ;; 482 | 6) 483 | fastrepoSource 484 | main 485 | ;; 486 | 7) 487 | zipcenop 488 | main 489 | ;; 490 | 8) 491 | logcat 492 | main 493 | ;; 494 | 9) 495 | screencap 496 | main 497 | ;; 498 | 0) 499 | clean 500 | ;; 501 | *) 502 | main 503 | ;; 504 | esac 505 | } 506 | 507 | echo -e "说明:本脚本仅适用于Ubuntu及各大Ubuntu发行版使用,并且建议在14.04Lts版本下使用" 508 | echo -ne "\n请输入你的root密码:" 509 | sudo echo -e "正在进入主界面..." 510 | main 511 | -------------------------------------------------------------------------------- /wineqq.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd /etc/apt/sources.list.d #进入apt源列表 4 | echo "deb http://packages.linuxdeepin.com/deepin trusty main universe non-free" | sudo tee deepinwine-qqintl.list 5 | echo "deb-src http://packages.linuxdeepin.com/deepin trusty main universe non-free" | sudo tee -a deepinwine-qqintl.list 6 | sudo apt-get update #更新一下源 7 | sudo apt-get install deepinwine-qqintl #安装ia32-libs 8 | sudo rm deepinwine-qqintl.list #恢复源 9 | sudo apt-get update #再次更新下源 10 | --------------------------------------------------------------------------------