Skip to content

Instantly share code, notes, and snippets.

View commonsguy's full-sized avatar

Mark Murphy commonsguy

View GitHub Profile
@commonsguy
commonsguy / gif2animdraw
Last active May 1, 2023 14:26
Ruby script to convert animated GIF into an Android AnimationDrawable
#!/usr/bin/ruby
require 'fileutils'
require 'RMagick'
require 'slop'
require 'builder'
opts = Slop.new do
banner "gif2animdraw [options]\n"
on :i, :input=, 'path to animated GIF (or directory of GIFs)', :required => true
on :o, :outdir=, 'path to root output directory', :required => true
@commonsguy
commonsguy / SimpleAsyncTask.java
Created October 9, 2013 12:46
AsyncTask subclass with simplified API, to ease use by newcomers to Java, by avoiding generics and varargs. Simply subclass SimpleAsyncTask and override doInBackground() (no parameters, no return value) and onPostExecute() (also no parameters, no return value). Call execute() with no parameters to execute it in a thread pool. Data can be "passed…
/***
Copyright (c) 2013 CommonsWare, LLC
Licensed under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License. You may obtain a copy
of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless required
by applicable law or agreed to in writing, software distributed under the
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
OF ANY KIND, either express or implied. See the License for the specific
language governing permissions and limitations under the License.
@commonsguy
commonsguy / SQLCipherV3Helper.java
Last active December 25, 2015 23:39
SQLiteHookedHelper and SQLCipherV3Helper
/***
Copyright (c) 2013 CommonsWare, LLC
Licensed under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License. You may obtain a copy
of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless required
by applicable law or agreed to in writing, software distributed under the
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
OF ANY KIND, either express or implied. See the License for the specific
language governing permissions and limitations under the License.
*/
@commonsguy
commonsguy / LICENSE
Last active July 22, 2024 13:10
deaar: Convert Android AAR Artifacts Into Library Projects
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
package com.commonsware.myapplication;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.util.Log;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
@commonsguy
commonsguy / PwnedCheck.java
Created February 24, 2018 00:19
OkHttp/RxJava API for PwnedPasswords V2
package com.commonsware.android.pwnedcheck;
import java.io.IOException;
import java.security.MessageDigest;
import io.reactivex.Observable;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
public class PwnedCheck {