Skip to content

Commit

Permalink
merge legacy
Browse files Browse the repository at this point in the history
  • Loading branch information
Ecdcaeb committed Dec 7, 2024
1 parent f28cf8c commit 5b74ae4
Show file tree
Hide file tree
Showing 332 changed files with 11,850 additions and 6,911 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/build_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Publishing-using-gradle

name: Build and Release Installer

on:
workflow_dispatch:

jobs:
build:
name: Build and Upload Artifact
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/[email protected]
- name: Grant Execute Permission for gradlew
run: chmod +x ./gradlew
- name: Set up JDK 21
uses: actions/[email protected]
with:
java-version: '21'
distribution: 'temurin'

- name: Build
run: ./gradlew build
- name: Create GitHub Release
uses: ncipollo/[email protected]
with:
artifacts: "build/libs/*.jar"
generateReleaseNotes: true
36 changes: 36 additions & 0 deletions .github/workflows/build_snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This workflow will build and upload test artifact
# Simple workflow with ignoring condition to prevent unneccessary build
# To download artifact check on job task

name: Build Test Artifact

on:
push:
branches:
paths-ignore:
- 'docs/**'

jobs:
build:
name: Build and Upload Artifact
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/[email protected]
- name: Grant Execute Permission for gradlew
run: chmod +x ./gradlew
- name: Set up JDK 21
uses: actions/[email protected]
with:
java-version: '21'
distribution: 'temurin'
- name: Change mod version
run: sed -i "s/version.*=.*/version = snapshot-${{ github.run_number}}/g" gradle.properties
- name: Build
run: ./gradlew build
- name: Upload Build Artifacts
uses: actions/[email protected]
with:
name: JavaOctetEditor-snapshot-${{ github.run_number}}.jar
path: build/libs
66 changes: 62 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,64 @@
# JavaOctetEditor

![GitHub all releases](https://img.shields.io/github/downloads/Enaium/JavaOctetEditor/total?style=flat-square)
![GitHub release (latest by date)](https://img.shields.io/github/v/release/Enaium/JavaOctetEditor?style=flat-square)
![GitHub release (latest SemVer including pre-releases)](https://img.shields.io/github/v/release/Enaium/JavaOctetEditor?include_prereleases&style=flat-square)
![GitHub](https://img.shields.io/github/license/Enaium/JavaOctetEditor?style=flat-square)
This is the continue of JavaOctetEditor.
Keep the latest library, remove upstream problems and absorb upstream ideas.

![GitHub all releases](https://img.shields.io/github/downloads/Ecdcaeb/JavaOctetEditor/total?style=flat-square)
![GitHub release (latest by date)](https://img.shields.io/github/v/release/Ecdcaeb/JavaOctetEditor?style=flat-square)
![GitHub release (latest SemVer including pre-releases)](https://img.shields.io/github/v/release/Ecdcaeb/JavaOctetEditor?include_prereleases&style=flat-square)
![GitHub](https://img.shields.io/github/license/Ecdcaeb/JavaOctetEditor?style=flat-square)

![](https://github.com/user-attachments/assets/e6d24406-59bb-43b2-8a02-935f2eb0891e)
![](https://github.com/user-attachments/assets/2f6e9319-9891-47f4-b583-94a65beb73fa)
![](https://user-images.githubusercontent.com/32991121/190947409-9df48d03-e1b7-4c0a-ae1d-08e1ca2bc9aa.png)
![](https://user-images.githubusercontent.com/32991121/190947401-fc08fc4f-3714-49ca-a064-913e7312b191.png)
![](https://user-images.githubusercontent.com/32991121/190947410-4b8f224a-c589-4998-950a-e19618ce5734.png)
![image](https://github.com/user-attachments/assets/2e5ba3a6-2c09-4ae3-a087-ae3735216479)

## Usage

### File Input
- From the top menu `File` > `Load...`
- From the top menu `File` > `Load Recent`
- Drag the file directly into the window

### File Output
The changes you make are not saved directly into the file, you need to export it.

- top menu `File` > `Save...` for jar.
- top menu `File` > `Save All Sources` for the decompiled source jar.

### Edit

#### Bytecode View
view only

#### Decompile Edit
view and edit.
When it got save (ctrl + s (Configurable)), we will try to recompile it.

Edit Config `Application` > `makeDemoRecompileEnvironment` true or only parse Java basic symbols.

The DemoRecompileEnvironment get information from existing bytecode and create demo symbols, but it is not reliable.

#### Visitor Edit

Edit the Visitor code and save (ctrl + s (Configurable)) it.

#### Info Edit

Edit the outline info for class.

### Search
Search Field, Method, LDC Constant, Opcode...

Right click the result could have a operation menu.

### Remapping
- Drag the mapping file directly into the window
- From the top menu `Mapping`

## Summarize
This is a simple and easy to use editor that is much simpler to use than other editors and removes excessive packaging.


92 changes: 73 additions & 19 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,30 +1,84 @@
import java.text.SimpleDateFormat

plugins {
id 'java'
id 'com.github.johnrengelman.shadow' version '8.1.1'
id 'idea'
}

allprojects {
group 'cn.enaium'
version '2.0.0'
group 'cn.enaium'
version project.version

java.toolchain.languageVersion = JavaLanguageVersion.of(21)

jar {

manifest.attributes(
'Manifest-Version': 1.0,
'Main-Class': 'cn.enaium.joe.Main',
"Implementation-Title": "${project.name}",
"Implementation-Version": "${project.version}",
"Implementation-Vendor": "${project.group}",
"Implementation-Timestamp": new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()),
"Premain-Class": "cn.enaium.joe.Agent",
"Agent-Class": "cn.enaium.joe.Agent",
"Can-Redefine-Classes": true,
"Can-Retransform-Classes": true
)
}

subprojects {
apply plugin: 'java'
apply plugin: 'jacoco'
apply plugin: 'checkstyle'
new File(System.getProperty("user.dir"), "run").mkdir()

repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
maven { url 'https://maven.quiltmc.org/repository/release' }
maven { url 'https://maven.cleanroommc.com'}
}

//If you want to use your JDK, just takes to change the JDK version and vendor, otherwise Gradle will be download default JDK
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
vendor = JvmVendorSpec.BELLSOFT
}
}
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.11.3'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.11.3'

repositories {
mavenCentral()
maven { url 'https://maven.quiltmc.org/repository/release' }
maven { url 'https://jitpack.io' }
implementation 'com.formdev:flatlaf:3.5.2'
implementation 'com.formdev:flatlaf-extras:3.5.2'
implementation 'com.github.weisj:jsvg:1.6.1'
//noinspection GradlePackageUpdate
implementation 'com.miglayout:miglayout-swing:11.4.2'
implementation 'com.github.bobbylight:RSyntaxTextArea:3.5.2'
implementation 'org.ow2.asm:asm-tree:9.7.1'
implementation 'org.ow2.asm:asm-util:9.7.1'
implementation 'org.ow2.asm:asm-commons:9.7.1'
implementation 'org.benf:cfr:0.152'
implementation 'com.github.mstrobel.procyon:procyon-decompiler:v0.6.0'
implementation 'org.vineflower:vineflower:1.10.1'
implementation 'org.javassist:javassist:3.30.2-GA'
implementation 'com.google.code.gson:gson:2.11.0'
implementation 'org.tinylog:tinylog:1.3.6'
implementation 'com.github.FabricMC:mapping-io:597f0722d6'
implementation 'zone.rong:imaginebreaker:2.1'
}

test {
useJUnitPlatform()
}

shadowJar {
dependencies {
include(dependency('com.formdev:.*'))
include(dependency('com.miglayout:.*'))
include(dependency('com.github.weisj:.*'))
include(dependency('com.github.bobbylight:RSyntaxTextArea'))
include(dependency('org.ow2.asm:.*'))
include(dependency('org.benf:cfr'))
include(dependency('com.github.mstrobel.procyon:procyon-decompiler'))
include(dependency('com.google.code.gson:gson'))
include(dependency('org.tinylog:.*'))
include(dependency('org.vineflower:vineflower'))
include(dependency('com.github.FabricMC:mapping-io'))
include(dependency('zone.rong:imaginebreaker'))
}
}
archiveClassifier.set('')
}

build.dependsOn shadowJar
19 changes: 0 additions & 19 deletions core/build.gradle

This file was deleted.

77 changes: 0 additions & 77 deletions core/src/main/java/cn/enaium/joe/core/compiler/Compiler.java

This file was deleted.

Loading

0 comments on commit 5b74ae4

Please sign in to comment.