Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fallback for ro.arch and Firmware under newer versions #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public static String getDeviceProps() {
+ "gsm.version.ril-impl: " + osgetprop("gsm.version.ril-impl") + "\n"
+ "ril.hw_ver: " + osgetprop("ril.hw_ver") + "\n"
+ "ril.modem.board: " + osgetprop("ril.modem.board") + "\n"
+ "ro.arch: " + osgetprop("ro.arch") + "\n"
+ "ro.arch: " + (osgetprop("ro.arch").equals("<n/a>") ? System.getProperty("os.arch") : osgetprop("ro.arch")) + "\n"
+ "ro.board.platform: " + osgetprop("ro.board.platform") + "\n";
} catch (Exception ee) {
Log.e(TAG, mTAG + "Exception in getDeviceProps(): Unable to retrieve system properties: " + ee);
Expand Down Expand Up @@ -186,7 +186,7 @@ public static String getLogStartInfo(Context context) {
result.append("gsm.version.ril-impl: " + osgetprop("gsm.version.ril-impl") + "\n");
result.append("ril.hw_ver: " + osgetprop("ril.hw_ver") + "\n");
result.append("ril.modem.board: " + osgetprop("ril.modem.board") + "\n");
result.append("ro.arch: " + osgetprop("ro.arch") + "\n");
result.append("ro.arch: " + (osgetprop("ro.arch").equals("<n/a>") ? System.getProperty("os.arch") : osgetprop("ro.arch")));
result.append("ro.board.platform: " + osgetprop("ro.board.platform") + "\n");
result.append("/dev/diag info:\n " + Utils.checkDiag() + "\n");
return result.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -531,10 +531,24 @@ private static String getProcVersionInfo() {
result = bis.readLine();
} catch (Exception ee) {
Log.e(TAG, mTAG + ":getProcVersionInfo() Exception: " + ee);
return null;

result = "";

try {
Process proc = Runtime.getRuntime()
.exec(new String[] { "su", "-c", "cat", infoFile, "exit" });
proc.waitFor();
java.util.Scanner s = new java.util.Scanner(proc.getInputStream()).useDelimiter("\\A");
String output = s.hasNext() ? s.next() : "";
result = output;
} catch(Exception e) {
result = "<n/a>";
}


}
Log.i(TAG, "/proc/version: " + "\"" + result + "\"");
return result;
return result.isEmpty() ? "<n/a>" : result;
}

/**
Expand Down