任何人都知道如何更新此代码段,以便平台,媒体等密钥获取密码?我们使用make -j32 otapackage运行CM11构建。构建崩溃b / c其中一个进程没有传递密码。对于我们来说,我们只能运行make otapackage,这需要几个小时。
/**
* Reads the password from stdin and returns it as a string.
*
* @param keyFile The file containing the private key. Used to prompt the user.
*/
private static String readPassword(File keyFile) {
// TODO: use Console.readPassword() when it's available.
System.out.print("Enter password for " + keyFile + " (password will not be hidden): ");
System.out.flush();
BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
try {
return stdin.readLine();
} catch (IOException ex) {
return null;
}
}
答案 0 :(得分:0)
这是答案:
/**
* Reads the password from stdin and returns it as a string.
*
* @param keyFile The file containing the private key. Used to prompt the user.
*/
private static String readPassword(File keyFile) {
try {
InputStream is = null;
InputStreamReader isr = null;
BufferedReader br = null;
// open input stream password.txt for reading purpose.
is = new FileInputStream("build/tools/signapk/password.txt");
// create new input stream reader
isr = new InputStreamReader(is);
// create new buffered reader
br = new BufferedReader(isr);
return br.readLine();
} catch (IOException ex) {
return null;
}
}