Skip to content

Instantly share code, notes, and snippets.

@eighthave
eighthave / gist:6c4757f5877b88c5a586
Created January 5, 2016 19:17
panic response in zom
} else if (Panic.isTriggerIntent(intent)) {
if (PanicResponder.receivedTriggerFromConnectedApp(this)) {
if (Preferences.uninstallApp()) {
Log.i(TAG, "uninstallApp");
// lock and delete first for rapid response, then uninstall
shutdownAndLock(this);
PanicResponder.deleteAllAppData(this);
Intent uninstall = new Intent(Intent.ACTION_DELETE);
uninstall.setData(Uri.parse("package:" + getPackageName()));
startActivity(uninstall);
@eighthave
eighthave / screenshot2-to-clbin.sh
Created August 4, 2016 12:42
script to quickly take a screenshot from Android then post it to clbin.com
#!/bin/sh
cd ~/Downloads
filename=screenshot-`date '+%s'`.png
$ANDROID_HOME/tools/screenshot2 $@ $filename
echo ~/Downloads/$filename
curl -F "clbin=@$filename" https://clbin.com
@eighthave
eighthave / find-ga_trackingId.py
Created December 15, 2020 20:29
Scan the provided dirs for APKs, then search those APKs for the Google Firebase Analytics API Key Identifier.
#!/usr/bin/env python3
#
# Scan the provided dirs for APKs, then search those APKs for the
# Google Firebase Analytics API Key Identifier.
import os
import sys
import zipfile
from androguard.core.bytecodes.axml import AXMLPrinter
try:
@eighthave
eighthave / find-https-debian-archives.py
Last active December 25, 2020 19:04
Script to find official Debian mirrors that support HTTPS
#!/usr/bin/env python3
import urllib.request
import re
import ssl
import sys
# # find generic mirrors
mirrors = urllib.request.urlopen('http://www.debian.org/mirror/list')
https = []
@eighthave
eighthave / ndk-versions.py
Created May 25, 2021 15:33
list all known Android NDK versions as seen by fdroid/android-sdk-transparency-log
import re, requests
NDK_VERSION_NUMBER_REGEX = re.compile(r'[1-9][0-9]*\.[0-9]+\.[0-9]{7}(?:-[a-z0-9]+)?')
NDK_VERSION_REGEX = re.compile(r"""ndkVersion\s*[= ]\s*['"]([1-9][0-9]*\.[0-9]+\.[0-9]{7}(?:-[a-z0-9]+)?)["']""")
r = requests.get('https://gitlab.com/fdroid/android-sdk-transparency-log/-/raw/master/checksums.json')
data = r.json()
for url, entries in data.items():
for d in entries: