Skip to content

Instantly share code, notes, and snippets.

@mattsilber
mattsilber / VerifyErrorTest.java
Last active July 31, 2020 17:24
Android java.lang.VerifyError Rejecting class * because it failed compile-time verification (declaration of * appears in /data/app/**-1/base.apk)
/*
Notes:
gradleVersion = '2.14.1'
com.android.tools.build:gradle:2.2.3
compileSdkVersion 25
buildToolsVersion "25.0.2"
minSdkVersion 15
targetSdkVersion 25
*/
@mattsilber
mattsilber / replace_dimens_sdp.sh
Last active September 27, 2018 02:41
Script for converting all dip-related dimens to their sdp equivalents for use with https://github.com/intuit/sdp
for i in {320..1};
do
val="$(((${i} * 7) / 10))"
if [ "${val}" -lt "1" ]
then
val="1"
fi
#echo $val
@mattsilber
mattsilber / gradle.properties
Last active December 19, 2017 20:36
Gradle 4 replacement scripts for android values/manifest
# Disabled Aapt2 to fallback on xml file usage
android.enableAapt2=false
@mattsilber
mattsilber / Drawable.java
Last active September 28, 2016 15:40
Instagram's crappy colors in a ShaderFactory
ShapeDrawable.ShaderFactory factory = new ShapeDrawable.ShaderFactory() {
public Shader resize(int width, int height) {
final int[] colors = new int[]{ 0xFFFCDB7C, 0xFFE21C4D, 0xFF4832DF };
final float[] anchors = new float[]{ 0, .5f, 1 };
return new RadialGradient(width / 10, height, (float) (width * .8), colors, anchors, Shader.TileMode.CLAMP);
}
};
# Drawable.setShaderFactory(factory);
@mattsilber
mattsilber / convert_icon.sh
Created June 9, 2016 21:10
Take an SVG File and use inkscape to convert it to a PNG for each Android icon sizes
destFileName="${1/.svg/.png}"
sizes=( 48 72 96 144 192 512 )
for size in "${sizes[@]}"
do
mkdir $size/
inkscape -z -e $size/$destFileName -w $size -h $size $1
done