Skip to content

Instantly share code, notes, and snippets.

@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:
@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 / 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 / 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 / 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 / gist:5777441
Created June 13, 2013 21:14
I get email from accounts, then use that to look up display name
String email = null;
// get email address from first system account that looks like an email
AccountManager manager = AccountManager.get(this);
for (Account account : manager.getAccounts())
if (account.name.contains("@") && account.name.contains(".")) {
email = account.name;
EditText keyEmail = (EditText) findViewById(R.id.keyEmail);
keyEmail.setText(email);
break;
`ls -l > /tmp/conflict-files.txt`
total 4340
drwxr-xr-x 2 hans hans 4096 May 15 19:48 Google Play Store Screenshots
-rw-r--r-- 1 hans hans 14181 Jun 3 16:32 GPGTools (Hans-Christoph Steiner, Jun 3 16h32).png
-rw-r--r-- 1 hans hans 14181 Jun 3 16:32 GPGTools (Hans-Christoph Steiner, Jun 3 16h33).png
-rw-r--r-- 1 hans hans 14181 Jun 3 16:33 GPGTools (Hans-Christoph Steiner, Jun 3 16h34).png
-rw-r--r-- 1 hans hans 14181 Jun 3 16:34 GPGTools (Hans-Christoph Steiner, Jun 3 16h35).png
-rw-r--r-- 1 hans hans 14181 Jun 3 16:35 GPGTools (Hans-Christoph Steiner, Jun 3 16h36).png
-rw-r--r-- 1 hans hans 14181 Jun 3 16:36 GPGTools (Hans-Christoph Steiner, Jun 3 16h37).png
@eighthave
eighthave / gist:3307644
Created August 9, 2012 20:08
gnupg-for-android doesn't start
08-09 16:05:57.287: I/NativeHelper(14578): Finished NativeHelper.setup()
08-09 16:05:57.357: D/dalvikvm(14578): Trying to load lib /data/data/info.guardianproject.gpg/app_opt/lib/libgpg-error.so.0 0x405159a0
08-09 16:05:57.367: D/dalvikvm(14578): Added shared lib /data/data/info.guardianproject.gpg/app_opt/lib/libgpg-error.so.0 0x405159a0
08-09 16:05:57.367: D/dalvikvm(14578): No JNI_OnLoad found in /data/data/info.guardianproject.gpg/app_opt/lib/libgpg-error.so.0 0x405159a0, skipping init
08-09 16:05:57.367: D/dalvikvm(14578): Trying to load lib /data/data/info.guardianproject.gpg/app_opt/lib/libassuan.so.0 0x405159a0
08-09 16:05:57.377: D/dalvikvm(14578): Added shared lib /data/data/info.guardianproject.gpg/app_opt/lib/libassuan.so.0 0x405159a0
08-09 16:05:57.377: D/dalvikvm(14578): No JNI_OnLoad found in /data/data/info.guardianproject.gpg/app_opt/lib/libassuan.so.0 0x405159a0, skipping init
08-09 16:05:57.377: D/dalvikvm(14578): Trying to load lib /data/data/info.guardianproject.gpg/app_opt/lib/libgpgme.s
@eighthave
eighthave / gist:2407381
Created April 17, 2012 16:39
@guardianproject.info on gibberbot
04-17 12:33:06.580: W/System.err(17158): java.net.SocketException: Socket closed
04-17 12:33:06.580: W/System.err(17158): XMPPError establishing connection with server.: remote-server-error(502) XMPPError establishing connection with server.
04-17 12:33:06.580: W/System.err(17158): -- caused by: javax.net.ssl.SSLHandshakeException: root certificate not trusted of [hyper.to]
04-17 12:33:06.580: W/System.err(17158): at org.jivesoftware.smack.XMPPConnection.initReaderAndWriter(XMPPConnection.java:674)
04-17 12:33:06.580: W/System.err(17158): at org.jivesoftware.smack.XMPPConnection.proceedTLSReceived(XMPPConnection.java:810)
04-17 12:33:06.580: W/System.err(17158): at org.jivesoftware.smack.PacketReader.parsePackets(PacketReader.java:267)
04-17 12:33:06.580: W/System.err(17158): at org.jivesoftware.smack.PacketReader.access$000(PacketReader.java:43)
04-17 12:33:06.580: W/System.err(17158): at org.jivesoftware.smack.PacketReader$1.run(PacketReader.java:70)
04-17 12:33:06.580: W/System.err(17158): Nested Ex
Process: Telephone [2263]
Path: /Applications/Telephone.app/Contents/MacOS/Telephone
Identifier: com.tlphn.Telephone
Version: 1.0.2 (102)
Code Type: X86-64 (Native)
Parent Process: launchd [1201]
Date/Time: 2012-01-16 17:25:52.605 -0500
OS Version: Mac OS X 10.6.8 (10K549)
Report Version: 6