From 7626deb4a0099b8f2b4e252080e82680d06dc4f6 Mon Sep 17 00:00:00 2001 From: androidlover5842 Date: Mon, 26 Mar 2018 21:17:05 +0530 Subject: [PATCH] cleanup old functions --- src/mkTree/MakeTree.java | 66 ++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 40 deletions(-) diff --git a/src/mkTree/MakeTree.java b/src/mkTree/MakeTree.java index d1ff72e..1a6bdb2 100644 --- a/src/mkTree/MakeTree.java +++ b/src/mkTree/MakeTree.java @@ -48,10 +48,7 @@ public MakeTree(boolean mtk,String type){ System.exit(0); } } - MkAndroid(); - MkAndroidProducts(); - MkOmni(); - mkKernel(); + BuildMakeFiles(); if(mtk) { MkBoardConfig(type); @@ -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); @@ -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"); @@ -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" + @@ -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" + @@ -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" +