Browse Source

added electron client patch ;)

scitor 1 year ago
parent
commit
e0cc87d9ee
Signed by: scitor (C4CB001A60CA5028)
1 changed files with 37 additions and 0 deletions
  1. 37
    0
      patch_mattermost_linux_client.sh

+ 37
- 0
patch_mattermost_linux_client.sh View File

@@ -0,0 +1,37 @@
1
+#!/bin/sh
2
+
3
+# workdir
4
+PWD=$(pwd); mkdir -p /tmp/mm-aes/app; cd /tmp/mm-aes
5
+
6
+# download newest version
7
+wget -q "https://git.estate/scitor/webchat-end2end/raw/branch/master/dist/mm-aes.min.js"
8
+
9
+# install (un)packer
10
+npm install asar
11
+
12
+# extract mattermost app
13
+node node_modules/asar/bin/asar.js extract /opt/Mattermost/resources/app.asar app
14
+
15
+# backup original app
16
+if [ ! -f /opt/Mattermost/resources/app.asar.orig ]; then
17
+	sudo mv /opt/Mattermost/resources/app.asar /opt/Mattermost/resources/app.asar.orig
18
+fi
19
+
20
+# make or use script copy
21
+if [ -f app/browser/webview/mattermost_bundle.js.orig ]; then
22
+	cp app/browser/webview/mattermost_bundle.js.orig app/browser/webview/mattermost_bundle.js
23
+else
24
+	cp app/browser/webview/mattermost_bundle.js app/browser/webview/mattermost_bundle.js.orig
25
+fi
26
+
27
+# add script to main js
28
+cat mm-aes.min.js >> app/browser/webview/mattermost_bundle.js
29
+
30
+# pack it back together
31
+node node_modules/asar/bin/asar.js pack app app.asar
32
+
33
+# move app to its place
34
+sudo mv app.asar /opt/Mattermost/resources/app.asar
35
+
36
+# clean up
37
+cd $PWD; rm -rf /tmp/mm-aes