Skip to content

Instantly share code, notes, and snippets.

View cypressious's full-sized avatar
🤖
beep bop

Kirill Rakhman cypressious

🤖
beep bop
View GitHub Profile
@cypressious
cypressious / ExampleApplication.java
Last active November 24, 2016 08:50 — forked from pepyakin/ExampleApplication.java
Gist which should prevent leaks of Activity in ClipboardUIManager.
public class ExampleApplication extends Application {
@Override public void onCreate() {
super.onCreate();
if (Build.VERSION.SDK_INT >= 21) {
try {
Class<?> cls = Class.forName("android.sec.clipboard.ClipboardUIManager");
Method m = cls.getDeclaredMethod("getInstance", Context.class);
m.setAccessible(true);
Object o = m.invoke(null, this);
} catch (Exception ignored) { }
@cypressious
cypressious / HockeySender.kt
Last active August 29, 2015 14:27 — forked from ashtom/HockeySender.java
Custom ReportSender for HockeyApp and ACRA with OkHTTP in Kotlin
package net.hockeyapp.android.demo
import com.squareup.okhttp.FormEncodingBuilder
import com.squareup.okhttp.OkHttpClient
import com.squareup.okhttp.Request
import org.acra.ACRA
import org.acra.ReportField
import org.acra.collector.CrashReportData
import org.acra.sender.ReportSender
import java.util.Date