Skip to content

Commit

Permalink
Fixed 64bit check for pre lollipop.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sven Obser committed Apr 28, 2015
1 parent 51bd9b4 commit 4975eb7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ android {
buildToolsVersion "22.0.0"

defaultConfig {
minSdkVersion 19
minSdkVersion 10
targetSdkVersion 22
versionCode 1
versionName "1.0"
Expand Down
8 changes: 7 additions & 1 deletion lib/src/main/java/de/larma/arthook/Native.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,13 @@ private Native() {
public static boolean is64Bit() {
if (sixtyFour == null)
try {
sixtyFour = (Boolean) Class.forName("dalvik.system.VMRuntime").getDeclaredMethod("is64Bit").invoke(Class.forName("dalvik.system.VMRuntime").getDeclaredMethod("getRuntime").invoke(null));
final Class<?> vmClass = Class.forName("dalvik.system.VMRuntime");
final Object runtime = vmClass.getDeclaredMethod("getRuntime").invoke(null);
try {
sixtyFour = (Boolean) vmClass.getDeclaredMethod("is64Bit").invoke(runtime);
} catch (NoSuchMethodException e) {
sixtyFour = false;
}
} catch (Exception e) {
throw new RuntimeException("Can't determine int size number!", e);
}
Expand Down

0 comments on commit 4975eb7

Please sign in to comment.