Compare commits

...

39 commits
v1.0 ... main

Author SHA1 Message Date
d6cd6ebc3d Update flatpak.xml
All checks were successful
Auto build / Build Debian Package (push) Successful in 16s
Auto build / Build Flatpak Package (push) Successful in 24s
2024-12-30 20:21:23 -08:00
49f828ccf0 Update .forgejo/workflows/build.yml
All checks were successful
Auto build / Build Debian Package (push) Successful in 42s
Auto build / Build Flatpak Package (push) Successful in 1m5s
2024-12-27 21:55:10 -08:00
f15a14d470 Update .forgejo/workflows/build.yml
All checks were successful
Auto build / Build Debian Package (push) Successful in 45s
Auto build / Build Flatpak Package (push) Successful in 1m4s
2024-12-27 21:35:18 -08:00
147ebccfd8 Update .forgejo/workflows/build.yml
Some checks failed
Auto build / Build Flatpak Package (push) Failing after 43s
Auto build / Build Debian Package (push) Successful in 45s
2024-12-27 21:33:48 -08:00
ac5f5aad23 Update .forgejo/workflows/build.yml
All checks were successful
Auto build / Build Debian Package (push) Successful in 1m0s
Auto build / Build Flatpak Package (push) Successful in 1m4s
2024-12-27 21:01:50 -08:00
286dac970e Update generate-flatpak.py
Some checks failed
Auto build / Build Debian Package (push) Successful in 49s
Auto build / Build Flatpak Package (push) Failing after 44s
2024-12-27 18:15:39 -08:00
564821d707 Update generate-flatpak.py
Some checks failed
Auto build / Build Debian Package (push) Successful in 31s
Auto build / Build Flatpak Package (push) Failing after 27s
2024-12-27 18:02:40 -08:00
162388a1a9 Upload files to "/"
Some checks failed
Auto build / Build Debian Package (push) Successful in 42s
Auto build / Build Flatpak Package (push) Failing after 29s
2024-12-27 18:00:22 -08:00
1f0eb0e79d Update .forgejo/workflows/build.yml
Some checks failed
Auto build / Build Debian Package (push) Successful in 33s
Auto build / Build Flatpak Package (push) Failing after 5m0s
2024-12-27 17:34:44 -08:00
00be7e6206 Upload files to "/"
Some checks failed
Auto build / Build Debian Package (push) Successful in 53s
Auto build / Build Flatpak Package (push) Failing after 31s
2024-12-27 17:32:57 -08:00
27f248292e Update .forgejo/workflows/build.yml
All checks were successful
Auto build / Build Debian Package (push) Successful in 36s
Auto build / Build Flatpak Package (push) Successful in 52s
2024-12-27 00:25:32 -08:00
b499977e44 Update .forgejo/workflows/build.yml
Some checks failed
Auto build / Build Debian Package (push) Failing after 29s
Auto build / Build Flatpak Package (push) Successful in 50s
2024-12-27 00:22:43 -08:00
39f1c41a60 Update codes.swee.SweeCryptGTK.json
Some checks failed
Auto build / Build Debian Package (push) Successful in 37s
Auto build / Build Flatpak Package (push) Failing after 45s
2024-12-27 00:18:42 -08:00
2f8ab31ef5 Update .forgejo/workflows/build.yml
Some checks failed
Auto build / Build Debian Package (push) Successful in 34s
Auto build / Build Flatpak Package (push) Failing after 49s
2024-12-27 00:16:14 -08:00
12c1b69037 Update .forgejo/workflows/build.yml
Some checks failed
Auto build / Build Debian Package (push) Successful in 36s
Auto build / Build Flatpak Package (push) Failing after 38s
2024-12-27 00:11:32 -08:00
074a7287a1 Update .forgejo/workflows/build.yml
Some checks failed
Auto build / Build Debian Package (push) Successful in 37s
Auto build / Build Flatpak Package (push) Failing after 28s
2024-12-27 00:09:40 -08:00
6832d425e9 Update .forgejo/workflows/build.yml
Some checks failed
Sanity check / Build Debian Package (push) Successful in 49s
Sanity check / Build Flatpak Package (push) Failing after 34s
2024-12-26 21:09:07 -08:00
5671b9bf06 Update .forgejo/workflows/build.yml
Some checks failed
Sanity check / Build Debian Package (push) Successful in 9s
Sanity check / Build Flatpak Package (push) Failing after 7s
2024-12-26 21:07:39 -08:00
8d48ff43a9 Update generate-flatpak.py
All checks were successful
Sanity check / Build Debian Package (push) Successful in 10s
Sanity check / Build Flatpak Package (push) Successful in 8s
2024-12-26 21:06:21 -08:00
5a0aed251b Update .forgejo/workflows/build.yml
All checks were successful
Sanity check / Build Debian Package (push) Successful in 9s
Sanity check / Build Flatpak Package (push) Successful in 1m38s
2024-12-26 21:03:56 -08:00
0b1003b95d Update .forgejo/workflows/build.yml
Some checks failed
Sanity check / Build Debian Package (push) Successful in 8s
Sanity check / Build Flatpak Package (push) Has been cancelled
2024-12-26 21:02:38 -08:00
a67db6c024 Update .forgejo/workflows/build.yml
Some checks failed
Sanity check / Build Debian Package (push) Successful in 9s
Sanity check / Build Flatpak Package (push) Has been cancelled
2024-12-26 21:01:50 -08:00
63ccda61aa Update codes.swee.SweeCryptGTK.json
All checks were successful
Sanity check / Build Debian Package (push) Successful in 8s
Sanity check / Build Flatpak Package (push) Successful in 7s
2024-12-26 20:59:13 -08:00
bf77881cbe Update .forgejo/workflows/build.yml
All checks were successful
Sanity check / Build Debian Package (push) Successful in 9s
Sanity check / Build Flatpak Package (push) Successful in 8s
2024-12-26 20:58:23 -08:00
3e9950c3ca Update generate-flatpak.py
All checks were successful
Sanity check / Test Python file (push) Successful in 10s
2024-12-26 20:57:08 -08:00
c9a6f9120b Upload files to "/"
All checks were successful
Sanity check / Test Python file (push) Successful in 8s
2024-12-26 20:54:12 -08:00
948f7ffa94 Add generate-flatpak.py
All checks were successful
Sanity check / Test Python file (push) Successful in 12s
2024-12-26 20:52:45 -08:00
4233c29d58 Add SweeCrypt 1.1.0 feature
All checks were successful
Sanity check / Test Python file (push) Successful in 9s
2024-12-24 16:29:10 -08:00
80e5b89a61 Update dpkg/DEBIAN/control
All checks were successful
Sanity check / Test Python file (push) Successful in 10s
2024-12-23 15:18:36 -08:00
27f760cb79 UI refresh
All checks were successful
Sanity check / Test Python file (push) Successful in 13s
2024-12-23 15:15:06 -08:00
Admin
1b656964a7 Fix Window growing
All checks were successful
Sanity check / Test Python file (push) Successful in 14s
2024-12-23 15:00:49 -08:00
f8fe0a55e4 Update .forgejo/workflows/build.yml
All checks were successful
Sanity check / Test Python file (push) Successful in 8s
2024-12-18 15:44:54 -08:00
49596e4626 Update .forgejo/workflows/build.yml
Some checks failed
Sanity check / Test Python file (push) Has been cancelled
2024-12-18 15:44:30 -08:00
831038312b Update .forgejo/workflows/build.yml
All checks were successful
Sanity check / Test Python file (push) Successful in 18s
2024-10-12 22:58:09 -07:00
c7533e8637 Update .forgejo/workflows/sanity-check.yml
Some checks failed
Sanity check / Test Python file (push) Failing after 31s
2024-10-12 22:56:44 -07:00
caef7a2026 Update .forgejo/workflows/sanity-check.yml
Some checks failed
Sanity check / Test Python file (push) Failing after 16s
2024-10-12 22:33:00 -07:00
4764fdfdeb Add .forgejo/workflows/sanity-check.yml
Some checks failed
Sanity check / Test Python file (push) Failing after 1m11s
2024-10-12 22:31:21 -07:00
edef9018a8 Add requirements.txt 2024-10-12 22:30:39 -07:00
Nova Cat
0ea38937f9 Edited files on Android 2024-09-14 01:01:37 -07:00
10 changed files with 280 additions and 87 deletions

View file

@ -0,0 +1,44 @@
name: Auto build
on:
push:
workflow_dispatch:
jobs:
apt:
name: Build Debian Package
runs-on: debian-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Install dependencies
run: if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Generate DEB
run: |
python generate-deb.py
- uses: actions/upload-artifact@v3
with:
path: sweecrypt-gtk.deb
flatpak:
name: Build Flatpak Package
runs-on: debian-testing
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Install dependencies
run: if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Install org.gnome.Sdk
run: flatpak -y --user install flathub org.gnome.Sdk//47
- name: Install org.gnome.Platform
run: flatpak -y --user install flathub org.gnome.Platform//47
- name: Generate file for use in flatpak
run: python generate-flatpak.py
- name: Build flatpak package
run: flatpak-builder --repo=flatrepo --disable-rofiles-fuse flatpak codes.swee.SweeCryptGTK.json
- name: Package the directory
run: tar -cvf flatpak.tar flatpak flatrepo
- uses: actions/upload-artifact@v3
with:
path: flatpak.tar

View file

@ -0,0 +1,91 @@
{
"app-id": "codes.swee.SweeCryptGTK",
"runtime": "org.gnome.Platform",
"runtime-version": "47",
"sdk": "org.gnome.Sdk",
"command": "sweecrypt-gtk",
"finish-args": [
"--socket=x11",
"--socket=wayland",
"--filesystem=xdg-config"
],
"rename-icon": "codes.swee.SweeCryptGTK",
"modules": [
{
"name": "python3-modules",
"buildsystem": "simple",
"build-commands": [],
"modules": [
{
"name": "python3-sweecrypt",
"buildsystem": "simple",
"build-commands": [
"pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"sweecrypt\" --no-build-isolation"
],
"sources": [
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/de/f0/7880030d201e7997573415bb26ddcb91b41bda443fa9feb964aa9a967fa5/sweecrypt-1.1.1-py3-none-any.whl",
"sha256": "09bcda1266b621b46b88b0804985330dc006818da6502c631578ff180e86640b"
}
]
},
{
"name": "python3-pygobject",
"buildsystem": "simple",
"build-commands": [
"pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"pygobject\" --no-build-isolation"
],
"sources": [
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/07/4a/42b26390181a7517718600fa7d98b951da20be982a50cd4afb3d46c2e603/pycairo-1.27.0.tar.gz",
"sha256": "5cb21e7a00a2afcafea7f14390235be33497a2cce53a98a19389492a60628430"
},
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/2b/58/d34e67a79631177e3c08e7d02b5165147f590171f2cae6769502af5f7f7e/pygobject-3.50.0.tar.gz",
"sha256": "4500ad3dbf331773d8dedf7212544c999a76fc96b63a91b3dcac1e5925a1d103"
}
]
}
]
}, {
"name": "sweecrypt-gtk",
"buildsystem": "simple",
"build-commands": ["chmod 1777 sweecrypt-gtk-flatpak.py",
"install -D sweecrypt-gtk-flatpak.py /app/bin/sweecrypt-gtk",
"install -D flatpak.ui /app/opt/sweecrypt-gtk.ui",
"install -D sweecrypt.png /app/share/icons/hicolor/128x128/apps/codes.swee.SweeCryptGTK.png",
"install -D sweecrypt.svg /app/share/icons/hicolor/scalable/apps/codes.swee.SweeCryptGTK.svg",
"install -D flatpak.desktop /app/share/applications/codes.swee.SweeCryptGTK.desktop",
"install -D flatpak.xml /app/share/metainfo/codes.swee.SweeCryptGTK.metainfo.xml"],
"sources": [
{
"type": "file",
"path": "flatpak.ui"
},
{
"type": "file",
"path": "sweecrypt-gtk-flatpak.py"
},
{
"type": "file",
"path": "flatpak.desktop"
},
{
"type": "file",
"path": "dpkg/usr/share/icons/hicolor/128x128/apps/sweecrypt.png"
},
{
"type": "file",
"path": "dpkg/usr/share/icons/hicolor/scalable/apps/sweecrypt.svg"
},
{
"type": "file",
"path": "flatpak.xml"
}
]
}
]
}

View file

@ -1,5 +1,5 @@
Package: sweecrypt-gtk
Version: 1.0
Version: 1.2
Section: utils
Priority: optional
Architecture: all

8
flatpak.desktop Normal file
View file

@ -0,0 +1,8 @@
[Desktop Entry]
Name=SweeCrypt GTK
Comment=Simple and fun cipher
Exec=sweecrypt-gtk
Type=Application
Icon=codes.swee.SweeCryptGTK
Categories=Utility;
StartupNotify=false

20
flatpak.xml Normal file
View file

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>codes.swee.SweeCryptGTK</id>
<metadata_license>MIT</metadata_license>
<project_license>MIT</project_license>
<name>A Simple and fun cipher frontend</name>
<summary>A frontend for the SweeCrypt python module</summary>
<url type="homepage">https://git.swee.codes/swee/sweecrypt-gtk</url>
<description>
<p>A frontend for the <a href="https://github.com/sweezero/sweecrypt">SweeCrypt Python Module</a>.</p>
</description>
<releases>
<release date="2024-12-24" version="1.2"/>
</releases>
<content_rating type="oars-1.0"/>
<developer_name>SWEE.codes</developer_name>
<!-- <url type="bugtracker">https://</url> -->
<update_contact>meow@swee.codes</update_contact>
<launchable type="desktop-id">codes.swee.SweeCryptGTK.desktop</launchable>
</component>

View file

@ -1,8 +1,6 @@
#!/usr/bin/python3
import os
print("Creating Debian package...")
if os.name != "posix":
print("WARNING: Machine is not running Linux (value of os.name is not \"posix\"), the script will not try to auto-build the .deb file. You might need to manually `chmod 1777` the binary.")
file = open("sweecrypt-gtk.py").read().split("\n")
open("dpkg/opt/sweecrypt-gtk.ui",'w').write(open("sweecrypt-gtk.ui").read())
file[3] = 'UI_FILE = "/opt/sweecrypt-gtk.ui"'
@ -10,5 +8,4 @@ file.insert(0, "#!/usr/bin/env python3")
file = "\n".join(file)
open("dpkg/usr/bin/sweecrypt-gtk",'w').write(file)
os.system("chmod 1777 dpkg/usr/bin/sweecrypt-gtk")
if os.name == "posix":
os.system("dpkg-deb --root-owner-group --build dpkg sweecrypt-gtk.deb")
os.system("dpkg-deb --root-owner-group --build dpkg sweecrypt-gtk.deb")

14
generate-flatpak.py Normal file
View file

@ -0,0 +1,14 @@
#!/usr/bin/python3
import os
print("Creating Flatpak package...")
file = open("sweecrypt-gtk.py").read().split("\n")
file[3] = 'UI_FILE = "/app/opt/sweecrypt-gtk.ui"'
file.insert(0, "#!/usr/bin/env python3")
file = "\n".join(file)
open("sweecrypt-gtk-flatpak.py", "w").write(file)
os.system("chmod 1777 sweecrypt-gtk-flatpak.py")
file = open("sweecrypt-gtk.ui").read().split("\n")
file[19] = " <property name=\"icon-name\">codes.swee.SweeCryptGTK</property>"
file = "\n".join(file)
open("flatpak.ui", "w").write(file)
os.system("mkdir flatpak")

2
requirements.txt Normal file
View file

@ -0,0 +1,2 @@
sweecrypt>=1.0.4
PyGObject

View file

@ -3,33 +3,27 @@ gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, GdkPixbuf, Gdk
UI_FILE = os.path.dirname(os.path.realpath(__file__)) + "/sweecrypt-gtk.ui"
class GUI:
def __init__(self):
self.builder = Gtk.Builder()
self.builder.add_from_file(UI_FILE)
self.builder.connect_signals(self)
window = self.builder.get_object('window')
window.show_all()
def toggle(self, e:bool):
if e:
active = self.builder.get_object('encode').get_property("active")
self.builder.get_object('decode').set_property("active", not active)
else:
active = self.builder.get_object('decode').get_property("active")
self.builder.get_object('encode').set_property("active", not active)
def on_window_destroy(self, window):Gtk.main_quit()
def encode_toggle(self, encode):self.toggle(True)
def decode_toggle(self, decode):self.toggle(False)
def start_clicked(self, start):
encode = self.builder.get_object('encode').get_property("active")
inputted = self.builder.get_object('text').get_property("text")
if encode:
self.builder.get_object('text').set_property("text", sc.encrypt(inputted))
self.builder.get_object('encode').set_property("active", False)
else:
self.builder.get_object('text').set_property("text", sc.decrypt(inputted))
self.builder.get_object('decode').set_property("active", False)
def __init__(self):
self.builder = Gtk.Builder()
self.builder.add_from_file(UI_FILE)
self.builder.connect_signals(self)
window = self.builder.get_object('window')
window.show_all()
def on_window_destroy(self, window):Gtk.main_quit()
def toggle(self, checkbox):
checkbox.set_property("label", "Encode" if checkbox.get_property("active") else "Decode")
def start_clicked(self, start):
encode = self.builder.get_object('encode').get_property("active")
shift = int(self.builder.get_object('shift').get_property("value"))
inputted = self.builder.get_object('text').get_property("text")
if encode:
self.builder.get_object('text').set_property("text", sc.encrypt(inputted, shift))
self.builder.get_object('encode').set_property("active", False)
else:
self.builder.get_object('text').set_property("text", sc.decrypt(inputted, shift))
self.builder.get_object('encode').set_property("active", True)
def main():
app = GUI()
Gtk.main()
app = GUI()
Gtk.main()
if __name__ == "__main__":
sys.exit(main())
sys.exit(main())

View file

@ -2,20 +2,11 @@
<!-- Generated with glade 3.40.0 -->
<interface>
<requires lib="gtk+" version="3.24"/>
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="icon-name">edit-copy</property>
</object>
<object class="GtkImage" id="image2">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="icon-name">document-revert</property>
</object>
<object class="GtkImage" id="start">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="icon-name">document-properties</property>
<object class="GtkAdjustment" id="database-shift">
<property name="lower">-100</property>
<property name="upper">100</property>
<property name="step-increment">1</property>
<property name="page-increment">10</property>
</object>
<object class="GtkTextBuffer" id="text">
<property name="text" translatable="yes">replace this text with anything
@ -24,6 +15,8 @@ you want to encode or decode.</property>
<object class="GtkWindow" id="window">
<property name="can-focus">False</property>
<property name="title" translatable="yes">SweeCrypt GTK</property>
<property name="default-width">250</property>
<property name="default-height">128</property>
<property name="icon-name">sweecrypt</property>
<signal name="destroy" handler="on_window_destroy" swapped="no"/>
<child>
@ -32,11 +25,18 @@ you want to encode or decode.</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkTextView" id="input">
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="buffer">text</property>
<property name="monospace">True</property>
<property name="shadow-type">in</property>
<child>
<object class="GtkTextView" id="input">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="buffer">text</property>
<property name="monospace">True</property>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
@ -45,29 +45,67 @@ you want to encode or decode.</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="encode">
<property name="label" translatable="yes">Encode</property>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="image">image1</property>
<property name="active">True</property>
<signal name="toggled" handler="encode_toggle" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="decode">
<property name="label" translatable="yes">Decode</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="image">image2</property>
<signal name="toggled" handler="decode_toggle" swapped="no"/>
<property name="can-focus">False</property>
<child>
<object class="GtkToggleButton" id="encode">
<property name="label" translatable="yes">Encode</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="active">True</property>
<signal name="toggled" handler="toggle" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Database shift: </property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="star">
<property name="label" translatable="yes">Start</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="start_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack-type">end</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="shift">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="caps-lock-warning">False</property>
<property name="primary-icon-tooltip-text" translatable="yes">Database shift</property>
<property name="adjustment">database-shift</property>
<property name="climb-rate">1</property>
<property name="numeric">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
@ -75,21 +113,6 @@ you want to encode or decode.</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkButton" id="star">
<property name="label" translatable="yes">Start</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="image">start</property>
<signal name="clicked" handler="start_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">4</property>
</packing>
</child>
</object>
</child>
</object>