Skip to content

Commit 93ca8c1

Browse files
committed
Update README for clarity on encryption logic and add validation for file selection in UI, added workflow to build the project
1 parent 3a4d075 commit 93ca8c1

File tree

3 files changed

+79
-3
lines changed

3 files changed

+79
-3
lines changed

.github/workflows/build.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
6+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
7+
8+
name: Java CI with Gradle
9+
10+
on:
11+
push:
12+
branches: [ "main" ]
13+
pull_request:
14+
branches: [ "main" ]
15+
16+
jobs:
17+
build:
18+
19+
runs-on: ubuntu-latest
20+
permissions:
21+
contents: read
22+
23+
steps:
24+
- uses: actions/checkout@v4
25+
- name: Set up JDK 17
26+
uses: actions/setup-java@v4
27+
with:
28+
java-version: '17'
29+
distribution: 'temurin'
30+
31+
# Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies.
32+
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
33+
- name: Setup Gradle
34+
uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
35+
- name: Make gradlew executable
36+
run: chmod +x ./gradlew
37+
- name: Build with Gradle Wrapper
38+
run: ./gradlew build
39+
40+
# NOTE: The Gradle Wrapper is the default and recommended way to run Gradle (https://docs.gradle.org/current/userguide/gradle_wrapper.html).
41+
# If your project does not have the Gradle Wrapper configured, you can use the following configuration to run Gradle with a specified version.
42+
#
43+
# - name: Setup Gradle
44+
# uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
45+
# with:
46+
# gradle-version: '8.9'
47+
#
48+
# - name: Build with Gradle 8.9
49+
# run: gradle build
50+
51+
dependency-submission:
52+
53+
runs-on: ubuntu-latest
54+
permissions:
55+
contents: write
56+
57+
steps:
58+
- uses: actions/checkout@v4
59+
- name: Set up JDK 17
60+
uses: actions/setup-java@v4
61+
with:
62+
java-version: '17'
63+
distribution: 'temurin'
64+
65+
# Generates and submits a dependency graph, enabling Dependabot Alerts for all project dependencies.
66+
# See: https://github.com/gradle/actions/blob/main/dependency-submission/README.md
67+
- name: Generate and submit dependency graph
68+
uses: gradle/actions/dependency-submission@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ PyCript WebSocket is a Burp Suite extension that enables users to encrypt and de
4848

4949

5050
> [!Note]
51-
> PyCript Web Socket has separate Logic to handle encryption and decryption and demo code from Original PyCript will not work with the PyCript WebSocket version. The main logic is same in both the extension yet it differs at some level. DO NOT USE https://github.com/Anof-cyber/PyCript-Template for PyCript WebSocket.
51+
> **PyCript WebSocket** has a separate logic for handling encryption and decryption, making it incompatible with the demo code from the original **PyCript**. While both extensions share the same core concept, they differ in implementation. **Do not use** [PyCript-Template](https://github.com/Anof-cyber/PyCript-Template) for **PyCript WebSocket**.
52+
5253

5354

5455
Below Example is in JavaScript, You can use any language including Bash, C, Python, Java, Go etc.

src/main/java/com/pycriptsocket/UI.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,16 @@ public void actionPerformed(ActionEvent e) {
144144
statusToggleButton.addActionListener(new ActionListener() {
145145
@Override
146146
public void actionPerformed(ActionEvent e) {
147-
if (statusToggleButton.isSelected()) {
148-
statusToggleButton.setText("ON");
147+
if (encryptionFilePath != null && !encryptionFilePath.isEmpty() &&
148+
decryptionFilePath != null && !decryptionFilePath.isEmpty()) {
149+
if (statusToggleButton.isSelected()) {
150+
statusToggleButton.setText("ON");
151+
} else {
152+
statusToggleButton.setText("OFF");
153+
}
149154
} else {
155+
JOptionPane.showMessageDialog(null, "Please select both encryption and decryption files before turning on the status.");
156+
statusToggleButton.setSelected(false);
150157
statusToggleButton.setText("OFF");
151158
}
152159
}

0 commit comments

Comments
 (0)