-
Notifications
You must be signed in to change notification settings - Fork 472
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
200 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip | ||
distributionUrl=https://services.gradle.org/distributions-snapshots/gradle-8.9-20240426001649+0000-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
58 changes: 58 additions & 0 deletions
58
...ore/src/main/java/software/coley/recaf/info/properties/builtin/ZipPrefixDataProperty.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package software.coley.recaf.info.properties.builtin; | ||
|
||
import jakarta.annotation.Nonnull; | ||
import jakarta.annotation.Nullable; | ||
import software.coley.recaf.info.Info; | ||
import software.coley.recaf.info.properties.BasicProperty; | ||
import software.coley.recaf.info.properties.Property; | ||
|
||
/** | ||
* Built in property to track data appearing before the ZIP header in an archive. | ||
* | ||
* @author Matt Coley | ||
*/ | ||
public class ZipPrefixDataProperty extends BasicProperty<byte[]> { | ||
public static final String KEY = "zip-prefix-data"; | ||
|
||
/** | ||
* @param data | ||
* Optional data. | ||
*/ | ||
public ZipPrefixDataProperty(@Nullable byte[] data) { | ||
super(KEY, data); | ||
} | ||
|
||
/** | ||
* @param info | ||
* Info instance. | ||
* | ||
* @return Optional data. | ||
* {@code null} when no property value is assigned. | ||
*/ | ||
@Nullable | ||
public static byte[] get(@Nonnull Info info) { | ||
Property<byte[]> property = info.getProperty(KEY); | ||
if (property != null) { | ||
return property.value(); | ||
} | ||
return null; | ||
} | ||
|
||
/** | ||
* @param info | ||
* Info instance. | ||
* @param value | ||
* Optional data. | ||
*/ | ||
public static void set(@Nonnull Info info, @Nonnull byte[] value) { | ||
info.setProperty(new ZipPrefixDataProperty(value)); | ||
} | ||
|
||
/** | ||
* @param info | ||
* Info instance. | ||
*/ | ||
public static void remove(@Nonnull Info info) { | ||
info.removeProperty(KEY); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.