Skip to content

Instantly share code, notes, and snippets.

View Gaelan-Bolger's full-sized avatar

Gaelan Bolger Gaelan-Bolger

View GitHub Profile
@Gaelan-Bolger
Gaelan-Bolger / IconPopupMenu.java
Created December 27, 2017 18:20
Support library PopupMenu with icons
package android.support.v7.widget;
import android.content.Context;
import android.support.annotation.NonNull;
import android.view.View;
import java.lang.reflect.Method;
public class IconPopupMenu extends PopupMenu {
@Gaelan-Bolger
Gaelan-Bolger / DividerGridLayout
Created May 22, 2016 02:29
GridLayout with dividers on interior edges, hard coded for 2 columns; uses Support Library GridLayout
package day.cloudy.apps.view;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.support.v7.widget.GridLayout;
import android.util.AttributeSet;
import android.view.View;
@Gaelan-Bolger
Gaelan-Bolger / SignatureCheck.java
Created February 1, 2016 13:54 — forked from scottyab/SignatureCheck.java
Simple Android signature check. It's not bullet proof but does increase the difficulty of backdooring the app
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.pm.Signature;
public class TamperCheck {
//we store the hash of the signture for a little more protection
private static final String APP_SIGNATURE = "1038C0E34658923C4192E61B16846";