Skip to content

Commit

Permalink
"Merge pull request #22 from anonimou0/patch-1\n\nFix program to work…
Browse files Browse the repository at this point in the history
… on 64-bit architecture"
  • Loading branch information
miracle2k committed Dec 27, 2016
2 parents 09cd1fc + 6bf1d71 commit fcf5192
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/com/elsdoerfer/android/autostarts/ToggleTool.java
Expand Up @@ -144,7 +144,21 @@ static protected Boolean toggleState(Context context, ComponentInfo component, b
// On ICS, it became necessary to set a library path (which is
// cleared for suid programs, for obvious reasons). It can't hurt
// on older versions. See also https://github.com/ChainsDD/su-binary/issues/6
final String libs = "LD_LIBRARY_PATH=\"$LD_LIBRARY_PATH:/system/lib\" ";

String abi = null; //check if the architecture is 32 or 64bits
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
abi = Build.CPU_ABI;
} else {
abi = Build.SUPPORTED_ABIS[0];
}
final String libs;
if (abi.equals("arm64-v8a") || abi.equals("x86_64") || abi.equals("mips64")) {
libs = "LD_LIBRARY_PATH=\"$LD_LIBRARY_PATH:/system/lib64\" ";
}
else {
libs = "LD_LIBRARY_PATH=\"$LD_LIBRARY_PATH:/system/lib\" ";
}

boolean success = false;
for (String[] set : new String[][] {
{ libs+"pm %s '%s/%s'", null },
Expand Down Expand Up @@ -227,4 +241,4 @@ private static boolean setADBEnabledState(Context context, ContentResolver cr, b
}
}
}
}
}

0 comments on commit fcf5192

Please sign in to comment.