Skip to content

Commit

Permalink
update error codes
Browse files Browse the repository at this point in the history
  • Loading branch information
androidlover5842 committed Aug 3, 2018
1 parent 8ace38b commit d921f02
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/github/twrpbuilder/Interface/Tools.java
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public String getBrand() {

public String getCodename() {
codename =checkData(command("cat " + propFile() + " | grep -m 1 ro.build.product= | cut -d = -f 2").toLowerCase());
if (codename.equals(getBrand()))
if (codename.equals(getBrand()) || codename.isEmpty())
{
return checkData(getModel()).toLowerCase();
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/github/twrpbuilder/Thread/RunCode.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public RunCode(String name) {

public RunCode(String name, String type) {
RunCode.type = type;

cp(name,"build.tar.gz");
if (type.equals("mrvl")) {
extract("degas-umkbootimg");
command("mv degas-umkbootimg umkbootimg ");
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/com/github/twrpbuilder/mkTree/MakeTree.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ public MakeTree(boolean mtk, String type) {
extractFstab();
if (!mkdir(getPath())) {
System.out.println("Failed to make dir");
System.exit(0);
System.exit(-1);
}

if (getCodename().isEmpty()) {
command("sed 's/\\[\\([^]]*\\)\\]/\\1/g' " + propFile() + " | sed 's/: /=/g' | tee > b.prop && mv -f b.prop build.prop");
if (getCodename().isEmpty()) {
System.out.println("Failed to get info");
System.out.println("Failed to get codeName");
Clean();
System.exit(0);
System.exit(-1);
}
}
if (new File(getPath()+"kernel.mk").exists())
Expand Down Expand Up @@ -168,7 +168,7 @@ public void extractFstab() {
} else {
Clean();
System.out.println("failed to uncompress ramdisk");
System.exit(0);
System.exit(-1);
}

}
Expand Down Expand Up @@ -273,7 +273,7 @@ private String grepPartition(String path, String partition) {
if (
partition.equals("boot") ||
partition.equals("recovery") ||
partition.equals(" fotakernel") ||
partition.equals("fotakernel") ||
partition.equals("FOTAKernel") ||
partition.equals("misc")
) {
Expand Down

0 comments on commit d921f02

Please sign in to comment.