Skip to content
This repository has been archived by the owner on Nov 12, 2018. It is now read-only.

support arm64 #675

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
"build:linux32": "./scripts/build.sh linux ia32",
"build:linux": "./scripts/build.sh linux x64",
"build:linux64": "./scripts/build.sh linux x64",
"build:linuxArm64": "./scripts/build.sh linux arm64",
"build:linuxMips64el": "./scripts/build.sh linux mips64el",
"build:win": ".\\scripts\\build-win32.bat win32 ia32",
"build:win32": ".\\scripts\\build-win32.bat win32 ia32",
"build:win64": ".\\scripts\\build-win32.bat win32 x64"
Expand All @@ -32,13 +34,13 @@
},
"homepage": "https://github.com/geeeeeeeeek/wechat-electron/",
"dependencies": {
"electron": "1.4.15",
"electron-packager": "^8.5.1",
"nconf": "^0.8.4",
"pinyin": "^2.8.0",
"emojione": "^2.2.7",
"electron": "4.1.3",
"electron-localshortcut": "1.1.0",
"is-xfce": "^1.0.2"
"electron-packager": "^12.0.0",
"emojione": "^2.2.7",
"is-xfce": "^1.0.2",
"nconf": "^0.8.4",
"pinyin": "^2.8.0"
},
"devDependencies": {
"babel-eslint": "^7.1.1",
Expand Down
2 changes: 2 additions & 0 deletions scripts/build-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ function build() {
build darwin x64
build linux ia32
build linux x64
build linux arm64
build linux mips64el
#build win32 ia32
10 changes: 8 additions & 2 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fi
if [ "$#" -ne 2 ]; then
echo -e "Usage: ./script/build.sh <platform> <arch>"
echo -e " platform: darwin, linux, win32"
echo -e " arch: ia32, x64"
echo -e " arch: ia32, x64,arm64"
exit 1
fi

Expand All @@ -27,7 +27,13 @@ fi

ignore_list="dist|scripts|\.idea|.*\.md|.*\.yml|node_modules/nodejieba"

electron-packager . "${APP_NAME}" --platform=$PLATFORM --arch=$ARCH --electronVersion=1.4.15 --app-version=1.4.0 --asar --icon=assets/icon.icns --overwrite --out=./dist --ignore=${ignore_list}
if [$ARCH = "mips64el" ];then
ElectronVersion="1.8.2-beta.5"
else
ElectronVersion="1.8.7"
fi

electron-packager . "${APP_NAME}" --platform=$PLATFORM --arch=$ARCH --electronVersion=$ElectronVersion --app-version=1.4.0 --asar --icon=assets/icon.icns --overwrite --out=./dist --ignore=${ignore_list}

if [ $? -eq 0 ]; then
echo -e "$(tput setaf 2)Packaging for $PLATFORM $ARCH succeeded.$(tput sgr0)\n"
Expand Down
9 changes: 9 additions & 0 deletions scripts/tar-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,13 @@ echo 'Start compressing for Linux ia32.'
tar zcf 'linux-ia32.tar.gz' 'electronic-wechat-linux-ia32'
echo 'Compressing for Linux ia32 succeed.'

echo 'Start compressing for Linux arm64.'
tar zcf 'linux-arm64.tar.gz' 'electronic-wechat-linux-arm64'
echo 'Compressing for Linux arm64 succeed.'

echo 'Start compressing for Linux mips64el.'
tar zcf 'linux-mips64el.tar.gz' 'electronic-wechat-linux-mips64el'
echo 'Compressing for Linux arm64 succeed.'

cd ..
cd ..
2 changes: 2 additions & 0 deletions src/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class Common {
}
Common.ELECTRON = 'Electron';
Common.ELECTRONIC_WECHAT = 'Electronic WeChat';
Common.PREFERENCE = 'Preference';
Common.DEBUG_MODE = false;
Common.WINDOW_SIZE = {
width: 800,
Expand Down Expand Up @@ -84,6 +85,7 @@ Common.MENU = {
hideOther: 'Hide Others',
showAll: 'Show All',
pref: 'Preference',
show: 'Show',
quit: 'Quit',
edit: 'Edit',
undo: 'Undo',
Expand Down
4 changes: 3 additions & 1 deletion src/common_cn.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ class Common {

}
Common.ELECTRON = 'Electron';
Common.ELECTRONIC_WECHAT = 'Electronic WeChat';
Common.ELECTRONIC_WECHAT = '微信';
Common.PREFERENCE = '偏好';
Common.DEBUG_MODE = false;
Common.WINDOW_SIZE = {
width: 800,
Expand Down Expand Up @@ -70,6 +71,7 @@ Common.MENU = {
hideOther: '隐藏其他窗口',
showAll: '显示全部窗口',
pref: '偏好',
show: '显示',
quit: '退出',
edit: '编辑',
undo: '撤销',
Expand Down
13 changes: 12 additions & 1 deletion src/inject/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,18 @@
* Created by Zhongyi on 2/23/16.
*/
'use strict';
const Common = require('../common');

const AppConfig = require('../configuration');

const lan = AppConfig.readSettings('language');

let Common;
if (lan === 'zh-CN') {
Common = require('../common_cn');
} else {
Common = require('../common');
}


class CSSInjector {
}
Expand Down
13 changes: 12 additions & 1 deletion src/inject/mention_menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,18 @@
*/

'use strict';
const Common = require('../common');

const AppConfig = require('../configuration');

const lan = AppConfig.readSettings('language');

let Common;
if (lan === 'zh-CN') {
Common = require('../common_cn');
} else {
Common = require('../common');
}

const pinyin = require('pinyin');

class MentionMenu {
Expand Down
10 changes: 9 additions & 1 deletion src/inject/preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,20 @@ const MenuHandler = require('../handlers/menu');
const ShareMenu = require('./share_menu');
const MentionMenu = require('./mention_menu');
const BadgeCount = require('./badge_count');
const Common = require('../common');
// const EmojiParser = require('./emoji_parser');
// const emojione = require('emojione');

const AppConfig = require('../configuration');

const lan = AppConfig.readSettings('language');

let Common;
if (lan === 'zh-CN') {
Common = require('../common_cn');
} else {
Common = require('../common');
}

class Injector {
init() {
if (Common.DEBUG_MODE) {
Expand Down
20 changes: 11 additions & 9 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
'use strict';

const AppConfig = require('./configuration');
if (!AppConfig.readSettings('language')) {
AppConfig.saveSettings('language', 'zh-CN');
AppConfig.saveSettings('prevent-recall', 'on');
AppConfig.saveSettings('icon', 'black');
AppConfig.saveSettings('multi-instance','on');
}

const path = require('path');
const {app, ipcMain} = require('electron');

const UpdateHandler = require('./handlers/update');
const Common = require('./common');
const AppConfig = require('./configuration');
const Common = require('./common_cn');

const SplashWindow = require('./windows/controllers/splash');
const WeChatWindow = require('./windows/controllers/wechat');
Expand All @@ -21,6 +28,7 @@ class ElectronicWeChat {
}

init() {

if(this.checkInstance()) {
this.initApp();
this.initIPC();
Expand All @@ -46,16 +54,10 @@ class ElectronicWeChat {
}
initApp() {
app.on('ready', ()=> {

this.createSplashWindow();
this.createWeChatWindow();
this.createTray();

if (!AppConfig.readSettings('language')) {
AppConfig.saveSettings('language', 'en');
AppConfig.saveSettings('prevent-recall', 'on');
AppConfig.saveSettings('icon', 'black');
AppConfig.saveSettings('multi-instance','on');
}
});

app.on('activate', () => {
Expand Down
4 changes: 2 additions & 2 deletions src/windows/controllers/app_tray.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ class AppTray {

if (process.platform === 'linux' || process.platform === 'win32') {
const contextMenu = Menu.buildFromTemplate([
{ label: 'Show', click: () => this.hideSplashAndShowWeChat() },
{ label: 'Exit', click: () => app.exit(0) },
{ label: Common.MENU.show, click: () => this.hideSplashAndShowWeChat() },
{ label: Common.MENU.quit, click: () => app.exit(0) },
]);
this.tray.setContextMenu(contextMenu);
}
Expand Down
1 change: 1 addition & 0 deletions src/windows/controllers/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class SettingsWindow {

createSettingsWindow() {
this.settingsWindow = new BrowserWindow({
title: Common.PREFERENCE,
width: Common.WINDOW_SIZE_SETTINGS.width,
height: Common.WINDOW_SIZE_SETTINGS.height * 0.9,
resizable: false,
Expand Down
1 change: 0 additions & 1 deletion src/windows/views/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<head>
<link href="../styles/settings.css" rel="stylesheet">
<meta charset="UTF-8">
<title>Settings</title>
</head>

<body class="page">
Expand Down