Skip to content
This repository has been archived by the owner on Nov 12, 2022. It is now read-only.

Commit

Permalink
Merge pull request #14 from variousvirgil/patch-1
Browse files Browse the repository at this point in the history
Fix #10
  • Loading branch information
chrox committed Nov 29, 2014
2 parents 78c48ca + 92c10e5 commit 478444d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/com/github/chrox/kpvbooklet/KPVBooklet.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.net.URI;
import java.lang.reflect.Field;
import java.io.PrintStream;
import java.io.File;

import com.github.chrox.kpvbooklet.ccadapter.CCAdapter;
import com.github.chrox.kpvbooklet.util.Log;
Expand Down Expand Up @@ -83,6 +84,8 @@ public class KPVBooklet extends ReaderBooklet {
private final String kor_history = "/mnt/us/koreader/history/";
private final String kpdfview = "/mnt/us/kindlepdfviewer/kpdf.sh";
private final String kpv_history = "/mnt/us/kindlepdfviewer/history/";
private final String gandalf = "/var/local/mkk/gandalf";
private final String su = "/var/local/mkk/su";

private Process readerProcess;
private String history_dir;
Expand All @@ -109,7 +112,11 @@ public void start(URI contentURI) {
}
}
log("I: Opening " + path + " with koreader...");
String[] cmd = new String[] {koreader, path};
if (new File(gandalf).exists()) {
String[] cmd = new String[] {su, "-s", "/bin/ash", "-c", koreader + " \"" + path + "\""};
} else {
String[] cmd = new String[] {koreader, path};
}
try {
readerProcess = Runtime.getRuntime().exec(cmd);
history_dir = kor_history;
Expand Down

0 comments on commit 478444d

Please # to comment.