Skip to content

Instantly share code, notes, and snippets.

Avatar
🤗
!

Matthias Urhahn d4rken

🤗
!
View GitHub Profile
View Refleception.java
/**
* We need to go deeper!
*/
public static void doHorribleHack() {
try {
try {
Class<?> testCls = Class.forName("dalvik.system.VMRuntime");
Method method = testCls.getDeclaredMethod("setHiddenApiExemptions", String[].class);
} catch (Exception ex) {
// This will fail
View AutoplayModule.kt
package eu.darken.bluemusic.main.core.service.modules.events
import android.media.AudioManager
import android.os.SystemClock
import android.view.KeyEvent
import eu.darken.bluemusic.bluetooth.core.SourceDevice
import eu.darken.bluemusic.main.core.database.ManagedDevice
import eu.darken.bluemusic.main.core.service.BlueMusicServiceComponent
import eu.darken.bluemusic.main.core.service.modules.EventModule
import eu.darken.bluemusic.settings.core.Settings
View MyPinPad.kt
fun claresSimpleQuestion(input: String) : Boolean {
val pattern = Pattern.compile("^[A-Z].*?$")
return pattern.matcher(input).matches()
}
@Test
fun testClaresSimpleQuestion() {
assertThat(claresSimpleQuestion(""),`is`(false))
assertThat(claresSimpleQuestion("a"),`is`(false))
assertThat(claresSimpleQuestion("A"),`is`(true))
@d4rken
d4rken / key.md
Created Feb 28, 2019 — forked from shobotch/key.md
Twitter (un)official Consumer Key
View key.md

Twitter Official Consumer Key

Twitter for Android

type:            PIN
Consumer key:    3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for iPhone

type:            PIN

Consumer key: IQKbtAYlXLripLGPWd0HUA

@d4rken
d4rken / gist:9812e7e518079b045b3f2db952a5993d
Last active Jan 12, 2019
Random AppCleaner Crash maybe samsung/greatltexx/greatlte:8.0.0/R16NW/N950FXXS5CRK4:user/release-keys
View gist:9812e7e518079b045b3f2db952a5993d
java.lang.RuntimeException:
at android.graphics.BaseCanvas.throwIfCannotDraw (BaseCanvas.java:55)
at android.view.DisplayListCanvas.throwIfCannotDraw (DisplayListCanvas.java:226)
at android.view.RecordingCanvas.drawBitmap (RecordingCanvas.java:97)
at android.graphics.drawable.BitmapDrawable.draw (BitmapDrawable.java:529)
at android.widget.ImageView.onDraw (ImageView.java:1349)
at android.view.View.draw (View.java:20357)
at android.view.View.updateDisplayListIfDirty (View.java:19302)
at android.view.View.draw (View.java:20080)
at android.view.ViewGroup.drawChild (ViewGroup.java:4421)
View CustomSchemaGeneratorHooks.kt
package stack.saas.backend.webserver.graphql
import com.expedia.graphql.schema.generator.WiringContext
import com.expedia.graphql.schema.hooks.SchemaGeneratorHooks
import graphql.schema.GraphQLType
import org.bson.types.ObjectId
import stack.saas.backend.common.graphql.coercing.InstantCoercing
import stack.saas.backend.common.graphql.coercing.ObjectIdCoercing
import stack.saas.backend.common.graphql.coercing.UUIDCoercing
import stack.saas.backend.webserver.graphql.components.auth.permission.Permission
@d4rken
d4rken / gist:787061bd1f059e789061224a2a886d5e
Created Jul 16, 2018
Tutorial for self-hosted mail servers
View gist:787061bd1f059e789061224a2a886d5e
A collection of guides/sites/posts that you may want to look through when setting up a mail server.
### General
* https://www.digitalocean.com/community/tutorials/how-to-configure-a-mail-server-using-postfix-dovecot-mysql-and-spamassassin
### Postfix (SMTP)
* https://seasonofcode.com/posts/custom-domain-e-mails-with-postfix-and-gmail-the-missing-tutorial.html
* https://seasonofcode.com/posts/setting-up-dkim-and-srs-in-postfix.html
View AppRepo.java
@AppComponent.Scope
public class AppRepo {
private final Object appMapLock = new Object();
private Map<String, PackageInfo> appMap;
private final IPCFunnel ipcFunnel;
@Inject
public AppRepo(IPCFunnel ipcFunnel) {this.ipcFunnel = ipcFunnel;}
public Map<String, PackageInfo> getAppMap(boolean refresh) {
@d4rken
d4rken / DrawableMatcher.java
Last active Aug 28, 2019
Android InstrumentationTest Espresso matcher for Drawable's
View DrawableMatcher.java
/**
* Apache 2.0
*
* @see <a href="https://github.com/stablekernel/EspressoLib/blob/master/src/main/java/com/stablekernel/espressolib/DrawableMatcher.java">Source1</a>
* @see <a href="http://stackoverflow.com/questions/33696488/getting-bitmap-from-vector-drawable">Source2</a>
*/
@SuppressWarnings("SimplifiableIfStatement")
public class DrawableMatcher extends TypeSafeMatcher<View> {
private final int expectedResourceId;
View gist:bf08bae003faa01ce0755bfcaaa5b2bf
sailfish:/data/data/com.android.documentsui/shared_prefs # cat com.android.documentsui_preferences.xml
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map>
<int name="0|com.commonsware.android.documenttree||Documents" value="-1" />
</map>