diff --git a/README.md b/README.md index 7e91027..63ae42d 100644 --- a/README.md +++ b/README.md @@ -6,4 +6,17 @@ Our magic script to generate omni twrp device tree just using a backup which con Get latest jar file from here https://github.com/TwrpBuilder/twrpbuilder_tree_generator/releases/latest ### Usage :- -`java -jar TwrpBuilder.jar backup_filename.tar.gz` +``` +-- USAGE -- +usage: TwrpBuilder [-f ] [-h] [-otg] [-r ] [-t ] +-- HELP -- +usage: java -jar TwrpBuilder.jar -f backupfile.tar.gz [-f ] [-h] [-otg] [-r + ] [-t ] +HELP + -f,--file build using backup file (made from app). + -h,--help print this help + -otg,--otg-support add otg support to fstab + -r,--recovery build using recovery image file + -t,--type supported option :- + mt , samsung,mrvl +``` diff --git a/src/mkTree/MakeTree.java b/src/mkTree/MakeTree.java index ecb2bdc..c57906d 100644 --- a/src/mkTree/MakeTree.java +++ b/src/mkTree/MakeTree.java @@ -71,7 +71,7 @@ private void extractKernel(boolean mtk) { } else { - ShellExecuter.mkdir("out"); + ShellExecuter.mkdir(out); ShellExecuter.command("./umkbootimg -i recovery.img -o "+out); } } @@ -130,21 +130,21 @@ private void Fstab(String path) } public void extractFstab() { - compressionType=ShellExecuter.commandnoapp("cd out && file --mime-type recovery.img-ramdisk.* | cut -d / -f 2 | cut -d '-' -f 2"); + compressionType=ShellExecuter.commandnoapp("cd "+out+" && file --mime-type recovery.img-ramdisk.* | cut -d / -f 2 | cut -d '-' -f 2"); if(compressionType.equals("lzma")) { System.out.println("Found lzma comression in ramdisk"); - ShellExecuter.command("mv "+out+"recovery.img-ramdisk.gz "+out+"recovery.img-ramdisk.lzma && lzma -d "+out+"recovery.img-ramdisk.lzma && cd out && cpio -i