Last active
December 29, 2016 05:39
-
-
Save fourkbomb/c5a2dc7fd7122cff49e9f34aef137c20 to your computer and use it in GitHub Desktop.
unbrand.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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