Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
b61401f
Create fork-sync.yml
nbauma109 Feb 14, 2022
d52e076
Update fork-sync.yml
nbauma109 Feb 15, 2022
e5b1f3e
Merge pull request #2 from mstrobel/develop
github-actions[bot] Feb 15, 2022
88a95fa
Merge tag 'v0.6.0' into develop
mstrobel Feb 21, 2022
b960098
Merge pull request #3 from mstrobel/develop
github-actions[bot] Feb 21, 2022
e8a4d90
try/catch formatting
Mar 19, 2022
8c28d0a
remove temp file for line number output and produce String output
Mar 19, 2022
b909a25
Version 1.0-SNAPSHOT
Mar 19, 2022
5df728a
1.0-SNAPSHOT
Mar 19, 2022
5961f42
try/catch/finally and if/else formatting policy
Mar 19, 2022
8f1471a
format try/finally
Mar 25, 2022
9537e07
invert if statements to place line numbers in the right order
Mar 27, 2022
29963da
version 1.0-SNAPSHOT
Apr 1, 2022
21f957c
avoid double negation
Apr 1, 2022
b6e1c75
added unit tests InvertIfTests
Apr 2, 2022
deb9e39
InvertIfTests with line numbers
Apr 2, 2022
4d55f8f
return the TypeDecompilationResults in Decompiler.decompile(...)
Apr 13, 2022
8d66d28
added javadocJar and sourcesJar
nbauma109 Jun 1, 2022
5439e9b
Merge pull request #4 from nbauma109/patch-formatting
nbauma109 Jun 5, 2022
3539f2c
Merge pull request #5 from nbauma109/patch-line-number
nbauma109 Jun 5, 2022
39a5370
Merge pull request #6 from nbauma109/patch-invert-if
nbauma109 Jun 5, 2022
dfe68e4
Merge pull request #7 from nbauma109/patch-1
nbauma109 Jun 5, 2022
b75f0da
Created InMemoryLineNumberFormatter to avoid temp file creation
Jun 5, 2022
c091afa
Merge pull request #8 from nbauma109/patch-line-number
nbauma109 Jun 5, 2022
75892a9
prepare code for line stretch (line number realignment)
Jun 6, 2022
051f8b1
revert gradle to 6.9
Jun 6, 2022
7d63946
fix regressions
Jun 6, 2022
ca11cbc
move static block initializations to declarations where possible
Jun 8, 2022
8ba2a8f
Create gradle-tests.yml
nbauma109 Jun 8, 2022
9a99315
Update gradle-tests.yml
nbauma109 Jun 8, 2022
50014b5
Merge pull request #9 from nbauma109/workflow-tests
nbauma109 Jun 8, 2022
ef9c28f
refactoring RewriteInitForLineStretchTransform
Jun 12, 2022
2312d2a
reformat RewriteInitForLineStretchTransform
Jun 12, 2022
4af7eff
Merge pull request #10 from nbauma109/patch-stretch-lines
nbauma109 Jun 12, 2022
372a8ce
added all sources to fat jar
Jun 12, 2022
8443f97
Merge pull request #11 from nbauma109/patch-1
nbauma109 Jun 12, 2022
0d26e55
handled new case and added new unit test for this(...) call
Jun 12, 2022
5eff64c
Merge pull request #12 from nbauma109/patch-stretch-lines
nbauma109 Jun 12, 2022
c64b5c5
fix: count only constructors of declaring type
Jun 12, 2022
79bf561
Merge pull request #13 from nbauma109/patch-stretch-lines
nbauma109 Jun 12, 2022
d6edb2a
removed unused import
Jun 12, 2022
b57a395
Merge pull request #14 from nbauma109/patch-stretch-lines
nbauma109 Jun 12, 2022
05ee914
new case & unit test: check use of local variables in field initializers
Jun 12, 2022
7ca6948
Merge pull request #15 from nbauma109/patch-stretch-lines
nbauma109 Jun 12, 2022
e70abf9
removed unused imports
Jun 12, 2022
3bc73b6
Merge pull request #16 from nbauma109/patch-stretch-lines
nbauma109 Jun 12, 2022
b2344da
add coverage with jacoco/codecov
Dec 23, 2025
ae55d75
added jacoco to build.gradle
Dec 23, 2025
3c2cf72
Merge pull request #17 from nbauma109/develop
nbauma109 Dec 23, 2025
86dfe7a
Update Gradle CI workflow to run tests and JaCoCo report
nbauma109 Dec 23, 2025
860b1ca
Update README.md with codecov badge
nbauma109 Dec 23, 2025
9570f28
Update README with new jitpack badge
nbauma109 Dec 23, 2025
3718c40
Configure Dependabot for Maven and GitHub Actions
nbauma109 Dec 23, 2025
d7d8bed
Delete .github/workflows/gradle-tests.yml
nbauma109 Dec 23, 2025
e7a7c2a
Update GitHub Actions to use latest versions
nbauma109 Dec 23, 2025
9e64e8e
Document reasons for forking Procyon project
nbauma109 Dec 24, 2025
e839b34
Update README with fork rationale and pull requests
nbauma109 Dec 24, 2025
6b9d597
Update README with additional links and formatting
nbauma109 Dec 24, 2025
43d6d3d
Update dependabot.yml
nbauma109 Dec 26, 2025
7a0066b
Update build.gradle to source compatibility 1.8
nbauma109 Dec 28, 2025
588bc6f
Merge pull request #24 from nbauma109/java8
nbauma109 Dec 28, 2025
561167f
Bump com.beust:jcommander from 1.78 to 1.82
dependabot[bot] Dec 28, 2025
bd41dc4
Merge pull request #23 from nbauma109/dependabot/gradle/com.beust-jco…
nbauma109 Dec 28, 2025
ed2b3dd
set version to 0.6.2-SNAPSHOT
Jan 1, 2026
8c078e4
Fix negative offset issue
Jan 3, 2026
ecd17c8
update RealignTest
Jan 3, 2026
b3a50e5
Create manual-release.yml
nbauma109 Jan 3, 2026
7f12d9c
Fix manual-release.yml
Jan 3, 2026
767d79c
prepare release 0.6.2
github-actions[bot] Jan 3, 2026
94c89b3
prepare for next development iteration 0.6.3-SNAPSHOT
github-actions[bot] Jan 3, 2026
2c59a05
manual-release.yml: add comments
Jan 3, 2026
51e7f59
improve coverage with DecompilerDriverTest
Jan 3, 2026
735dae5
Update coverage.yml
nbauma109 Jan 3, 2026
a4388d4
Update build.gradle
nbauma109 Jan 3, 2026
eed213b
Update build.gradle
nbauma109 Jan 3, 2026
cff51d8
update jacoco version : 0.8.12 -> 0.8.14
Jan 4, 2026
f609d3a
remove jacoco merge
Jan 4, 2026
56f1b7b
migrate to Gradle 7 and use jacoco-report-aggregation plugin
Jan 4, 2026
533b3b4
fix coverage.yml
Jan 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "gradle" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"
time: "17:00"
timezone: "Europe/Paris"
- package-ecosystem: "github-actions"
directory: "/" # Location of GitHub Actions workflows
schedule:
interval: "daily"
time: "17:00"
timezone: "Europe/Paris"
39 changes: 39 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Coverage

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

permissions:
contents: read

jobs:
test-and-coverage:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v6

- name: Set up Java
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: "8"
cache: gradle

- name: Ensure Gradle wrapper is executable
run: chmod +x ./gradlew

- name: Run tests and generate merged JaCoCo report
run: ./gradlew --no-daemon testCodeCoverageReport

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true
verbose: true
files: build/reports/jacoco/testCodeCoverageReport/testCodeCoverageReport.xml

4 changes: 2 additions & 2 deletions .github/workflows/gradle-wrapper-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ jobs:
name: "Validation"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: gradle/wrapper-validation-action@v1.0.3
- uses: actions/checkout@v6
- uses: gradle/wrapper-validation-action@v3.5.0

130 changes: 130 additions & 0 deletions .github/workflows/manual-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
name: Manual Release

on:
workflow_dispatch:
inputs:
next_snapshot_version:
description: "Optional. Next snapshot version in x.y.z-SNAPSHOT format (example: 0.6.3-SNAPSHOT). If empty, we bump the patch number."
required: false
default: ""
version_file:
description: "Path to the Java file that contains the VERSION constant."
required: false
default: "Procyon.Core/src/main/java/com/strobel/Procyon.java"

permissions:
contents: write

concurrency:
group: manual-release-${{ github.ref }}
cancel-in-progress: false

jobs:
release:
if: ${{ github.ref_type == 'branch' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
ref: ${{ github.ref }}

- name: Prepare release, tag, and next snapshot
env:
VERSION_FILE: ${{ github.event.inputs.version_file }}
NEXT_SNAPSHOT_INPUT: ${{ github.event.inputs.next_snapshot_version }}
BRANCH_NAME: ${{ github.ref_name }}
run: |
set -euo pipefail

if [[ -z "${VERSION_FILE}" ]]; then
VERSION_FILE="Procyon.Core/src/main/java/com/strobel/Procyon.java"
fi

if [[ ! -f "${VERSION_FILE}" ]]; then
echo "Version file not found: ${VERSION_FILE}"
exit 1
fi

if [[ -n "$(git status --porcelain)" ]]; then
echo "Working tree is not clean. Please run the workflow from a clean branch state."
git status --porcelain
exit 1
fi

git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"

version_line="$(grep -E 'private[[:space:]]+static[[:space:]]+final[[:space:]]+String[[:space:]]+VERSION[[:space:]]*=' "${VERSION_FILE}" | head -n 1 || true)"
if [[ -z "${version_line}" ]]; then
echo "Could not find VERSION constant in: ${VERSION_FILE}"
exit 1
fi

current_version="$(echo "${version_line}" | sed -E 's/.*VERSION[[:space:]]*=[[:space:]]*"([^"]+)".*/\1/')"
if [[ -z "${current_version}" ]]; then
echo "Could not extract current version from VERSION constant in: ${VERSION_FILE}"
exit 1
fi

if [[ "${current_version}" != *-SNAPSHOT ]]; then
echo "Expected a -SNAPSHOT version, but found: ${current_version}"
exit 1
fi

release_version="${current_version%-SNAPSHOT}"

if [[ ! "${release_version}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Release version must be in x.y.z format. Found: ${release_version}"
exit 1
fi

if [[ -n "${NEXT_SNAPSHOT_INPUT}" ]]; then
next_snapshot_version="${NEXT_SNAPSHOT_INPUT}"
else
IFS='.' read -r major minor patch <<< "${release_version}"
patch=$((patch + 1))
next_snapshot_version="${major}.${minor}.${patch}-SNAPSHOT"
fi

if [[ ! "${next_snapshot_version}" =~ ^[0-9]+\.[0-9]+\.[0-9]+-SNAPSHOT$ ]]; then
echo "Next snapshot version must be in x.y.z-SNAPSHOT format. Found: ${next_snapshot_version}"
exit 1
fi

release_sed_expr="s/(private[[:space:]]+static[[:space:]]+final[[:space:]]+String[[:space:]]+VERSION[[:space:]]*=[[:space:]]*\")[^\"]+(\")/\1${release_version}\2/"
next_sed_expr="s/(private[[:space:]]+static[[:space:]]+final[[:space:]]+String[[:space:]]+VERSION[[:space:]]*=[[:space:]]*\")[^\"]+(\")/\1${next_snapshot_version}\2/"

# We set the version to the release version (remove -SNAPSHOT), then commit and push.
sed -i -E "${release_sed_expr}" "${VERSION_FILE}"

if git diff --quiet; then
echo "No changes after setting release version. Refusing to continue."
exit 1
fi

git add "${VERSION_FILE}"
git commit -m "prepare release ${release_version}"
git push origin "HEAD:${BRANCH_NAME}"

if git rev-parse -q --verify "refs/tags/${release_version}" >/dev/null; then
echo "Tag already exists: ${release_version}"
exit 1
fi

git tag "${release_version}"
git push origin "refs/tags/${release_version}"

# We set the version to the next development snapshot, then commit and push.
sed -i -E "${next_sed_expr}" "${VERSION_FILE}"

if git diff --quiet; then
echo "No changes after setting next snapshot version. Refusing to continue."
exit 1
fi

git add "${VERSION_FILE}"
git commit -m "prepare for next development iteration ${next_snapshot_version}"
git push origin "HEAD:${BRANCH_NAME}"
6 changes: 3 additions & 3 deletions Procyon.CompilerTools/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
compileTestJava.options.encoding = 'UTF-8'

dependencies {
compile project(':Procyon.Core')
testCompile project(':Procyon.Reflection')
testCompile files('src/test/resources')
implementation project(':Procyon.Core')
testImplementation project(':Procyon.Reflection')
testImplementation files('src/test/resources')
}
Original file line number Diff line number Diff line change
Expand Up @@ -219,15 +219,17 @@ public int hashCode() {

@Override
public boolean equals(final Object obj) {
if (obj instanceof MethodDefinition) {
final MethodDefinition other = (MethodDefinition) obj;

return StringUtilities.equals(getName(), other.getName()) &&
StringUtilities.equals(getErasedSignature(), other.getErasedSignature()) &&
typeNamesMatch(getDeclaringType(), other.getDeclaringType());
if (obj == this) {
return true;
}
if (obj == null || obj.getClass() != getClass()) {
return false;
}
final MethodDefinition other = (MethodDefinition) obj;

return false;
return StringUtilities.equals(getName(), other.getName()) &&
StringUtilities.equals(getErasedSignature(), other.getErasedSignature()) &&
typeNamesMatch(getDeclaringType(), other.getDeclaringType());
}

@Override
Expand All @@ -236,7 +238,7 @@ public void invalidateSignature() {
_erasedSignature = null;
}

private boolean typeNamesMatch(final TypeReference t1, final TypeReference t2) {
private static boolean typeNamesMatch(final TypeReference t1, final TypeReference t2) {
return t1 != null &&
t2 != null &&
StringUtilities.equals(t1.getFullName(), t2.getFullName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package com.strobel.assembler.metadata;

import com.strobel.core.StringUtilities;
import com.strobel.core.VerifyArgument;
import com.strobel.util.ContractUtils;

import java.util.Collections;
Expand All @@ -28,21 +27,24 @@
* Date: 1/6/13
* Time: 2:29 PM
*/
public abstract class MethodReference extends MemberReference implements IMethodSignature,
IGenericParameterProvider,
IGenericContext {
protected final static String CONSTRUCTOR_NAME = "<init>";
protected final static String STATIC_INITIALIZER_NAME = "<clinit>";
public abstract class MethodReference extends MemberReference implements IMethodSignature {
protected static final String CONSTRUCTOR_NAME = "<init>";
protected static final String STATIC_INITIALIZER_NAME = "<clinit>";

// <editor-fold defaultstate="collapsed" desc="Signature">

public abstract TypeReference getReturnType();

public boolean hasParameters() {
return !getParameters().isEmpty();
}

public abstract List<ParameterDefinition> getParameters();
public boolean hasParameter(String name) {
for (ParameterDefinition parameterDefinition : getParameters()) {
if (parameterDefinition.getName().equals(name)) {
return true;
}
}
return false;
}

public List<TypeReference> getThrownTypes() {
return Collections.emptyList();
Expand Down Expand Up @@ -117,11 +119,11 @@ protected StringBuilder appendName(final StringBuilder sb, final boolean fullNam
}

public boolean isConstructor() {
return MethodDefinition.CONSTRUCTOR_NAME.equals(getName());
return CONSTRUCTOR_NAME.equals(getName());
}

public boolean isTypeInitializer() {
return MethodDefinition.STATIC_INITIALIZER_NAME.equals(getName());
return STATIC_INITIALIZER_NAME.equals(getName());
}

// </editor-fold>
Expand Down Expand Up @@ -171,9 +173,9 @@ public GenericParameter findTypeVariable(final String name) {
public MethodDefinition resolve() {
final TypeReference declaringType = getDeclaringType();

if (declaringType == null)
if (declaringType == null) {
throw ContractUtils.unsupported();

}
return declaringType.resolve(this);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,21 @@
import com.strobel.assembler.InputTypeLoader;
import com.strobel.assembler.metadata.*;
import com.strobel.core.VerifyArgument;
import com.strobel.decompiler.languages.TypeDecompilationResults;
import com.strobel.decompiler.languages.java.JavaFormattingOptions;

import java.util.Collections;

public final class Decompiler {
public static void decompile(final String internalName, final ITextOutput output) {
decompile(internalName, output, new DecompilerSettings());

private Decompiler() {
}

public static TypeDecompilationResults decompile(final String internalName, final ITextOutput output) {
return decompile(internalName, output, new DecompilerSettings());
}

public static void decompile(final String internalName, final ITextOutput output, final DecompilerSettings settings) {
public static TypeDecompilationResults decompile(final String internalName, final ITextOutput output, final DecompilerSettings settings) {
VerifyArgument.notNull(internalName, "internalName");
VerifyArgument.notNull(settings, "settings");

Expand All @@ -53,7 +60,7 @@ public static void decompile(final String internalName, final ITextOutput output

if (type == null || (resolvedType = type.resolve()) == null) {
output.writeLine("!!! ERROR: Failed to load class %s.", internalName);
return;
return new TypeDecompilationResults(null);
}

DeobfuscationUtilities.processType(resolvedType);
Expand All @@ -67,6 +74,6 @@ public static void decompile(final String internalName, final ITextOutput output
settings.setJavaFormattingOptions(JavaFormattingOptions.createDefault());
}

settings.getLanguage().decompileType(resolvedType, output, options);
return settings.getLanguage().decompileType(resolvedType, output, options);
}
}
Loading
Loading