diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..cdfafe0 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,97 @@ +language: cpp + +# Any time a commit is done to either master or WIP we do a CI build on all three platforms to make sure it really builds. The linux version will be saved to the continuous tag +# and thus available for testing. All three platforms will get a proper release upon a tagged commit. + +matrix: + include: + - os: linux + dist: xenial + compiler: gcc + sudo: require + before_install: + - sudo add-apt-repository ppa:beineri/opt-qt-5.12.3-xenial -y + - sudo apt-get update -qq + + install: + - sudo apt-get -y install qt512base qt512connectivity qt512imageformats qt512serialport qt512serialbus qt512doc qt512tools libgl1-mesa-dev + - source /opt/qt*/bin/qt*-env.sh + + script: + - qmake CONFIG+=release PREFIX=/usr + - make -j$(nproc) + - make INSTALL_ROOT=appdir -j$(nproc) install ; find appdir/ + - wget -c -nv "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" + - chmod a+x linuxdeployqt-continuous-x86_64.AppImage + # export VERSION=... # linuxdeployqt uses this for naming the file + - ./linuxdeployqt-continuous-x86_64.AppImage appdir/usr/local/share/applications/SavvyCAN.desktop -appimage -extra-plugins=iconengines,platformthemes.libqgtk3.so + + after_success: + # find appdir -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " -f 2-3 | sort | uniq # for debugging + # curl --upload-file APPNAME*.AppImage https://transfer.sh/APPNAME-git.$(git rev-parse --short HEAD)-x86_64.AppImage + - wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh + - bash upload.sh SavvyCAN*.AppImage* + + deploy: + provider: releases + skip_cleanup: true + api_key: $GITHUB_TOKEN + file_glob: true + file: SavvyCAN*.AppImage + on: + tags: true #deploy is only done on tagged builds + draft: false + + - os: osx + osx_image: xcode10 + before_install: + - brew install qt5 + - brew link qt5 --force + script: + - qmake CONFIG+=release -spec macx-xcode SavvyCAN.pro + - xcodebuild + - cp *.q* Release/SavvyCAN.app/Contents/MacOS/ + - cd Release + - ls SavvyCAN.app/Contents/MacOS + - macdeployqt SavvyCAN.app -dmg + deploy: + provider: releases + skip_cleanup: true + api_key: $GITHUB_TOKEN + file: SavvyCAN.dmg + on: + tags: true + draft: false + + - os: windows + before_install: + - cmd.exe /C 'cd && "C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Auxiliary/Build/vcvars32.bat"' + - choco install zip + - curl -vLO http://download.qt.io/official_releases/online_installers/qt-unified-windows-x86-online.exe + - "./qt-unified-windows-x86-online.exe --verbose --script qt-installer-windows.qs" + script: + - cmd.exe /C 'cd && "C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Auxiliary/Build/vcvars32.bat" && cd && "C:/Qt/5.12.3/msvc2017/bin/qmake" CONFIG+=RELEASE SavvyCAN.pro && cd && nmake' + - ls + - cmd.exe /C 'cd release && "C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Auxiliary/Build/vcvars32.bat" && "C:/Qt/5.12.3/msvc2017/bin/windeployqt.exe" ./SavvyCAN.exe' + - cd release + - ls + - rm *.cpp + - rm *.h + - rm *.obj + - cp ../*.q* . + - cp -r ../examples . + - 7z a -tzip SavvyCAN32.zip -r * + + deploy: + provider: releases + skip_cleanup: true + api_key: $GITHUB_TOKEN + file: SavvyCAN32.zip + on: + tags: true + draft: false + +branches: + only: + - master + - WIP diff --git a/SavvyCAN.desktop b/SavvyCAN.desktop index 3b52fdb..076ee6a 100644 --- a/SavvyCAN.desktop +++ b/SavvyCAN.desktop @@ -3,10 +3,9 @@ Type=Application Name=SavvyCAN GenericName=CANBus reverse engineering tool Comment=Facilitates reverse engineering of canbus captures -Exec=FULLPATH/SavvyCAN -Icon=FULLPATH/icon/SavvyIcon.png +Exec=SavvyCAN +Icon=SavvyCAN Terminal=false Categories=Development;Electronics;IDE; -MimeType=text/x-application +MimeType=text/x-application; Keywords=embedded electronics;electronics;canbus;reverse engineering; -Name[en_US]=SavvyCAN diff --git a/SavvyCAN.pro b/SavvyCAN.pro index 9d67acf..f954497 100644 --- a/SavvyCAN.pro +++ b/SavvyCAN.pro @@ -157,9 +157,7 @@ FORMS += ui/candatagrid.ui \ helpwindow.ui \ ui/newconnectiondialog.ui \ ui/temporalgraphwindow.ui - -DISTFILES += - + RESOURCES += \ icons.qrc \ images.qrc @@ -167,3 +165,30 @@ RESOURCES += \ win32 { LIBS += opengl32.lib } + +unix { + isEmpty(PREFIX) + { + PREFIX=/usr/local + } + target.path = $$PREFIX/bin + shortcutfiles.files=SavvyCAN.desktop + shortcutfiles.path = $$PREFIX/share/applications + INSTALLS += shortcutfiles + DISTFILES += SavvyCAN.desktop +} + +examplefiles.files=examples +examplefiles.path = $$PREFIX/share/savvycan/examples +INSTALLS += examplefiles + +iconfiles.files=icons +iconfiles.path = $$PREFIX/share/icons +INSTALLS += iconfiles + +helpfiles.files=SavvyCAN.q* +helpfiles.path = $$PREFIX/bin +INSTALLS += helpfiles + +INSTALLS += target + diff --git a/docs/source/flowview.rst b/docs/source/flowview.rst index 2dbca97..be8c56a 100644 --- a/docs/source/flowview.rst +++ b/docs/source/flowview.rst @@ -27,7 +27,7 @@ Between these three views you should have a very good idea of how the data bytes Controlling the Flow ===================== -The screen has many ways to control the flow. The "Playback Control" box has 6 icons in a 3x2 grid. The upper icons mean (from left to right): Go back one frame, Stop, Go forward one frame. The bottom icons mean: Play backward, pause, Play forward. Playback speed is used to control how quickly the flow happens. You can raise and lower this value even as the flow is playing back and it will change the flow speed in realtime. You can select "Loop Playback" to keep looping over and over. +The screen has many ways to control the flow. The "Playback Control" box has 6 icons in a 3x2 grid. The upper icons mean (from left to right): Go back one frame, Stop, Go forward one frame. The bottom icons mean: Play backward, pause, Play forward. Playback speed is used to control how quickly the flow happens. You can raise and lower this value even as the flow is playing back and it will change the flow speed in realtime. You can select "Loop Playback" to keep looping over and over. It is possible to select "0" as the frame interval. This will make the program progress as quickly as it can. This probably will not be much faster than a frame interval of 1 but it will be a bit faster. Additional control options @@ -39,10 +39,10 @@ Reference Values ================= Previously it was mentioned that bits in the 8x8 grid are colored based on whether they are -newly on/off or steady state compared to the reference. What is the reference? Well, look to the left of the 8x8 grid. The reference values here are used for reference with the 8x8 grid. You can set these values to something static and then see how bits compare to that static reference. Or, above the reference values is a checkbox called "Auto Reference" if this is clicked then the last frame is used as a reference for the current one. There are advantages to both options. A static reference can be used to see how things change compared to, say, the very first frame. Auto reference shows how the data changed from frame to frame. Either might yield interesting findings. +newly on/off or steady state compared to the reference. What is the reference? Well, look to the left of the 8x8 grid. The reference values here are used for reference with the 8x8 grid. You can set these values to something static and then see how bits compare to that static reference. Or, above the reference values is a checkbox called "Auto Reference" if this is clicked then the last frame is used as a reference for the current one. There are advantages to both options. A static reference can be used to see how things change compared to, say, the very first frame. Auto reference shows how the data changed from frame to frame. Either might yield interesting findings. The default values for static reference are taken from the values that the first frame has. You are free to change them to any value 0 through 0xFF. Seeking to Specific Values =========================== -Lastly, it is possible to seek to specific values. "Data Seek Values" normally default to -1. But, if a value other than -1 is found in one of these boxes then it will be used as a seek value. Any time the flow is playing back (either forward or backward) it will compare to the seek values. If there is a match then playback will automatically stop. This can be used to quickly play things back until you get to a specific value. One use would be to seek to a known value that precedes an important section you want to analyze in more depth. +Lastly, it is possible to seek to specific values. "Data Seek Values" normally default to -1. But, if a value other than -1 is found in one of these boxes then it will be used as a seek value. Any time the flow is playing back (either forward or backward) it will compare to the seek values. If there is a match then playback will automatically stop. This can be used to quickly play things back until you get to a specific value. One use would be to seek to a known value that precedes an important section you want to analyze in more depth. Also, in this same vein, if you click in the 8x8 grid of bits you will see that the cell you clicked on has the text turn blue and become bold. Any bit that you've selected this way will also act as a way to stop playback. If that bit changes, either being set or unset, then playback will stop. Click the cell again to deselect it. diff --git a/icon/SavvyIcon.png b/icons/SavvyIcon.png similarity index 100% rename from icon/SavvyIcon.png rename to icons/SavvyIcon.png diff --git a/icons/hicolor/256x256/apps/SavvyCAN.png b/icons/hicolor/256x256/apps/SavvyCAN.png new file mode 100644 index 0000000..6a34ad9 Binary files /dev/null and b/icons/hicolor/256x256/apps/SavvyCAN.png differ diff --git a/icons/hicolor/scalable/apps/SavvyCAN.png b/icons/hicolor/scalable/apps/SavvyCAN.png new file mode 100644 index 0000000..6a34ad9 Binary files /dev/null and b/icons/hicolor/scalable/apps/SavvyCAN.png differ diff --git a/qt-installer-windows.qs b/qt-installer-windows.qs new file mode 100644 index 0000000..8164790 --- /dev/null +++ b/qt-installer-windows.qs @@ -0,0 +1,92 @@ +/* + * Qt Installer script for a non-interactive installation of Qt5 on Windows. + * Installs the 64-bit package if environment variable PLATFORM="x64". + */ + +// jshint strict:false +/* globals QInstaller, QMessageBox, buttons, gui, installer, console */ + +// Run with: +// .\qt-unified-windows-x86-3.0.4-online.exe --verbose --script tools\qt-installer-windows.qs + +// Look for Name elements in +// https://download.qt.io/online/qtsdkrepository/windows_x86/desktop/qt5_5123/Updates.xml +// Unfortunately it is not possible to disable deps like qt.tools.qtcreator +var INSTALL_COMPONENTS = [ + installer.environmentVariable("PLATFORM") == "x64" ? + "qt.qt5.5123.win64_msvc2017_64" : + "qt.qt5.5123.win32_msvc2017", +]; + +function Controller() { + // Continue on installing to an existing (possibly empty) directory. + installer.setMessageBoxAutomaticAnswer("OverwriteTargetDirectory", QMessageBox.Yes); + // Continue at "SHOW FINISHED PAGE" + installer.installationFinished.connect(function() { + console.log("installationFinished"); + gui.clickButton(buttons.NextButton); + }); +} + +Controller.prototype.WelcomePageCallback = function() { + console.log("Step: " + gui.currentPageWidget()); + // At least for 3.0.4 immediately clicking Next fails, so wait a bit. + // https://github.com/benlau/qtci/commit/85cb986b66af4807a928c70e13d82d00dc26ebf0 + gui.clickButton(buttons.NextButton, 1000); +}; + +Controller.prototype.CredentialsPageCallback = function() { + console.log("Step: " + gui.currentPageWidget()); + gui.clickButton(buttons.NextButton); +}; + +Controller.prototype.IntroductionPageCallback = function() { + console.log("Step: " + gui.currentPageWidget()); + gui.clickButton(buttons.NextButton); +}; + +Controller.prototype.TargetDirectoryPageCallback = function() { + console.log("Step: " + gui.currentPageWidget()); + // Keep default at "C:\Qt". + //gui.currentPageWidget().TargetDirectoryLineEdit.setText("E:\\Qt"); + gui.clickButton(buttons.NextButton); +}; + +Controller.prototype.ComponentSelectionPageCallback = function() { + console.log("Step: " + gui.currentPageWidget()); + var page = gui.currentPageWidget(); + page.deselectAll(); + for (var i = 0; i < INSTALL_COMPONENTS.length; i++) { + page.selectComponent(INSTALL_COMPONENTS[i]); + } + gui.clickButton(buttons.NextButton); +}; + +Controller.prototype.LicenseAgreementPageCallback = function() { + console.log("Step: " + gui.currentPageWidget()); + gui.currentPageWidget().AcceptLicenseRadioButton.setChecked(true); + gui.clickButton(buttons.NextButton); +}; + +Controller.prototype.StartMenuDirectoryPageCallback = function() { + console.log("Step: " + gui.currentPageWidget()); + gui.clickButton(buttons.NextButton); +}; + +Controller.prototype.ReadyForInstallationPageCallback = function() { + console.log("Step: " + gui.currentPageWidget()); + gui.clickButton(buttons.NextButton); +}; + +Controller.prototype.FinishedPageCallback = function() { + console.log("Step: " + gui.currentPageWidget()); + // TODO somehow the installer crashes after this step. + // https://stackoverflow.com/questions/25105269/silent-install-qt-run-installer-on-ubuntu-server + var checkBoxForm = gui.currentPageWidget().LaunchQtCreatorCheckBoxForm; + if (checkBoxForm && checkBoxForm.launchQtCreatorCheckBox) { + checkBoxForm.launchQtCreatorCheckBox.checked = false; + } + gui.clickButton(buttons.FinishButton); +}; + +// vim: set ft=javascript: