Skip to content

Commit

Permalink
Merge pull request #24 from Runebase/Abstraction
Browse files Browse the repository at this point in the history
Abstraction
  • Loading branch information
bobpepers authored Dec 20, 2023
2 parents 70f3db4 + 73c3ece commit 91577d9
Show file tree
Hide file tree
Showing 9 changed files with 167 additions and 29 deletions.
4 changes: 4 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ cp -r cordova/platforms/android/app/build/outputs/apk/debug/app-debug.apk "$comp
cp -r cordova/platforms/android/app/build/outputs/bundle/release/app-release.aab "$compiled_dir/Runebase-Lite-Wallet-v$version-release.aab"
cp -r dist-electron/*.AppImage "$compiled_dir"
cp -r dist-electron/*.exe "$compiled_dir"
cp -r dist-electron/*.deb "$compiled_dir"
cp -r dist-electron/latest.yml "$compiled_dir"
cp -r dist-electron/latest-linux.yml "$compiled_dir"


# Display a message indicating where the compiled files are located
echo "Compiled files are in the '$compiled_dir' directory."
2 changes: 1 addition & 1 deletion cordova/config.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<widget id="io.runebase.runebaselitewallet" version="1.6.7" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0" android-versionCode="167">
<widget id="io.runebase.runebaselitewallet" version="1.7.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0" android-versionCode="170">
<name>Runebase Lite Wallet</name>
<description>A lightweight wallet and transaction signing client for the Runebase network</description>
<author email="[email protected]" href="https://www.runebase.io">Bago</author>
Expand Down
2 changes: 1 addition & 1 deletion cordova/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "io.runebase.runebaselitewallet",
"displayName": "Runebase Lite Wallet",
"version": "1.6.7",
"version": "1.7.0",
"description": "A Runebase Lite Wallet",
"main": "index.js",
"scripts": {
Expand Down
6 changes: 4 additions & 2 deletions electron-builder-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ module.exports = {
'main.js'
],
win: {
icon: 'dist/icons/icon.ico'
icon: 'dist/icons/icon.ico',
target: ['nsis', 'portable']
},
linux: {
category: 'Utility',
icon: 'dist/icons/icon.png'
icon: 'dist/icons/icon.png',
target: ['deb', 'AppImage']
},
mac: {
icon: 'dist/icons/icon.icns',
Expand Down
56 changes: 49 additions & 7 deletions electron/main.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
// electron/main.js
const { app, BrowserWindow, Menu } = require('electron');
const { autoUpdater } = require('electron-updater');
const path = require('path');
const url = require('url');

let mainWindow;
let feedURL = 'https://github.com/runebase/runebase-lite-wallet/releases/latest';

function createWindow() {
mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: false,
contextIsolation: false,
enableRemoteModule: false,
contentSecurityPolicy: {
scriptSrc: ["'self'", "'unsafe-inline'", 'https://github.com/'],
},
},
});

Expand All @@ -22,18 +28,54 @@ function createWindow() {
})
);

// Remove the default menu bar
Menu.setApplicationMenu(null);
mainWindow.setMinimumSize(350, 600);

// mainWindow.webContents.openDevTools();

mainWindow.webContents.openDevTools();
mainWindow.on('closed', function () {
mainWindow = null;
});
}

app.on('ready', createWindow);
function checkForUpdates() {
autoUpdater.checkForUpdatesAndNotify();

autoUpdater.on('update-available', () => {
console.log('Update available');
mainWindow.webContents.send('update-available');
});

autoUpdater.on('update-downloaded', () => {
console.log('Update downloaded');
mainWindow.webContents.send('update-downloaded');
});

autoUpdater.on('error', (err) => {
console.error('AutoUpdater error:', err);
});

// Additional logging for update events
autoUpdater.on('checking-for-update', () => console.log('Checking for update'));
autoUpdater.on('update-not-available', () => console.log('No update available'));
}

app.on('ready', () => {
// Remove the default menu bar
Menu.setApplicationMenu(null);

// Generate Custom Menu
const menu = Menu.buildFromTemplate([
{
label: 'Check for Updates',
click: () => {
checkForUpdates();
},
},
]);
Menu.setApplicationMenu(menu);

createWindow();
// Check for updates
checkForUpdates();
});

app.on('window-all-closed', function () {
if (process.platform !== 'darwin') app.quit();
Expand Down
115 changes: 100 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
{
"name": "Runebase-Lite-Wallet",
"description": "LightWeight wallet for the Runebase blockchain",
"author": "Bago",
"version": "1.6.7",
"author": {
"name": "Bago",
"email": "[email protected]"
},
"version": "1.7.0",
"private": true,
"scripts": {
"clean": "rm -rf dist",
Expand Down Expand Up @@ -95,6 +98,7 @@
"create-hash": "^1.2.0",
"crypto-browserify": "^3.12.0",
"deep-equal": "^2.2.3",
"electron-updater": "^6.1.7",
"ethjs-abi": "^0.2.1",
"events": "^3.3.0",
"https-browserify": "^1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion static/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "RunebaseChrome",
"version": "1.6.7",
"version": "1.7.0",
"description": "Runebase lightweight wallet and transaction signing client.",
"icons": {
"16": "images/logo-main-16.png",
Expand Down
1 change: 1 addition & 0 deletions static/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1 user-scalable=no">
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; connect-src *;">
<title>Runebase Lite Wallet</title>
<link rel="stylesheet" href="./popup.css">
</head>
Expand Down

0 comments on commit 91577d9

Please sign in to comment.