I am trying to update an Apk on Android Remotely. To run the update without the need of user intervention, I am using this post Link .
But the process is returning with the exit code 139 which means Segmentation fault. My tablet is rooted and I have confirmed it.
File file = new File(Constants.UPDATE_APK_PATH);
try {
String[] filenames = file.list();
File apk = new File(file, filenames[0]);
Process pid = Runtime.getRuntime().exec(
new String[] { "su", "-c",
"pm install -r "+apk.getAbsolutePath()});
pid.waitFor();
Can anybody tell what exactly i am doing wrong? The file is present at the location and the signature of both the apk is same.