Skip to content

Instantly share code, notes, and snippets.

@fourkbomb
Last active December 29, 2016 05:39
Show Gist options
  • Save fourkbomb/c5a2dc7fd7122cff49e9f34aef137c20 to your computer and use it in GitHub Desktop.
Save fourkbomb/c5a2dc7fd7122cff49e9f34aef137c20 to your computer and use it in GitHub Desktop.
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;
s/CyanogenMod/LineageOS/;
s/Copyright/ /;
print;
}
#!/bin/sh
# put both files in $PATH, make them executable.
# run unbrand.sh in the root of any projects you want to unbrand.
find * -name '*strings.xml' -exec unbrand.pl {} \;
git diff --stat | grep ' 1 \+' | grep strings.xml | awk '{ print $1 }' | xargs git checkout HEAD --
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment