mirror of
https://github.com/zhigang1992/react-native-code-push.git
synced 2026-05-19 19:39:54 +08:00
Flow type checking fix: use "CodePushHash" file name instead of "CodePushHash.json" (#763)
`CodePushHash.json` file name breaks flow type checking. To fix the issue we need to delete `CodePushHash.json` file and use `CodePushHash` file name instead to store the hash value. Relates to https://github.com/Microsoft/react-native-code-push/issues/577
This commit is contained in:
committed by
Richard Hua
parent
80210059b0
commit
2b02ce90ef
@@ -4,7 +4,8 @@ public class CodePushConstants {
|
||||
public static final String ASSETS_BUNDLE_PREFIX = "assets://";
|
||||
public static final String BINARY_MODIFIED_TIME_KEY = "binaryModifiedTime";
|
||||
public static final String CODE_PUSH_FOLDER_PREFIX = "CodePush";
|
||||
public static final String CODE_PUSH_HASH_FILE_NAME = "CodePushHash.json";
|
||||
public static final String CODE_PUSH_HASH_FILE_NAME = "CodePushHash";
|
||||
public static final String CODE_PUSH_OLD_HASH_FILE_NAME = "CodePushHash.json";
|
||||
public static final String CODE_PUSH_PREFERENCES = "CodePush";
|
||||
public static final String CURRENT_PACKAGE_KEY = "currentPackage";
|
||||
public static final String DEFAULT_JS_BUNDLE_NAME = "index.android.bundle";
|
||||
|
||||
@@ -109,12 +109,15 @@ public class CodePushUpdateUtils {
|
||||
try {
|
||||
return CodePushUtils.getStringFromInputStream(context.getAssets().open(CodePushConstants.CODE_PUSH_HASH_FILE_NAME));
|
||||
} catch (IOException e) {
|
||||
if (!isDebugMode) {
|
||||
// Only print this message in "Release" mode. In "Debug", we may not have the
|
||||
// hash if the build skips bundling the files.
|
||||
CodePushUtils.log("Unable to get the hash of the binary's bundled resources - \"codepush.gradle\" may have not been added to the build definition.");
|
||||
try {
|
||||
return CodePushUtils.getStringFromInputStream(context.getAssets().open(CodePushConstants.CODE_PUSH_OLD_HASH_FILE_NAME));
|
||||
} catch (IOException ex) {
|
||||
if (!isDebugMode) {
|
||||
// Only print this message in "Release" mode. In "Debug", we may not have the
|
||||
// hash if the build skips bundling the files.
|
||||
CodePushUtils.log("Unable to get the hash of the binary's bundled resources - \"codepush.gradle\" may have not been added to the build definition.");
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user