Skip to content

Instantly share code, notes, and snippets.

View bishopmatthew's full-sized avatar

Matthew Bishop bishopmatthew

View GitHub Profile
@bishopmatthew
bishopmatthew / gist:6719532
Last active December 24, 2015 00:49
Logging added to OkHttpDownloader.load()
@Override public Response load(Uri uri, boolean localCacheOnly) throws IOException {
/* Logging */
long startTime = System.currentTimeMillis();
HttpURLConnection connection = openConnection(uri);
connection.setUseCaches(true);
if (localCacheOnly) {
connection.setRequestProperty("Cache-Control", "only-if-cached;max-age=" + Integer.MAX_VALUE);
}
@bishopmatthew
bishopmatthew / gist:4741747
Last active December 12, 2015 08:08
Android manifest receiver definition for EncryptifyAndroid
<receiver
android:name="com.airlocksoftware.encryptifyandroid.PerformEncryptionActivity$EADeviceAdminReceiver"
android:description="@string/device_encryptify_admin_description"
android:label="@string/app_name"
android:permission="android.permission.BIND_DEVICE_ADMIN" >
<meta-data
android:name="android.app.device_admin"
android:resource="@xml/device_admin_sample" />
@bishopmatthew
bishopmatthew / gist:4741664
Last active December 12, 2015 08:08
The Android Manifest activity definition for EncryptifyAndroid.
<activity
android:name="com.airlocksoftware.encryptifyandroid.PerformEncryptionActivity"
android:theme="@style/EncryptifyAndroidTheme"
android:label="@string/app_name" >
</activity>