Skip to content

Commit

Permalink
cleanup old functions
Browse files Browse the repository at this point in the history
  • Loading branch information
androidlover5842 committed Mar 26, 2018
1 parent f002f1e commit 7626deb
Showing 1 changed file with 26 additions and 40 deletions.
66 changes: 26 additions & 40 deletions src/mkTree/MakeTree.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,7 @@ public MakeTree(boolean mtk,String type){
System.exit(0);
}
}
MkAndroid();
MkAndroidProducts();
MkOmni();
mkKernel();
BuildMakeFiles();
if(mtk)
{
MkBoardConfig(type);
Expand All @@ -65,7 +62,30 @@ public MakeTree(boolean mtk,String type){
}
MkFstab();
}


private void BuildMakeFiles(){
new Thread(() -> {
System.out.println("Making omni_"+info.getCodename()+".mk");
new FWriter("omni_"+info.getCodename()+".mk",getOmniData());
System.out.println("Making Android.mk");
new FWriter("Android.mk",getAndroidtData());
System.out.println("Making AndroidProducts.mk");
new FWriter("AndroidProducts.mk",getAndroidProductsData());
System.out.println("Making kernel.mk");
if(new File(out+"recovery.img-zImage").exists())
{
shell.cp(out+"recovery.img-zImage", info.getPathS()+"kernel");
}
if(new File(out+"recovery.img-dt").length()!=l)
{

shell.cp(out+"recovery.img-dt", info.getPathS()+"dt.img");
new FWriter("kernel.mk",getKernelData(true));
}else {
new FWriter("kernel.mk",getKernelData(false));
}
}).start();
}

private void extractKernel(boolean mtk) {
shell.mkdir(out);
Expand All @@ -85,23 +105,6 @@ private void extractKernel(boolean mtk) {
}
}

private void mkKernel() {
System.out.println("Making kernel.mk");
if(new File(out+"recovery.img-zImage").exists())
{
shell.cp(out+"recovery.img-zImage", info.getPathS()+"kernel");
}
if(new File(out+"recovery.img-dt").length()!=l)
{

shell.cp(out+"recovery.img-dt", info.getPathS()+"dt.img");
new FWriter("kernel.mk",getKernelData(true));
}else {
new FWriter("kernel.mk",getKernelData(false));
}

}

private String getKernelData(boolean dt) {
String idata;
String pagesize=shell.commandnoapp("cat "+out+"recovery.img-pagesize");
Expand Down Expand Up @@ -281,12 +284,7 @@ private void CheckCompression() {
shell.command("echo "+idata +" >> " +info.getPath()+"/kernel.mk");
}
}

public void MkOmni() {
System.out.println("Making omni_"+info.getCodename()+".mk");
new FWriter("omni_"+info.getCodename()+".mk",getOmniData());
}


private String getOmniData() {
String idata =copyRight;
idata+="$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base.mk)\n" +
Expand All @@ -301,13 +299,7 @@ private String getOmniData() {
return idata;
}


public void MkAndroid() {
System.out.println("Making Android.mk");
new FWriter("Android.mk",getAndroidtData());

}

private String getAndroidtData() {
String idata =copyRight;
idata+="ifneq ($(filter "+info.getCodename()+",$(TARGET_DEVICE)),)\n" +
Expand All @@ -320,12 +312,6 @@ private String getAndroidtData() {
return idata;
}

public void MkAndroidProducts() {
System.out.println("Making AndroidProducts.mk");
new FWriter("AndroidProducts.mk",getAndroidProductsData());

}

private String getAndroidProductsData() {
String idata =copyRight;
idata+="LOCAL_PATH := "+info.getPath()+"\n" +
Expand Down

0 comments on commit 7626deb

Please sign in to comment.