Created
October 8, 2023 23:58
-
-
Save HPE-e-DEV/6818172fa85a8506b593365ce2f522fd to your computer and use it in GitHub Desktop.
Bit-App es un proyecto de código abierto para la comunidad criptográfica. ¡Todos los ejecutables están firmados con código y se publican automáticamente en Github! Esta aplicación también se actualizará automáticamente para asegurarse de que tenga la versión más estable.
This file contains hidden or 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
language: node_js | |
node_js: | |
- "8.11.1" | |
sudo: required | |
os: | |
- osx | |
env: | |
- TARGET_ARCH=x64 | |
services: | |
- docker | |
osx_image: xcode9.0 | |
cache: | |
directories: | |
- node_modules | |
addons: | |
apt: | |
packages: | |
- xvfb | |
- libusb-1.0-0 | |
- libusb-1.0-0-dev | |
- libudev-dev | |
before_install: | |
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker run -it -d -p 3001:3001 hunterlong/btcregtest-insight:latest; fi | |
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker run -it -d -p 3005:3005 hunterlong/ltcregtest-insight:latest; fi | |
script: | |
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then /bin/bash -c ./.travis/travis-test.sh; fi | |
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then /bin/bash -c ./.travis/release-osx.sh; fi |
This file contains hidden or 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
https://github.com/coinapp-io/desktop | |
https://coinapp.io/ | |
https://github.com/coinapp-io/desktop.git | |
MIT License | |
Copyright (c) 2018 Hunter Long | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all | |
copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | |
SOFTWARE. |
This file contains hidden or 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
const electron = require('electron'); | |
var log = require('electron-log'); | |
const ipcMain = electron.ipcMain; | |
const {app, BrowserWindow, TouchBar} = require('electron'); | |
const {TouchBarLabel, TouchBarButton, TouchBarSpacer} = TouchBar; | |
const {autoUpdater} = require("electron-updater"); | |
autoUpdater.logger = log; | |
autoUpdater.logger.transports.file.level = "info"; | |
const defaultMenu = require('electron-default-menu'); | |
const { Menu, shell } = electron; | |
const path = require('path'); | |
const url = require('url'); | |
var os = require('os'); | |
const Store = require('electron-store'); | |
const store = new Store(); | |
const logo = new TouchBarButton({ | |
icon: path.join(__dirname, 'app/images/iconsm.png'), | |
backgroundColor: '#000000', | |
click: () => { | |
} | |
}) | |
const initText = new TouchBarLabel({ | |
label: "CoinApp.io", | |
textColor: "#fdff1b" | |
}); | |
const versionText = new TouchBarLabel({ | |
label: 'v'+app.getVersion(), | |
textColor: "#c0c0c0" | |
}); | |
const secondText = new TouchBarLabel({ | |
label: "", | |
textColor: "#51ff19" | |
}); | |
const touchBar = new TouchBar([ | |
logo, | |
new TouchBarSpacer({size: 'small'}), | |
initText, | |
secondText | |
]); | |
function ChangeInitText(text, color="#fdff1b") { | |
initText.label = text; | |
initText.textColor = color; | |
} | |
function ChangeSecondText(text, color="#3dff1a") { | |
secondText.label = text; | |
secondText.textColor = color; | |
} | |
var alreadySet = store.get('set'); | |
store.set('version', app.getVersion()); | |
if (!alreadySet) { | |
store.set('set', true); | |
store.set('eth_conn', 'geth'); | |
store.set('geth', 'https://eth.coinapp.io'); | |
store.set('btc', 'https://btc.coinapp.io/api'); | |
store.set('ltc', 'https://ltc.coinapp.io/api'); | |
} | |
// Keep a global reference of the window object, if you don't, the window will | |
// be closed automatically when the JavaScript object is garbage collected. | |
let mainWindow; | |
function createWindow () { | |
// Create the browser window. | |
mainWindow = new BrowserWindow({ | |
backgroundColor: '#f7f7f7', | |
frame: false, | |
titleBarStyle: 'hidden', | |
width: 840, | |
height: 560, | |
show: false, | |
webPreferences: { | |
// allowRunningInsecureContent: false, | |
// experimentalFeatures: false, | |
// webSecurity: true, | |
// nodeIntegration: false, | |
// preload: __dirname+'/app/js/constants.js' | |
} | |
}); | |
if (process.env.NODE_ENV=="test") { | |
mainWindow.setResizable(true); | |
} else { | |
mainWindow.setResizable(false); | |
} | |
mainWindow.setFullScreenable(false); | |
mainWindow.setTouchBar(touchBar); | |
// and load the index.html of the app. | |
mainWindow.loadURL(url.format({ | |
pathname: path.join(__dirname, 'app/views/index.html'), | |
protocol: 'file:', | |
slashes: true | |
})); | |
mainWindow.once('ready-to-show', () => { | |
mainWindow.show(); | |
mainWindow.focus(); | |
}); | |
// mainWindow.loadURL(`http://localhost:${process.env.ELECTRON_WEBPACK_WDS_PORT}`) | |
// Open the DevTools. | |
// mainWindow.webContents.openDevTools() | |
// Emitted when the window is closed. | |
mainWindow.on('closed', function () { | |
// Dereference the window object, usually you would store windows | |
// in an array if your app supports multi windows, this is the time | |
// when you should delete the corresponding element. | |
mainWindow = null | |
}) | |
autoUpdater.checkForUpdates(); | |
} | |
// This method will be called when Electron has finished | |
// initialization and is ready to create browser windows. | |
// Some APIs can only be used after this event occurs. | |
app.on('ready', function(){ | |
// const menu = defaultMenu(app, shell); | |
if (process.env.NODE_ENV!="test" && os.platform()=="darwin") { | |
var template = [{ | |
label: "Edit", | |
submenu: [ | |
{label: "Copy", accelerator: "CmdOrCtrl+C", selector: "copy:"}, | |
{label: "Paste", accelerator: "CmdOrCtrl+V", selector: "paste:"} | |
] | |
} | |
]; | |
Menu.setApplicationMenu(Menu.buildFromTemplate(template)); | |
} | |
createWindow(); | |
}); | |
// Quit when all windows are closed. | |
app.on('window-all-closed', function () { | |
// On OS X it is common for applications and their menu bar | |
// to stay active until the user quits explicitly with Cmd + Q | |
// if (process.platform !== 'darwin') { | |
// app.quit() | |
// } | |
app.quit() | |
}); | |
app.on('activate', function () { | |
// On OS X it's common to re-create a window in the app when the | |
// dock icon is clicked and there are no other windows open. | |
if (mainWindow === null) { | |
createWindow() | |
} | |
}); | |
autoUpdater.on('checking-for-update', () => { | |
log.info('Checking for update...'); | |
}) | |
autoUpdater.on('update-available', (info) => { | |
mainWindow.webContents.send('newUpdateAvailable'); | |
}) | |
autoUpdater.on('update-not-available', (info) => { | |
log.info('Update not available.'); | |
}) | |
autoUpdater.on('error', (err) => { | |
log.info('Error in auto-updater. ' + err); | |
}) | |
autoUpdater.on('download-progress', (progressObj) => { | |
let log_message = "Download speed: " + progressObj.bytesPerSecond; | |
log_message = log_message + ' - Downloaded ' + progressObj.percent + '%'; | |
log_message = log_message + ' (' + progressObj.transferred + "/" + progressObj.total + ')'; | |
log.info(log_message); | |
mainWindow.webContents.send('updateProgressCheck', progressObj.percent); | |
}) | |
autoUpdater.on('update-downloaded', (info) => { | |
log.info('Update downloaded'); | |
mainWindow.webContents.send('completedDownload'); | |
}); | |
ipcMain.on("quitAndInstall", (event, arg) => { | |
autoUpdater.quitAndInstall(); | |
}); | |
ipcMain.on("closeApplication", (event, arg) => { | |
app.quit(); | |
}); | |
ipcMain.on("minimizeApp", (event, arg) => { | |
mainWindow.minimize(); | |
}); | |
ipcMain.on("ChangeInitText", (event, arg) => { | |
ChangeInitText(arg.text, arg.color); | |
}); | |
ipcMain.on("ChangeSecondText", (event, arg) => { | |
ChangeSecondText(arg.text, arg.color); | |
}); | |
// In this file you can include the rest of your app's specific main process | |
// code. You can also put them in separate files and require them here. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment