Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected String RefreshMessages() {
- try {
- String line;
- String result = "";
- Process process = Runtime.getRuntime().exec("su");
- OutputStream stdin = process.getOutputStream();
- InputStream stdout = process.getInputStream();
- stdin.write("su -c 'sqlite3 "/data/data/<app>/databases/database.db" "" + REFRESH_QUERY + ""'n".getBytes());
- stdin.write("exitn".getBytes());
- stdin.flush();
- stdin.close();
- BufferedReader br = new BufferedReader(new InputStreamReader(stdout));
- while((line = br.readLine()) != null){
- result = result + line;
- }
- Log.d("[Output]", result);
- br.close();
- process.waitFor();
- process.destroy();
- return result;
- } catch (Exception ex) {
- Log.d("ERR-RFRSH-MSG", ex.toString());
- return "0";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement