NEXUS 4&5 刷4.4.4系统源码

ubuntu: 18.04
android: 4.4.4
make: 3.8.2
jdk: 6(sun)
参考地址:
https://blog.csdn.net/jackchen95/article/details/49671825
https://blog.csdn.net/u012417380/article/details/73196722
下载源码之后下载对应驱动,对应sh256

PS C:\Users\22073\Desktop> certutil -hashfile yourfilename.ext SHA256
CertUtil: -hashfile 失败: 0x80070002 (WIN32: 2 ERROR_FILE_NOT_FOUND)
CertUtil: 系统找不到指定的文件。
PS C:\Users\22073\Desktop> cd D:\dow
PS D:\dow> certutil -hashfile .\broadcom-mako-ktu84p-3a6a5a8b.tgz.tar SHA256
SHA256 的 .\broadcom-mako-ktu84p-3a6a5a8b.tgz.tar 哈希:
dab8676965c8c967e52aa0bcc4d86eec4ea39907a09553d07dfb89cada01079c
CertUtil: -hashfile 命令成功完成。
PS D:\dow> certutil -hashfile .\lge-mako-ktu84p-2e326822.tgz.tar SHA256
SHA256 的 .\lge-mako-ktu84p-2e326822.tgz.tar 哈希:
c63614a9a059783e545493d184d42db4dcbbefb5139b1ff1d76dd1a6929610fd
CertUtil: -hashfile 命令成功完成。
PS D:\dow> certutil -hashfile .\qcom-mako-ktu84p-c8f35998.tgz.tar SHA256
SHA256 的 .\qcom-mako-ktu84p-c8f35998.tgz.tar 哈希:
6f3ee76bf7653b1fdb70455eda202b4ad98d8052cfa18c8d2cac5542d1911f88
CertUtil: -hashfile 命令成功完成。
PS D:\dow>

替换gcc版本
https://blog.csdn.net/yizhang_ml/article/details/86750405
https://blog.csdn.net/xrinosvip/article/details/81177873
安装依赖项目
https://blog.csdn.net/Youlor/article/details/81114739
安装make3.82 报错先修改文件再./configure
https://blog.csdn.net/Niklaus_Lee/article/details/84991444

可能替换不成功,用下面方案。
https://blog.csdn.net/dpzCSDN/article/details/85098036

安装jdk
https://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase6-419409.html 要登录。下镜像。
链接: https://pan.baidu.com/s/1miVKUHq 密码: y26k
sudo make clobber报错时添加环境变量

haidragon@ubuntu:~/resource$ sudo  make clobber
[sudo] password for haidragon: 
build/core/config.mk:365: *** Error: could not find jdk tools.jar, please install JDK6, which you can download from java.sun.com.  Stop.
haidragon@ubuntu:~/resource$ exp
expand  expiry  export  expr    
haidragon@ubuntu:~/resource$ exp
expand  expiry  export  expr    
haidragon@ubuntu:~/resource$ export PATH=$PATH:/home/haidragon/Desktop/make-3.82/jdk1.6.0_45/lib/

sudo gedit /etc/environment

PATH="/home/haidragon/Desktop/jdk1.6.0_45/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
CLASSPATH=/home/haidragon/Desktop/jdk1.6.0_45/bin/lib
JAVA_HOME=/home/haidragon/Desktop/jdk1.6.0_45

sudo -s source ~/.bashrc

还报错是因为名字 取错了 是ANDROID_JAVA_HOME

查看自己的代号
https://www.jianshu.com/p/2495c47c2d27

编译
报错处理
开始就报错是因为设置这个
https://blog.csdn.net/u012195899/article/details/82078384
找不到i386gcc 要安装  sudo apt-get install ia32-libs
编译完成直接刷机就行,我这里用的mac,因为linux就手机连接不上(网上能找的方案全试过),windows就adb连接不上真是操tm(就NEXUS 4不行5ok)。
把编译好的全拷贝过来,如图所示。

设置环境变量。
export ANDROID_PRODUCT_OUT=/Users/haidragon/Desktop/androidbuild/mako
输入:fastboot flashall -w

130|shell@mako:/ $ exit
haidragondeMacBook-Air:platform-tools haidragon$ ls
NOTICE.txt          e2fsdroid           mke2fs.conf
adb             etc1tool            sload_f2fs
api             fastboot            source.properties
deployagent         hprof-conv          sqlite3
deployagent.jar         lib64               systrace
deploypatchgenerator.jar    make_f2fs
dmtracedump         mke2fs
haidragondeMacBook-Air:platform-tools haidragon$ set ANDROID_PRODUCT_OUT=/Users/haidragon/Desktop/androidbuild/mako 
haidragondeMacBook-Air:platform-tools haidragon$ echo ${ANDROID_PRODUCT_OUT}

haidragondeMacBook-Air:platform-tools haidragon$ echo $ANDROID_PRODUCT_OUT

haidragondeMacBook-Air:platform-tools haidragon$ ls
NOTICE.txt          e2fsdroid           mke2fs.conf
adb             etc1tool            sload_f2fs
api             fastboot            source.properties
deployagent         hprof-conv          sqlite3
deployagent.jar         lib64               systrace
deploypatchgenerator.jar    make_f2fs
dmtracedump         mke2fs
haidragondeMacBook-Air:platform-tools haidragon$ adb reboot bootloader
haidragondeMacBook-Air:platform-tools haidragon$ fastboot oem unlock
                                                   FAILED (remote: 'Already Unlocked')
fastboot: error: Command failed
haidragondeMacBook-Air:platform-tools haidragon$ fastboot flashall -w
--------------------------------------------
Bootloader Version...: MAKOZ30d
Baseband Version.....: M9615A-CEFWMAZM-2.0.1701.03
Serial Number........: 047e3631ce95b902
--------------------------------------------
fastboot: error: ANDROID_PRODUCT_OUT not set
haidragondeMacBook-Air:platform-tools haidragon$ export  ANDROID_PRODUCT_OUT=/Users/haidragon/Desktop/androidbuild/mako 
haidragondeMacBook-Air:platform-tools haidragon$ echo $ANDROID_PRODUCT_OUT
/Users/haidragon/Desktop/androidbuild/mako
haidragondeMacBook-Air:platform-tools haidragon$ fastboot flashall -w
--------------------------------------------
Bootloader Version...: MAKOZ30d
Baseband Version.....: M9615A-CEFWMAZM-2.0.1701.03
Serial Number........: 047e3631ce95b902
--------------------------------------------
Checking 'product'                                 OKAY [  0.000s]
Sending 'boot' (6370 KB)                           OKAY [  0.205s]
Writing 'boot'                                     OKAY [  0.349s]
Sending 'recovery' (6918 KB)                       OKAY [  0.222s]
Writing 'recovery'                                 OKAY [  0.381s]
Sending 'system' (301511 KB)                       OKAY [  9.888s]
Writing 'system'                                   OKAY [ 18.408s]
Erasing 'userdata'                                 OKAY [  0.992s]
mke2fs 1.44.4 (18-Aug-2018)
Creating filesystem with 3449600 4k blocks and 863264 inodes
Filesystem UUID: d6616095-889f-4b69-913e-5d12ce584771
Superblock backups stored on blocks: 
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done   

Sending 'userdata' (3496 KB)                       OKAY [  0.117s]
Writing 'userdata'                                 OKAY [  0.176s]
Erasing 'cache'                                    OKAY [  0.054s]
mke2fs 1.44.4 (18-Aug-2018)
Creating filesystem with 143360 4k blocks and 35840 inodes
Filesystem UUID: 0e104da4-868f-4393-a7b8-243ef6d2a0cb
Superblock backups stored on blocks: 
    32768, 98304

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done

Sending 'cache' (208 KB)                           OKAY [  0.009s]
Writing 'cache'                                    OKAY [  0.017s]
Rebooting                                          OKAY [  0.002s]
Finished. Total time: 31.069s
haidragondeMacBook-Air:platform-tools haidragon$ 


同时试了下其它手机是不行(行就说明见鬼了)。





镜像下地:
https://www.cnblogs.com/-njx/p/3845164.html

转载于:https://blog.51cto.com/haidragon/2399947

你可能感兴趣的:(NEXUS 4&5 刷4.4.4系统源码)