Skip to content

Instantly share code, notes, and snippets.

View fourkbomb's full-sized avatar

Simon Shields fourkbomb

View GitHub Profile
@fourkbomb
fourkbomb / unbrand.pl
Last active December 29, 2016 05:39
unbrand.sh
#!/usr/bin/perl -ni
if (/app_name/) {
s/C(?:yanogen)?M(?:od)?//g;
# strip surrounding spaces too1
s/(\S) +</$1</g;
s/> +(\S)/>$1/g;
}
print;
if (/Copyright/) {
s/20.+? /2017 /g;
echo Purging old target_files...
rm out/dist/*target_files*
echo Making dist...
mka dist
echo Signing target files apks...
TARGET_FILES_SIGNED=lineage-$(get_build_var LINEAGE_VERSION)-signed-target_files.zip
./build/tools/releasetools/sign_target_files_apks -o -d ~/.android-certs out/dist/*-target_files-*.zip $TARGET_FILES_SIGNED
echo Generating ota package...
OTA_PACKAGE=lineage-$(get_build_var LINEAGE_VERSION)-install.zip
./build/tools/releasetools/ota_from_target_files -k ~/.android-certs/releasekey $TARGET_FILES_SIGNED $OTA_PACKAGE
@fourkbomb
fourkbomb / osrc_download.py
Created September 28, 2017 02:42
download source releases from samsung OSRC using a terminal
#!/usr/bin/env python3
# Copyright (c) 2017 Simon Shields
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
@fourkbomb
fourkbomb / dtb_diff.py
Last active June 22, 2019 07:17
basic diff between two device tree blobs, attempts to account for differing phandles
#!/usr/bin/env python
# Copyright (C) 2019 Simon Shields <simon@lineageos.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,