-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getBinaryResourcesModifiedTime always returns the same time on Android #650
Comments
Looks like this is exactly the same problem as with cordova plugin here: microsoft/cordova-plugin-code-push#196 |
Yeah, I see the timestamp within update and built apk time are equal, but there is additional check for binary versions equality. Even though the timestamps are the same, after build step plugin cleans out current local package (if you bump version) and anyway downloads new updates. Could you provide specific case which demonstrates your problem? |
@matrosov-nikita yeah, on debug builds right now we're not bumping version appropriately. We should definitely fix that on our side, but it's why I noticed this issue. If the code is just dead, maybe the better solution is just to remove it? |
@jacob-meacham, I've sent the PR. It uses |
This is similar to the hacked fix I had been using and works for me. Thanks! |
…method (#683) Due to “the last modified date on all files in an apk now have the time stamp of 'Fri, Nov 30 1979 00:00:00'” (https://code.google.com/p/android/issues/detail?id=220039) we have to store apk build time value in `app/src/main/res/values/strings.xml` file and use it further in `getBinaryResourcesModifiedTime` method Fix #650
The timestamp returned in getBinaryResourcesModifiedTime() always returns 312796800000 (11/30/1979, 12:00:00 AM). This is expected as per https://code.google.com/p/android/issues/detail?id=220039. The workaround to set android.keepTimestampsInApk = true is an ok one, but in a default project, the binary version is never loaded once a codepush bundle has been installed.
I'm happy to cook up a PR to fix this issue, but I am not primarily an android dev and wanted to get some feedback on an appropriate fix. My initial proposal is to set a buildConfigField in codepush.gradle, and then check that at runtime.
Thanks!
The text was updated successfully, but these errors were encountered: