Skip to content

Instantly share code, notes, and snippets.


Dave Smith devunwired

View GitHub Profile
onyxmueller / strip_google_play_services.gradle
Last active Aug 29, 2015
Strip Google Play Services Packages
View strip_google_play_services.gradle
import groovy.transform.Field
// This is a drop-in Gradle script that allows you to easily strip out the packages you don't need
// from the Google Play Services library. The script will keep track of previous runs to prevent
// restripping each time you build.
// 1) Download/copy this strip_google_play_services.gradle file into the same location of your app's
// build.gradle file.
JakeWharton /
Last active Jan 8, 2020
A special activity which facilitates restarting your application process.
rallat / dexmethodcount
Last active Dec 14, 2015
Android Dex Method Count more sophisticated scripts that gives you method cound by package @JakeWharton and @tsmith
View dexmethodcount
You can add this to your shell profile and then use it as dexcount file.
This file should have a classes.dex in order to work, that means it has to be a android lib project or android apk.
mkdir temp >/dev/null
cp $1 temp/$1+copy > /dev/null
unzip temp/$1+copy -d temp/ > /dev/null
cat temp/classes.dex | head -c 92 | tail -c 4 | hexdump -e '1/4 "%d\n"'
rm -R temp > /dev/null
JakeWharton /
Last active Jan 29, 2021
`classes.dex` method count helpers. Requires smali/baksmali from and dexdump from the build-tools in the Android SDK be on your PATH.
function dex-method-count() {
cat $1 | head -c 92 | tail -c 4 | hexdump -e '1/4 "%d\n"'
function dex-method-count-by-package() {
dir=$(mktemp -d -t dex)
baksmali $1 -o $dir
for pkg in `find $dir/* -type d`; do
smali $pkg -o $pkg/classes.dex
count=$(dex-method-count $pkg/classes.dex)
name=$(echo ${pkg:(${#dir} + 1)} | tr '/' '.')
devunwired /
Last active Jun 9, 2021
An optimized implementation of GifDecoder for Android devices.
* Copyright (c) 2013 Xcellent Creations, Inc.
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
devunwired / background_dialog.xml
Created Nov 14, 2012
XML Shape Drawable for Dialog Backgrounds. Applies a fixed outer margin to keep background from fully stretching to screen edge, and allows for additional internal padding to apply to the dialog content.
View background_dialog.xml
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="">
<!-- Apply the margin value on the "item" element -->
<!-- This example creates a 15dp visible margin around the dialog -->
romannurik /
Last active May 1, 2021
**BETA** Android 4.0-style "Swipe to Dismiss" sample code
Moved to