Skip to content

Instantly share code, notes, and snippets.

View SebiderSushi's full-sized avatar

Sebastian SebiderSushi

View GitHub Profile
@SebiderSushi
SebiderSushi / packages-xml_keyread.py
Last active February 9, 2022 01:33
Pulls required key & cert values for the LineageOS migration script from an arbitrary /data/system/packages.xml. See https://wiki.lineageos.org/signing_builds#using-a-script
#!/bin/python
import sys
import xml.etree.cElementTree as ET
if len(sys.argv) < 2 or len(sys.argv) > 3:
print("usage: " + sys.argv[0] + " FILE")
print(" FILE: path to the /data/system/packages.xml file.")
sys.exit(0)
@SebiderSushi
SebiderSushi / avformat-webvttdec_support-HLS-timestamp-maps.patch
Last active August 27, 2022 18:47
Let FFmpeg deal with HLS X-TIMESTAMP-MAP tags. This should be an option but that did not work for me so it is hardcoded in this patch to be always on.
From 892d0851cfd93737c679328583c2fe920a65c2ff Mon Sep 17 00:00:00 2001
From: Sebastian Zeller <SebiderSushi@t-online.de>
Date: Tue, 5 Jan 2021 03:38:01 +0100
Subject: [PATCH] avformat/webvttdec: Add support for HLS WebVTT MPEG
timestamp map
---
libavformat/webvttdec.c | 55 ++++++++++++++++++++++++++++++++++++++++-
1 file changed, 54 insertions(+), 1 deletion(-)
@SebiderSushi
SebiderSushi / appdata-backup-restore.sh
Last active April 25, 2022 20:38
Backup & restore android app data. Intended for rooted/recovery terminal or adb shell.
#!/bin/sh
# Create a backup from one app datadir into a tape archive
# APP_DATADIR is the corresponding app data directory for the user you want to back up
# the primary is located in /data/data, for additional users see /data/user/
function abr_backup {
[ $# -ne 2 ] && { echo "usage: $FUNCNAME APP_DATADIR BACKUP_FILEPATH"; return; }
local datadir="$1"; local archive="$2"
tar cf "$archive" -C "$datadir" --exclude="lib" . && echo "${archive} backup ok!"
}
# Restore app data from a tape archive and set proper file permissions & SELinux context