Revision cd4d2518
res/menu/context.xml | ||
---|---|---|
2 | 2 |
<menu xmlns:android="http://schemas.android.com/apk/res/android" > |
3 | 3 |
|
4 | 4 |
<item |
5 |
android:id="@+id/virustotal" |
|
6 |
android:showAsAction="ifRoom|withText" |
|
7 |
android:icon="@drawable/virustotal" |
|
8 |
android:title="@string/virustotal"/> |
|
9 |
<item |
|
5 | 10 |
android:id="@+id/by_apk_hash" |
6 | 11 |
android:showAsAction="ifRoom|withText" |
7 | 12 |
android:title="@string/by_apk_hash"/> |
res/values/strings.xml | ||
---|---|---|
5 | 5 |
<string name="icon">icon</string> |
6 | 6 |
<string name="action_settings">Settings</string> |
7 | 7 |
<string name="no_applications_found">No applications found</string> |
8 |
<string name="virustotal">VirusTotal</string> |
|
8 | 9 |
<string name="by_package_name">By Package Name</string> |
9 | 10 |
<string name="by_apk_hash">By APK Hash</string> |
10 | 11 |
<string name="by_signing_certificate">By Signing Certificate</string> |
src/info/guardianproject/checkey/AppListFragment.java | ||
---|---|---|
91 | 91 |
selectedItem = position; |
92 | 92 |
} |
93 | 93 |
|
94 |
private void virustotal(AppEntry appEntry, Intent intent) { |
|
95 |
String urlString = "https://www.virustotal.com/en/file/" |
|
96 |
+ Utils.getBinaryHash(appEntry.getApkFile(), "sha256") + "/analysis/"; |
|
97 |
intent.setData(Uri.parse(urlString)); |
|
98 |
intent.putExtra(Intent.EXTRA_TITLE, R.string.virustotal); |
|
99 |
startActivity(intent); |
|
100 |
} |
|
101 |
|
|
94 | 102 |
private void byApkHash(AppEntry appEntry, Intent intent) { |
95 | 103 |
String urlString = "https://androidobservatory.org/?searchby=binhash&q=" |
96 | 104 |
+ Utils.getBinaryHash(appEntry.getApkFile(), "sha1"); |
... | ... | |
169 | 177 |
AppEntry appEntry = (AppEntry) adapter.getItem(selectedItem); |
170 | 178 |
Intent intent = new Intent(getActivity(), WebViewActivity.class); |
171 | 179 |
switch (item.getItemId()) { |
180 |
case R.id.virustotal: |
|
181 |
virustotal(appEntry, intent); |
|
182 |
return true; |
|
172 | 183 |
case R.id.by_apk_hash: |
173 | 184 |
byApkHash(appEntry, intent); |
174 |
break;
|
|
185 |
return true;
|
|
175 | 186 |
case R.id.by_package_name: |
176 | 187 |
byPackageName(appEntry, intent); |
177 |
break;
|
|
188 |
return true;
|
|
178 | 189 |
case R.id.by_signing_certificate: |
179 | 190 |
bySigningCertificate(appEntry, intent); |
180 |
break;
|
|
191 |
return true;
|
|
181 | 192 |
|
182 | 193 |
default: |
183 | 194 |
return false; |
184 | 195 |
} |
185 |
return true; |
|
186 | 196 |
} |
187 | 197 |
|
188 | 198 |
// Called when the user exits the action mode |
Also available in: Unified diff