{"action":"created","comment":{"url":"https://api.github.com/repos/Microsoft/react-native-code-push/pulls/comments/54190958","id":54190958,"diff_hunk":"@@ -109,8 +111,18 @@ failCallback:(void (^)(NSError *err))failCallback;\n + (void)copyEntriesInFolder:(NSString *)sourceFolder\n                  destFolder:(NSString *)destFolder\n                       error:(NSError **)error;\n+\n + (NSString *)findMainBundleInFolder:(NSString *)folderPath\n                                error:(NSError **)error;\n+\n++ (NSString *)getDefaultAssetsFolderName;\n++ (NSString *)getDefaultJsBundleName;","path":"ios/CodePush/CodePush.h","position":null,"original_position":57,"commit_id":"c1187dbffb5bee69a60de617236b0598318b31c5","original_commit_id":"cda2db13b31b3144217c42e03ee88dfa7a3525b6","user":{"login":"geof90","id":8598682,"avatar_url":"https://avatars.githubusercontent.com/u/8598682?v=3","gravatar_id":"","url":"https://api.github.com/users/geof90","html_url":"https://github.com/geof90","followers_url":"https://api.github.com/users/geof90/followers","following_url":"https://api.github.com/users/geof90/following{/other_user}","gists_url":"https://api.github.com/users/geof90/gists{/gist_id}","starred_url":"https://api.github.com/users/geof90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geof90/subscriptions","organizations_url":"https://api.github.com/users/geof90/orgs","repos_url":"https://api.github.com/users/geof90/repos","events_url":"https://api.github.com/users/geof90/events{/privacy}","received_events_url":"https://api.github.com/users/geof90/received_events","type":"User","site_admin":false},"body":"Got rid of getDefaultJsBundleName.","created_at":"2016-02-26T00:54:26Z","updated_at":"2016-02-26T00:54:26Z","html_url":"https://github.com/Microsoft/react-native-code-push/pull/211#discussion_r54190958","pull_request_url":"https://api.github.com/repos/Microsoft/react-native-code-push/pulls/211","_links":{"self":{"href":"https://api.github.com/repos/Microsoft/react-native-code-push/pulls/comments/54190958"},"html":{"href":"https://github.com/Microsoft/react-native-code-push/pull/211#discussion_r54190958"},"pull_request":{"href":"https://api.github.com/repos/Microsoft/react-native-code-push/pulls/211"}}},"pull_request":{"url":"https://api.github.com/repos/Microsoft/react-native-code-push/pulls/211","id":60611906,"html_url":"https://github.com/Microsoft/react-native-code-push/pull/211","diff_url":"https://github.com/Microsoft/react-native-code-push/pull/211.diff","patch_url":"https://github.com/Microsoft/react-native-code-push/pull/211.patch","issue_url":"https://api.github.com/repos/Microsoft/react-native-code-push/issues/211","number":211,"state":"open","locked":false,"title":"Hash binary resources ","user":{"login":"geof90","id":8598682,"avatar_url":"https://avatars.githubusercontent.com/u/8598682?v=3","gravatar_id":"","url":"https://api.github.com/users/geof90","html_url":"https://github.com/geof90","followers_url":"https://api.github.com/users/geof90/followers","following_url":"https://api.github.com/users/geof90/following{/other_user}","gists_url":"https://api.github.com/users/geof90/gists{/gist_id}","starred_url":"https://api.github.com/users/geof90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geof90/subscriptions","organizations_url":"https://api.github.com/users/geof90/orgs","repos_url":"https://api.github.com/users/geof90/repos","events_url":"https://api.github.com/users/geof90/events{/privacy}","received_events_url":"https://api.github.com/users/geof90/received_events","type":"User","site_admin":false},"body":"This change allows the plugin to obtain a hash of the binary bundled resources, to be used during `updateCheck` requests, so that we can reject updates from the server if the hash is the same. The implementation differs between iOS and Android due to technical reasons.\r\n\r\nOn iOS:\r\n\r\nThe hash is generated dynamically during every call to `getCurrentPackage`, if the app is currently running the version bundled with the binary. This is hash is then used to query against the server in `checkForUpdate`. If the hash is the same as the latest one on the server, the server will return no update as per normal. If the server returns a diff update, the `downloadPackage` method will check to see if the currently running version is the one in the binary. If so, it will proceed to copy the necessary files from the binary in order to apply the diff update.\r\n\r\nOn Android:\r\n\r\nBecause there is no way to obtain all of the drawable assets bundled into the APK and calculate a hash dynamically, the hash is generated during build time as a build task, and saved in the assets folder. In order for this to work, devs will have to add the `codepush.gradle` task into their `build.gradle` files, and this additional setup step is updated in the README. The task simply hooks into the existing build steps, and takes a snapshot of the built resources before and after the `bundleJsAndAssets` task is run, to figure out which files were generated by React Native, and compute the hash using those files.\r\n\r\nAgain because there is no way to obtain all of the drawable assets bundled into the APK, we don't have the capability to perform diff updates against the binary version in Android. Therefore, in Android `getCurrentPackage` will not return this hash, so that we do not query the server with the hash and cause the server to return a diff update if there is one. We allow the server to return the full update if there is one, then make a native call to `getBinaryHash` to see if it is the same as the binary version, and if so, reject it.\r\n\r\nAlso bumped the plugin version to v1.7.4.","created_at":"2016-02-25T01:49:16Z","updated_at":"2016-02-26T00:54:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f59c864ee7df82ed155bd7c1586e7c4da6be4caf","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Microsoft/react-native-code-push/pulls/211/commits","review_comments_url":"https://api.github.com/repos/Microsoft/react-native-code-push/pulls/211/comments","review_comment_url":"https://api.github.com/repos/Microsoft/react-native-code-push/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Microsoft/react-native-code-push/issues/211/comments","statuses_url":"https://api.github.com/repos/Microsoft/react-native-code-push/statuses/c1187dbffb5bee69a60de617236b0598318b31c5","head":{"label":"Microsoft:generate-binary-resources-hash","ref":"generate-binary-resources-hash","sha":"c1187dbffb5bee69a60de617236b0598318b31c5","user":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":36749153,"name":"react-native-code-push","full_name":"Microsoft/react-native-code-push","owner":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Microsoft/react-native-code-push","description":"React Native plugin for the CodePush service.","fork":false,"url":"https://api.github.com/repos/Microsoft/react-native-code-push","forks_url":"https://api.github.com/repos/Microsoft/react-native-code-push/forks","keys_url":"https://api.github.com/repos/Microsoft/react-native-code-push/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/react-native-code-push/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/react-native-code-push/teams","hooks_url":"https://api.github.com/repos/Microsoft/react-native-code-push/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/react-native-code-push/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/react-native-code-push/events","assignees_url":"https://api.github.com/repos/Microsoft/react-native-code-push/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/react-native-code-push/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/react-native-code-push/tags","blobs_url":"https://api.github.com/repos/Microsoft/react-native-code-push/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/react-native-code-push/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/react-native-code-push/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/react-native-code-push/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/react-native-code-push/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/react-native-code-push/languages","stargazers_url":"https://api.github.com/repos/Microsoft/react-native-code-push/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/react-native-code-push/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/react-native-code-push/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/react-native-code-push/subscription","commits_url":"https://api.github.com/repos/Microsoft/react-native-code-push/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/react-native-code-push/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/react-native-code-push/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/react-native-code-push/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/react-native-code-push/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/react-native-code-push/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/react-native-code-push/merges","archive_url":"https://api.github.com/repos/Microsoft/react-native-code-push/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/react-native-code-push/downloads","issues_url":"https://api.github.com/repos/Microsoft/react-native-code-push/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/react-native-code-push/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/react-native-code-push/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/react-native-code-push/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/react-native-code-push/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/react-native-code-push/releases{/id}","deployments_url":"https://api.github.com/repos/Microsoft/react-native-code-push/deployments","created_at":"2015-06-02T17:19:20Z","updated_at":"2016-02-25T19:29:58Z","pushed_at":"2016-02-26T00:52:41Z","git_url":"git://github.com/Microsoft/react-native-code-push.git","ssh_url":"git@github.com:Microsoft/react-native-code-push.git","clone_url":"https://github.com/Microsoft/react-native-code-push.git","svn_url":"https://github.com/Microsoft/react-native-code-push","homepage":"http://codepush.tools","size":3510,"stargazers_count":702,"watchers_count":702,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":65,"mirror_url":null,"open_issues_count":8,"forks":65,"open_issues":8,"watchers":702,"default_branch":"master"}},"base":{"label":"Microsoft:master","ref":"master","sha":"c63b52e01f3e6149a22acd51ae9d70c5463c37e4","user":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":36749153,"name":"react-native-code-push","full_name":"Microsoft/react-native-code-push","owner":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Microsoft/react-native-code-push","description":"React Native plugin for the CodePush service.","fork":false,"url":"https://api.github.com/repos/Microsoft/react-native-code-push","forks_url":"https://api.github.com/repos/Microsoft/react-native-code-push/forks","keys_url":"https://api.github.com/repos/Microsoft/react-native-code-push/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/react-native-code-push/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/react-native-code-push/teams","hooks_url":"https://api.github.com/repos/Microsoft/react-native-code-push/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/react-native-code-push/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/react-native-code-push/events","assignees_url":"https://api.github.com/repos/Microsoft/react-native-code-push/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/react-native-code-push/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/react-native-code-push/tags","blobs_url":"https://api.github.com/repos/Microsoft/react-native-code-push/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/react-native-code-push/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/react-native-code-push/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/react-native-code-push/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/react-native-code-push/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/react-native-code-push/languages","stargazers_url":"https://api.github.com/repos/Microsoft/react-native-code-push/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/react-native-code-push/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/react-native-code-push/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/react-native-code-push/subscription","commits_url":"https://api.github.com/repos/Microsoft/react-native-code-push/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/react-native-code-push/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/react-native-code-push/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/react-native-code-push/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/react-native-code-push/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/react-native-code-push/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/react-native-code-push/merges","archive_url":"https://api.github.com/repos/Microsoft/react-native-code-push/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/react-native-code-push/downloads","issues_url":"https://api.github.com/repos/Microsoft/react-native-code-push/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/react-native-code-push/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/react-native-code-push/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/react-native-code-push/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/react-native-code-push/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/react-native-code-push/releases{/id}","deployments_url":"https://api.github.com/repos/Microsoft/react-native-code-push/deployments","created_at":"2015-06-02T17:19:20Z","updated_at":"2016-02-25T19:29:58Z","pushed_at":"2016-02-26T00:52:41Z","git_url":"git://github.com/Microsoft/react-native-code-push.git","ssh_url":"git@github.com:Microsoft/react-native-code-push.git","clone_url":"https://github.com/Microsoft/react-native-code-push.git","svn_url":"https://github.com/Microsoft/react-native-code-push","homepage":"http://codepush.tools","size":3510,"stargazers_count":702,"watchers_count":702,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":65,"mirror_url":null,"open_issues_count":8,"forks":65,"open_issues":8,"watchers":702,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Microsoft/react-native-code-push/pulls/211"},"html":{"href":"https://github.com/Microsoft/react-native-code-push/pull/211"},"issue":{"href":"https://api.github.com/repos/Microsoft/react-native-code-push/issues/211"},"comments":{"href":"https://api.github.com/repos/Microsoft/react-native-code-push/issues/211/comments"},"review_comments":{"href":"https://api.github.com/repos/Microsoft/react-native-code-push/pulls/211/comments"},"review_comment":{"href":"https://api.github.com/repos/Microsoft/react-native-code-push/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Microsoft/react-native-code-push/pulls/211/commits"},"statuses":{"href":"https://api.github.com/repos/Microsoft/react-native-code-push/statuses/c1187dbffb5bee69a60de617236b0598318b31c5"}}}}