mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-18 20:15:35 -04:00
avoid 64 bit division in Updater_GetBuildTime on android
This commit is contained in:
parent
33c1e4e791
commit
4b398eb546
@ -523,7 +523,10 @@ public class MainActivity extends Activity implements SurfaceHolder.Callback2 {
|
||||
//ApplicationInfo info = getPackageManager().getApplicationInfo(name, 0);
|
||||
ApplicationInfo info = getApplicationInfo();
|
||||
File apkFile = new File(info.sourceDir);
|
||||
return apkFile.lastModified();
|
||||
|
||||
// https://developer.android.com/reference/java/io/File#lastModified()
|
||||
// lastModified is returned in milliseconds
|
||||
return apkFile.lastModified() / 1000;
|
||||
} catch (Exception ex) {
|
||||
return 0;
|
||||
}
|
||||
@ -711,6 +714,7 @@ public class MainActivity extends Activity implements SurfaceHolder.Callback2 {
|
||||
int len;
|
||||
try {
|
||||
conn.connect();
|
||||
// Some implementations also provide this as getHeaderField(0), but some don't
|
||||
httpParseHeader("HTTP/1.1 " + conn.getResponseCode() + " MSG");
|
||||
|
||||
// Legitimate webservers aren't going to reply with over 200 headers
|
||||
|
@ -1363,10 +1363,7 @@ cc_result Updater_GetBuildTime(cc_uint64* t) { return ERR_NOT_SUPPORTED; }
|
||||
cc_result Updater_GetBuildTime(cc_uint64* t) {
|
||||
JNIEnv* env;
|
||||
JavaGetCurrentEnv(env);
|
||||
|
||||
/* https://developer.android.com/reference/java/io/File#lastModified() */
|
||||
/* lastModified is returned in milliseconds */
|
||||
*t = JavaCallLong(env, "getApkUpdateTime", "()J", NULL) / 1000;
|
||||
*t = JavaCallLong(env, "getApkUpdateTime", "()J", NULL);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user