Skip to content

Commit

Permalink
use aik unpack boot for all
Browse files Browse the repository at this point in the history
  • Loading branch information
androidlover5842 committed Mar 27, 2018
1 parent 7626deb commit fb78e6c
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 32 deletions.
Binary file removed res/mkbootimg
Binary file not shown.
Binary file modified res/umkbootimg
Binary file not shown.
62 changes: 31 additions & 31 deletions src/mkTree/MakeTree.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ public class MakeTree {
private Config config;
private String out;
private String type;
private boolean mt;
public static boolean AndroidImageKitchen;
public MakeTree(boolean mtk,String type){
config=new Config();
shell=new ShellExecutor();
out=config.outDir;
this.type=type;
this.mt=mtk;
if(mtk)
{
extractKernel(true);
Expand Down Expand Up @@ -49,18 +51,6 @@ public MakeTree(boolean mtk,String type){
}
}
BuildMakeFiles();
if(mtk)
{
MkBoardConfig(type);
}else if(type.equals("mrvl") || type.equals("samsung"))
{
MkBoardConfig(type);
}
else
{
MkBoardConfig();
}
MkFstab();
}

private void BuildMakeFiles(){
Expand All @@ -84,7 +74,22 @@ private void BuildMakeFiles(){
}else {
new FWriter("kernel.mk",getKernelData(false));
}
}).start();

if(mt)
{
MkBoardConfig(type);
}else if(type.equals("mrvl") || type.equals("samsung"))
{
MkBoardConfig(type);
}
else
{
MkBoardConfig();
}

MkFstab();
new Clean();
}).start();
}

private void extractKernel(boolean mtk) {
Expand All @@ -106,22 +111,13 @@ private void extractKernel(boolean mtk) {
}

private String getKernelData(boolean dt) {
String idata;
String pagesize=shell.commandnoapp("cat "+out+"recovery.img-pagesize");
String cmdline=shell.commandnoapp("cat "+out+"recovery.img-cmdline");
String ramdiskofsset;
String tagsoffset;
if (AndroidImageKitchen)
{
ramdiskofsset=shell.commandnoapp("cat "+out+"recovery.img-ramdiskoff");
tagsoffset=shell.commandnoapp("cat "+out+"recovery.img-tagsoff");
}
else {
ramdiskofsset=shell.commandnoapp("cat "+out+"recovery.img-ramdisk_offset");
tagsoffset=shell.commandnoapp("cat "+out+"recovery.img-tags_offset");
}
String kernelbase=shell.commandnoapp("cat "+out+"recovery.img-base");
idata=copyRight;
String idata;
String pagesize=shell.commandnoapp("cat "+out+"recovery.img-pagesize");
String cmdline=shell.commandnoapp("cat "+out+"recovery.img-cmdline");
String ramdiskofsset=shell.commandnoapp("cat "+out+"recovery.img-ramdiskoff");
String tagsoffset=shell.commandnoapp("cat "+out+"recovery.img-tagsoff");
String kernelbase=shell.commandnoapp("cat "+out+"recovery.img-base");
idata=copyRight;
idata+="# Kernel\n" +
"TARGET_PREBUILT_KERNEL := "+info.getPathS()+"kernel\n" +
"BOARD_KERNEL_CMDLINE := "+cmdline+" androidboot.selinux=permissive\n" +
Expand Down Expand Up @@ -217,6 +213,10 @@ private void Fstab(String path)
{
toWrite+=grepPartition(path,"cache");
}
if (checkPartition(path,"misc"))
{
toWrite+=grepPartition(path,"misc");
}
if (checkPartition(path,"fotakernel"))
{
toWrite+=grepPartition(path,"fotakernel");
Expand All @@ -233,6 +233,7 @@ private void Fstab(String path)
{
toWrite+="/usb-otg auto /dev/block/sda1 flags=display=\"USB OTG\";storage;wipeingui;removable\n";
}

toWrite+="/external_sd vfat /dev/block/mmcblk1p1 /dev/block/mmcblk1 flags=display=\"Micro SDcard\";storage;wipeingui;removable\n";
new FWriter("recovery.fstab",toWrite);
}
Expand All @@ -247,7 +248,6 @@ private String grepPartition(String path,String partition) {
"echo $a\n" +
"done");
System.out.println(s);

if(s.isEmpty())
{
s =shell.commandnoapp("for i in $(cat "+path+" | grep -wi /"+partition+")\n" +
Expand All @@ -256,7 +256,7 @@ private String grepPartition(String path,String partition) {
"echo $a\n" +
"done");
}
if (partition.equals("boot")|| partition.equals("recovery") || partition.equals(" fotakernel") || partition.equals("FOTAKernel"))
if (partition.equals("boot")|| partition.equals("recovery") || partition.equals(" fotakernel") || partition.equals("FOTAKernel") || partition.equals("misc"))
{
return fullpath="/"+partition+" emmc "+s+"\n";
}else if (partition.equals("system") || partition.equals("data") || partition.equals("cache"))
Expand Down
1 change: 0 additions & 1 deletion src/util/RunCode.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ public void run() {
else{
new MakeTree(false,"none");
}
new Clean();
}

public static String getName() {
Expand Down

0 comments on commit fb78e6c

Please sign in to comment.