{"action":"created","comment":{"url":"https://api.github.com/repos/rapid7/metasploit-payloads/pulls/comments/37704334","id":37704334,"diff_hunk":"@@ -0,0 +1,112 @@\n+package com.metasploit.meterpreter;\n+\n+import android.content.Context;\n+\n+import java.util.Enumeration;\n+import java.util.Hashtable;\n+\n+public class IntervalCollectionManager {\n+\n+    private static final int COLLECT_TYPE_WIFI = 1;\n+\n+    private final Context context;\n+    private final Hashtable<Integer, IntervalCollector> collectors;\n+\n+    public IntervalCollectionManager(Context context) {\n+        this.context = context;\n+        this.collectors = new Hashtable<Integer, IntervalCollector>();\n+    }\n+\n+    public boolean createCollector(int type, long timeout) {\n+        IntervalCollector collector = this.getCollector(type);\n+\n+        if (collector == null) {\n+          switch (type) {\n+              case COLLECT_TYPE_WIFI: {\n+                  collector = new WifiCollector(COLLECT_TYPE_WIFI, this.context, timeout);\n+                  break;\n+              }\n+              default: {\n+                  return false;\n+              }\n+          }\n+        }\n+\n+        if (collector != null) {\n+            this.addCollector(type, collector);\n+            return true;\n+        }\n+\n+        return false;\n+    }\n+\n+    public void start() {\n+        loadExistingCollectors();\n+\n+        Enumeration ids = this.collectors.keys();\n+\n+        while (ids.hasMoreElements()) {\n+            this.collectors.get(ids.nextElement()).start();\n+        }\n+    }\n+\n+    private void loadExistingCollectors() {\n+        IntervalCollector collector = null;\n+\n+        collector = new WifiCollector(COLLECT_TYPE_WIFI, this.context);","path":"java/androidpayload/library/src/com/metasploit/meterpreter/IntervalCollectionManager.java","position":56,"original_position":56,"commit_id":"726bc5b721e977da6a4fb6be60203ed2c6f99b5c","original_commit_id":"726bc5b721e977da6a4fb6be60203ed2c6f99b5c","user":{"login":"bcook-r7","id":10031469,"avatar_url":"https://avatars.githubusercontent.com/u/10031469?v=3","gravatar_id":"","url":"https://api.github.com/users/bcook-r7","html_url":"https://github.com/bcook-r7","followers_url":"https://api.github.com/users/bcook-r7/followers","following_url":"https://api.github.com/users/bcook-r7/following{/other_user}","gists_url":"https://api.github.com/users/bcook-r7/gists{/gist_id}","starred_url":"https://api.github.com/users/bcook-r7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcook-r7/subscriptions","organizations_url":"https://api.github.com/users/bcook-r7/orgs","repos_url":"https://api.github.com/users/bcook-r7/repos","events_url":"https://api.github.com/users/bcook-r7/events{/privacy}","received_events_url":"https://api.github.com/users/bcook-r7/received_events","type":"User","site_admin":false},"body":"it would be cool if we could just reflect to find all of the concrete IntervalCollector classes rather than having to register them manually :) https://docs.oracle.com/javase/tutorial/reflect/class/classNew.html","created_at":"2015-08-23T09:38:45Z","updated_at":"2015-08-23T09:38:45Z","html_url":"https://github.com/rapid7/metasploit-payloads/pull/20#discussion_r37704334","pull_request_url":"https://api.github.com/repos/rapid7/metasploit-payloads/pulls/20","_links":{"self":{"href":"https://api.github.com/repos/rapid7/metasploit-payloads/pulls/comments/37704334"},"html":{"href":"https://github.com/rapid7/metasploit-payloads/pull/20#discussion_r37704334"},"pull_request":{"href":"https://api.github.com/repos/rapid7/metasploit-payloads/pulls/20"}}},"pull_request":{"url":"https://api.github.com/repos/rapid7/metasploit-payloads/pulls/20","id":42598513,"html_url":"https://github.com/rapid7/metasploit-payloads/pull/20","diff_url":"https://github.com/rapid7/metasploit-payloads/pull/20.diff","patch_url":"https://github.com/rapid7/metasploit-payloads/pull/20.patch","issue_url":"https://api.github.com/repos/rapid7/metasploit-payloads/issues/20","number":20,"state":"open","locked":false,"title":"Beginnings of the Android Interval collection functionality","user":{"login":"OJ","id":28896,"avatar_url":"https://avatars.githubusercontent.com/u/28896?v=3","gravatar_id":"","url":"https://api.github.com/users/OJ","html_url":"https://github.com/OJ","followers_url":"https://api.github.com/users/OJ/followers","following_url":"https://api.github.com/users/OJ/following{/other_user}","gists_url":"https://api.github.com/users/OJ/gists{/gist_id}","starred_url":"https://api.github.com/users/OJ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OJ/subscriptions","organizations_url":"https://api.github.com/users/OJ/orgs","repos_url":"https://api.github.com/users/OJ/repos","events_url":"https://api.github.com/users/OJ/events{/privacy}","received_events_url":"https://api.github.com/users/OJ/received_events","type":"User","site_admin":false},"body":"This PR contains the start of what will (hopefully) become a fully fledged Android interval collection function. The goal is to provide the means for agents to run on the target device and periodically grab data for extraction by MSF.\r\n\r\nGiven that the phone might be offline at certain points it's important for the agent to collect data even when there is no connectivity.\r\n\r\nThe code contains the beginnings of this featureset but it's fully finished. We currently have:\r\n\r\n* Basic infrastructure classes to create new interval collectors.\r\n* One example of a (hopefully useful) class that periodically pulls visible WiFi network details.\r\n* Comms functionality that works with MSF.\r\n\r\nWhat we don't have is:\r\n\r\n* The ability to persist to disk. We need this so that we can \"restore\" where we left off should the application stop/crash/etc.\r\n\r\nThe MSF-side of this PR can be found here: https://github.com/rapid7/metasploit-framework/pull/5855\r\n\r\nMore detail (such as sample runs and verification) can be found in the MSF PR.\r\n\r\nApologies for the delay in getting this going.","created_at":"2015-08-17T15:10:04Z","updated_at":"2015-08-23T09:38:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"292b34881ce05565f049279121ee08bab5490e5a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rapid7/metasploit-payloads/pulls/20/commits","review_comments_url":"https://api.github.com/repos/rapid7/metasploit-payloads/pulls/20/comments","review_comment_url":"https://api.github.com/repos/rapid7/metasploit-payloads/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rapid7/metasploit-payloads/issues/20/comments","statuses_url":"https://api.github.com/repos/rapid7/metasploit-payloads/statuses/726bc5b721e977da6a4fb6be60203ed2c6f99b5c","head":{"label":"OJ:interval-collection","ref":"interval-collection","sha":"726bc5b721e977da6a4fb6be60203ed2c6f99b5c","user":{"login":"OJ","id":28896,"avatar_url":"https://avatars.githubusercontent.com/u/28896?v=3","gravatar_id":"","url":"https://api.github.com/users/OJ","html_url":"https://github.com/OJ","followers_url":"https://api.github.com/users/OJ/followers","following_url":"https://api.github.com/users/OJ/following{/other_user}","gists_url":"https://api.github.com/users/OJ/gists{/gist_id}","starred_url":"https://api.github.com/users/OJ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OJ/subscriptions","organizations_url":"https://api.github.com/users/OJ/orgs","repos_url":"https://api.github.com/users/OJ/repos","events_url":"https://api.github.com/users/OJ/events{/privacy}","received_events_url":"https://api.github.com/users/OJ/received_events","type":"User","site_admin":false},"repo":{"id":38216107,"name":"metasploit-payloads","full_name":"OJ/metasploit-payloads","owner":{"login":"OJ","id":28896,"avatar_url":"https://avatars.githubusercontent.com/u/28896?v=3","gravatar_id":"","url":"https://api.github.com/users/OJ","html_url":"https://github.com/OJ","followers_url":"https://api.github.com/users/OJ/followers","following_url":"https://api.github.com/users/OJ/following{/other_user}","gists_url":"https://api.github.com/users/OJ/gists{/gist_id}","starred_url":"https://api.github.com/users/OJ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OJ/subscriptions","organizations_url":"https://api.github.com/users/OJ/orgs","repos_url":"https://api.github.com/users/OJ/repos","events_url":"https://api.github.com/users/OJ/events{/privacy}","received_events_url":"https://api.github.com/users/OJ/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/OJ/metasploit-payloads","description":"Unified repository for different Metasploit Framework payloads","fork":true,"url":"https://api.github.com/repos/OJ/metasploit-payloads","forks_url":"https://api.github.com/repos/OJ/metasploit-payloads/forks","keys_url":"https://api.github.com/repos/OJ/metasploit-payloads/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OJ/metasploit-payloads/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OJ/metasploit-payloads/teams","hooks_url":"https://api.github.com/repos/OJ/metasploit-payloads/hooks","issue_events_url":"https://api.github.com/repos/OJ/metasploit-payloads/issues/events{/number}","events_url":"https://api.github.com/repos/OJ/metasploit-payloads/events","assignees_url":"https://api.github.com/repos/OJ/metasploit-payloads/assignees{/user}","branches_url":"https://api.github.com/repos/OJ/metasploit-payloads/branches{/branch}","tags_url":"https://api.github.com/repos/OJ/metasploit-payloads/tags","blobs_url":"https://api.github.com/repos/OJ/metasploit-payloads/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OJ/metasploit-payloads/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OJ/metasploit-payloads/git/refs{/sha}","trees_url":"https://api.github.com/repos/OJ/metasploit-payloads/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OJ/metasploit-payloads/statuses/{sha}","languages_url":"https://api.github.com/repos/OJ/metasploit-payloads/languages","stargazers_url":"https://api.github.com/repos/OJ/metasploit-payloads/stargazers","contributors_url":"https://api.github.com/repos/OJ/metasploit-payloads/contributors","subscribers_url":"https://api.github.com/repos/OJ/metasploit-payloads/subscribers","subscription_url":"https://api.github.com/repos/OJ/metasploit-payloads/subscription","commits_url":"https://api.github.com/repos/OJ/metasploit-payloads/commits{/sha}","git_commits_url":"https://api.github.com/repos/OJ/metasploit-payloads/git/commits{/sha}","comments_url":"https://api.github.com/repos/OJ/metasploit-payloads/comments{/number}","issue_comment_url":"https://api.github.com/repos/OJ/metasploit-payloads/issues/comments{/number}","contents_url":"https://api.github.com/repos/OJ/metasploit-payloads/contents/{+path}","compare_url":"https://api.github.com/repos/OJ/metasploit-payloads/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OJ/metasploit-payloads/merges","archive_url":"https://api.github.com/repos/OJ/metasploit-payloads/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OJ/metasploit-payloads/downloads","issues_url":"https://api.github.com/repos/OJ/metasploit-payloads/issues{/number}","pulls_url":"https://api.github.com/repos/OJ/metasploit-payloads/pulls{/number}","milestones_url":"https://api.github.com/repos/OJ/metasploit-payloads/milestones{/number}","notifications_url":"https://api.github.com/repos/OJ/metasploit-payloads/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OJ/metasploit-payloads/labels{/name}","releases_url":"https://api.github.com/repos/OJ/metasploit-payloads/releases{/id}","created_at":"2015-06-28T22:10:43Z","updated_at":"2015-06-28T22:10:52Z","pushed_at":"2015-08-18T14:22:01Z","git_url":"git://github.com/OJ/metasploit-payloads.git","ssh_url":"git@github.com:OJ/metasploit-payloads.git","clone_url":"https://github.com/OJ/metasploit-payloads.git","svn_url":"https://github.com/OJ/metasploit-payloads","homepage":"","size":21961,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rapid7:master","ref":"master","sha":"f6671f4140a2c1f44d529e61d0c2af0f69c397ae","user":{"login":"rapid7","id":1013671,"avatar_url":"https://avatars.githubusercontent.com/u/1013671?v=3","gravatar_id":"","url":"https://api.github.com/users/rapid7","html_url":"https://github.com/rapid7","followers_url":"https://api.github.com/users/rapid7/followers","following_url":"https://api.github.com/users/rapid7/following{/other_user}","gists_url":"https://api.github.com/users/rapid7/gists{/gist_id}","starred_url":"https://api.github.com/users/rapid7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rapid7/subscriptions","organizations_url":"https://api.github.com/users/rapid7/orgs","repos_url":"https://api.github.com/users/rapid7/repos","events_url":"https://api.github.com/users/rapid7/events{/privacy}","received_events_url":"https://api.github.com/users/rapid7/received_events","type":"Organization","site_admin":false},"repo":{"id":18418533,"name":"metasploit-payloads","full_name":"rapid7/metasploit-payloads","owner":{"login":"rapid7","id":1013671,"avatar_url":"https://avatars.githubusercontent.com/u/1013671?v=3","gravatar_id":"","url":"https://api.github.com/users/rapid7","html_url":"https://github.com/rapid7","followers_url":"https://api.github.com/users/rapid7/followers","following_url":"https://api.github.com/users/rapid7/following{/other_user}","gists_url":"https://api.github.com/users/rapid7/gists{/gist_id}","starred_url":"https://api.github.com/users/rapid7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rapid7/subscriptions","organizations_url":"https://api.github.com/users/rapid7/orgs","repos_url":"https://api.github.com/users/rapid7/repos","events_url":"https://api.github.com/users/rapid7/events{/privacy}","received_events_url":"https://api.github.com/users/rapid7/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rapid7/metasploit-payloads","description":"Unified repository for different Metasploit Framework payloads","fork":false,"url":"https://api.github.com/repos/rapid7/metasploit-payloads","forks_url":"https://api.github.com/repos/rapid7/metasploit-payloads/forks","keys_url":"https://api.github.com/repos/rapid7/metasploit-payloads/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rapid7/metasploit-payloads/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rapid7/metasploit-payloads/teams","hooks_url":"https://api.github.com/repos/rapid7/metasploit-payloads/hooks","issue_events_url":"https://api.github.com/repos/rapid7/metasploit-payloads/issues/events{/number}","events_url":"https://api.github.com/repos/rapid7/metasploit-payloads/events","assignees_url":"https://api.github.com/repos/rapid7/metasploit-payloads/assignees{/user}","branches_url":"https://api.github.com/repos/rapid7/metasploit-payloads/branches{/branch}","tags_url":"https://api.github.com/repos/rapid7/metasploit-payloads/tags","blobs_url":"https://api.github.com/repos/rapid7/metasploit-payloads/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rapid7/metasploit-payloads/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rapid7/metasploit-payloads/git/refs{/sha}","trees_url":"https://api.github.com/repos/rapid7/metasploit-payloads/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rapid7/metasploit-payloads/statuses/{sha}","languages_url":"https://api.github.com/repos/rapid7/metasploit-payloads/languages","stargazers_url":"https://api.github.com/repos/rapid7/metasploit-payloads/stargazers","contributors_url":"https://api.github.com/repos/rapid7/metasploit-payloads/contributors","subscribers_url":"https://api.github.com/repos/rapid7/metasploit-payloads/subscribers","subscription_url":"https://api.github.com/repos/rapid7/metasploit-payloads/subscription","commits_url":"https://api.github.com/repos/rapid7/metasploit-payloads/commits{/sha}","git_commits_url":"https://api.github.com/repos/rapid7/metasploit-payloads/git/commits{/sha}","comments_url":"https://api.github.com/repos/rapid7/metasploit-payloads/comments{/number}","issue_comment_url":"https://api.github.com/repos/rapid7/metasploit-payloads/issues/comments{/number}","contents_url":"https://api.github.com/repos/rapid7/metasploit-payloads/contents/{+path}","compare_url":"https://api.github.com/repos/rapid7/metasploit-payloads/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rapid7/metasploit-payloads/merges","archive_url":"https://api.github.com/repos/rapid7/metasploit-payloads/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rapid7/metasploit-payloads/downloads","issues_url":"https://api.github.com/repos/rapid7/metasploit-payloads/issues{/number}","pulls_url":"https://api.github.com/repos/rapid7/metasploit-payloads/pulls{/number}","milestones_url":"https://api.github.com/repos/rapid7/metasploit-payloads/milestones{/number}","notifications_url":"https://api.github.com/repos/rapid7/metasploit-payloads/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rapid7/metasploit-payloads/labels{/name}","releases_url":"https://api.github.com/repos/rapid7/metasploit-payloads/releases{/id}","created_at":"2014-04-03T21:18:24Z","updated_at":"2015-08-17T14:17:42Z","pushed_at":"2015-08-18T14:22:01Z","git_url":"git://github.com/rapid7/metasploit-payloads.git","ssh_url":"git@github.com:rapid7/metasploit-payloads.git","clone_url":"https://github.com/rapid7/metasploit-payloads.git","svn_url":"https://github.com/rapid7/metasploit-payloads","homepage":"","size":22437,"stargazers_count":28,"watchers_count":28,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":22,"mirror_url":null,"open_issues_count":6,"forks":22,"open_issues":6,"watchers":28,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rapid7/metasploit-payloads/pulls/20"},"html":{"href":"https://github.com/rapid7/metasploit-payloads/pull/20"},"issue":{"href":"https://api.github.com/repos/rapid7/metasploit-payloads/issues/20"},"comments":{"href":"https://api.github.com/repos/rapid7/metasploit-payloads/issues/20/comments"},"review_comments":{"href":"https://api.github.com/repos/rapid7/metasploit-payloads/pulls/20/comments"},"review_comment":{"href":"https://api.github.com/repos/rapid7/metasploit-payloads/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rapid7/metasploit-payloads/pulls/20/commits"},"statuses":{"href":"https://api.github.com/repos/rapid7/metasploit-payloads/statuses/726bc5b721e977da6a4fb6be60203ed2c6f99b5c"}}}}