summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile1
-rw-r--r--pkg/branding/bitmask-logo.svg19
-rw-r--r--pkg/branding/branding.mk2
-rw-r--r--pkg/branding/patch_pixel_logo.py57
4 files changed, 79 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index f96d810d..8e275e93 100644
--- a/Makefile
+++ b/Makefile
@@ -147,6 +147,7 @@ checkout_leapdeps_develop:
include pkg/sumo-tarballs.mk
include pkg/pyinst/pyinst-build.mk
+include pkg/branding/branding.mk
clean :
$(RM) $(COMPILED_UI) $(COMPILED_RESOURCES) $(COMPILED_UI:.py=.pyc) $(COMPILED_RESOURCES:.py=.pyc)
diff --git a/pkg/branding/bitmask-logo.svg b/pkg/branding/bitmask-logo.svg
new file mode 100644
index 00000000..0eccc057
--- /dev/null
+++ b/pkg/branding/bitmask-logo.svg
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1" id="Layer_1" x="0px" y="0px" viewBox="30.4 627.3 612 171.1" enable-background="new 30.4 627.3 612 171.1" xml:space="preserve">
+<g>
+ <path fill="#3E3B38" d="m 233.99276,705.92697 q 3.69186,0 5.59865,-1.90576 1.90679,-1.90575 1.90679,-5.62198 0,-3.66857 -1.90679,-5.57433 -1.90679,-1.95339 -5.59865,-1.95339 l -8.64139,0 0,15.05546 8.64139,0 z m 0.52741,31.11145 q 4.70611,0 7.05917,-2.33455 2.39362,-2.33456 2.39362,-7.0513 0,-4.62145 -2.35305,-6.90836 -2.35306,-2.33455 -7.09974,-2.33455 l -9.1688,0 0,18.62876 9.1688,0 z m 14.52403,-25.58477 q 5.03067,1.71519 7.78943,6.33664 2.75875,4.62146 2.75875,11.33924 0,10.29108 -5.92321,15.34132 -5.92321,5.05026 -18.01304,5.05026 l -25.92418,0 0,-71.1323 23.44941,0 q 12.61725,0 18.25646,4.47852 5.67979,4.47853 5.67979,14.34081 0,5.19318 -2.06906,8.86176 -2.06906,3.62093 -6.00435,5.38375 z" />
+ <path fill="#3E3B38" d="m 263.627,678.38881 15.61943,0 0,71.1323 -15.61943,0 0,-71.1323 z" />
+ <path fill="#3E3B38" d="m 282.6846,678.38881 55.82421,0 0,13.86437 -20.08211,0 0,57.26793 -15.61943,0 0,-57.26793 -20.12267,0 0,-13.86437 z" />
+ <path fill="#3E3B38" d="m 341.82528,678.38881 19.87926,0 13.79377,38.06745 13.87492,-38.06745 19.83869,0 0,71.1323 -14.76745,0 0,-52.02711 -13.95605,38.35332 -9.89906,0 -13.95606,-38.35332 0,52.02711 -14.80802,0 0,-71.1323 z" />
+ <path fill="#3E3B38" d="m 456.62789,736.56198 -24.42309,0 -3.85415,12.95913 -15.70056,0 22.43518,-71.1323 18.62158,0 22.43517,71.1323 -15.70055,0 -3.81358,-12.95913 z m -20.52838,-13.19736 16.5931,0 -8.27627,-28.30046 -8.31683,28.30046 z" />
+ <path fill="#3E3B38" d="m 521.57008,680.62807 0,15.05547 q -4.9901,-2.62042 -9.73679,-3.95445 -4.74667,-1.33402 -8.96595,-1.33402 -5.59865,0 -8.27626,1.81046 -2.67762,1.81047 -2.67762,5.62198 0,2.85863 1.78509,4.47852 1.82563,1.57225 6.57232,2.71571 l 6.65347,1.57225 q 10.1019,2.38219 14.36175,7.24186 4.25984,4.85968 4.25984,13.81672 0,11.76804 -5.96378,17.53295 -5.92321,5.71726 -18.13476,5.71726 -5.76093,0 -11.56242,-1.28638 -5.8015,-1.28638 -11.603,-3.81151 l 0,-15.48426 q 5.8015,3.62093 11.1973,5.47904 5.43637,1.81047 10.46704,1.81047 5.11181,0 7.83,-2.00104 2.71818,-2.00104 2.71818,-5.71727 0,-3.33507 -1.86622,-5.14554 -1.82565,-1.81046 -7.34316,-3.23977 l -6.04491,-1.57226 q -9.08767,-2.2869 -13.30694,-7.28951 -4.1787,-5.00261 -4.1787,-13.48321 0,-10.62458 5.84207,-16.34184 5.84207,-5.71728 16.79595,-5.71728 4.9901,0 10.26419,0.90524 5.27409,0.85759 10.91331,2.62041 z" />
+ <path fill="#3E3B38" d="m 529.68237,678.38881 15.61942,0 0,25.96591 22.51631,-25.96591 18.13475,0 -29.16977,33.68421 32.17195,37.44809 -19.55471,0 -24.09853,-28.01459 0,28.01459 -15.61942,0 0,-71.1323 z" />
+ <path fill="#3E3B38" d="m 105.9,627.20077 -75.5,42.70117 0,85.79883 75.5,42.69922 75.5,-42.69922 0,-85.79883 -75.5,-42.70117 z m -32.06836,63.70508 -0.002,0.0976 c 4.21029,0.3754 7.67856,2.66948 11.22851,4.17579 5.587227,2.37079 9.140367,5.17357 14.253907,6.73437 2.529723,0.7722 4.122153,0.59681 5.978523,0.63281 l 0.004,0 c -0.008,-2e-4 0.0371,3e-4 0.0527,0 1.85774,-0.0365 3.45562,0.13969 5.98632,-0.63281 5.11354,-1.5608 8.66863,-4.36357 14.25586,-6.73437 3.80753,-1.61561 7.50206,-4.16896 12.14063,-4.25196 2.62211,-0.0472 5.77411,0.4276 7.9082,2.5918 4.02062,4.0774 5.05182,10.36502 4.81836,15.70312 -0.31466,7.1947 -3.34042,14.43571 -7.94726,19.91211 -3.21011,3.8161 -7.79539,7.87699 -13.29102,8.05469 -4.31698,0.1397 -7.55863,-3.15065 -10.25195,-5.24805 -2.24435,-1.7478 -5.32382,-3.79215 -8.14453,-4.96875 -2.7399,-1.1429 -5.50339,-1.15234 -5.49219,-1.15234 l -0.002,0 -0.0137,0 -0.004,0 c 0.0694,3e-4 -2.74684,0.01 -5.486333,1.15234 -2.8212,1.1768 -5.90485,3.22155 -8.14844,4.96875 -2.6927,2.0969 -5.929147,5.38775 -10.246087,5.24805 -5.49562,-0.1777 -10.08285,-4.23859 -13.29297,-8.05469 -4.60683,-5.4764 -7.63261,-12.71741 -7.94727,-19.91211 -0.23346,-5.3381 0.79774,-11.62572 4.81836,-15.70312 1.99925,-2.0275 4.90008,-2.56866 7.40625,-2.59766 l 1.41797,-0.0156 z m 2.22852,16.40625 c -0.40471,0.008 -0.79685,0.0358 -1.18555,0.0898 -0.93568,0.1303 -2.80387,1.0037 -4.26953,1.875 -0.62959,0.3742 -1.14469,0.71251 -1.58789,1.00781 0.35713,0.6424 0.85002,1.5059 1.42578,2.4375 1.16857,1.8908 2.74114,4.05049 3.72656,4.83789 4.74234,3.695 13.045167,4.66926 19.001957,-0.43554 0.83821,-0.6427 1.5034,-1.21185 2.08593,-1.71485 -1.06931,-0.6782 -2.15957,-1.38346 -3.21875,-2.00586 -2.49446,-1.4657 -4.73528,-3.08627 -7.113277,-3.95507 -2.99838,-1.0955 -6.05879,-2.18772 -8.86523,-2.13672 z m 58.22265,0 c -2.72231,0.0254 -5.66946,1.08042 -8.56054,2.13672 -2.37801,0.8688 -4.61882,2.48927 -7.11328,3.95507 -1.05934,0.6224 -2.15146,1.32766 -3.22071,2.00586 0.58205,0.5028 1.24645,1.07235 2.08399,1.71485 1.98552,1.5232 4.5424,3.12162 6.22851,3.51562 4.73565,1.1065 8.46108,0.36762 12.77539,-3.08008 0.98542,-0.7874 2.55996,-2.94904 3.72852,-4.83984 0.57576,-0.9316 1.06865,-1.79315 1.42578,-2.43555 -0.4432,-0.2953 -0.95829,-0.63361 -1.58789,-1.00781 -1.46565,-0.8713 -3.33385,-1.7447 -4.26953,-1.875 -0.48446,-0.067 -0.98075,-0.0898 -1.49024,-0.0898 z" />
+</g>
+<polygon id="clock1" fill="#3E3B38" points="105.8,657.8 105.8,628 105.8,627.3 181.4,669.9 152.5,683.1 " />
+<polygon id="clock2" fill="#3E3B38" points="152.5,683.1 181.4,669.9 181.4,755.7 152.5,743 " />
+<polygon id="clock3" fill="#3E3B38" points="105.9,798.3 105.9,769 152.5,743 181.4,755.7 " />
+<polygon id="clock4" fill="#3E3B38" points="58.7,743.1 105.9,769 105.9,798.3 30.4,755.7 " />
+<polygon id="clock5" fill="#3E3B38" points="30.4,669.9 58.6,683.1 58.7,743.1 30.4,755.7 " />
+<polygon id="clock6" fill="#3E3B38" points="105.8,628 105.8,657.8 58.6,683.1 30.4,669.9 105.8,627.3 " />
+</svg> \ No newline at end of file
diff --git a/pkg/branding/branding.mk b/pkg/branding/branding.mk
new file mode 100644
index 00000000..6b98d40d
--- /dev/null
+++ b/pkg/branding/branding.mk
@@ -0,0 +1,2 @@
+branding-logo:
+ python pkg/branding/patch_pixel_logo.py
diff --git a/pkg/branding/patch_pixel_logo.py b/pkg/branding/patch_pixel_logo.py
new file mode 100644
index 00000000..464bb729
--- /dev/null
+++ b/pkg/branding/patch_pixel_logo.py
@@ -0,0 +1,57 @@
+# -*- coding: utf-8 -*-
+# patch_pixelated_logo.py
+# Copyright (C) 2016 LEAP Encryption Acess Project
+#
+# 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,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+"""
+Patch the Pixelated Logo in the index.html, replacing it with a rebranded
+Bitmask Logo. To be used in the pixelated_www assets distributed with the
+Bitmask bundles.
+"""
+__author__ = 'Kali Kaneko <kali@leap.se>'
+
+import os
+import sys
+
+from BeautifulSoup import BeautifulSoup
+
+
+def patch_logo(orig_path, replacement_path):
+
+ with open(orig_path, 'r') as of:
+ orig = BeautifulSoup(of.read())
+
+ with open(replacement_path, 'r') as rf:
+ new = BeautifulSoup(rf.read())
+
+ new_svg = new.find('svg')
+ old_svg = orig.find('svg')
+ old_svg.replaceWith(new_svg)
+
+ with open(orig_path, 'w') as f:
+ f.write(str(orig))
+
+
+if __name__ == "__main__":
+ here = os.path.dirname(os.path.realpath(__file__))
+ if len(sys.argv) > 1:
+ orig_path = sys.argv[1]
+ else:
+ import pixelated_www
+ orig_path = os.path.join(pixelated_www.__path__[0],
+ 'index.html')
+ assert os.path.isfile(orig_path)
+ new_path = os.path.join(here, 'bitmask-logo.svg')
+ print('>>> patching file %s with logo in %s' % (orig_path, new_path))
+ patch_logo(orig_path, new_path)