Skip to content

Commit

Permalink
Release: 3.2.0 (#361)
Browse files Browse the repository at this point in the history
* Empty ProjectManager with button to enter it

* Some arrangement

* Scrolling, unified project view

* initial adventure/project implementation

* Exclusive checkboxes with focus

* iterate a bit on adventure data structure

* Do checkbox better

* tests, rename to projects, more implementation

* Mostly focusing elemetns and css

* Use panes and some other small changes

* Move titles outside of content boxes

* Use panes and some other things

* updating version strings

* Hookedup project creation to backend

* Missed something

* Add proper response to server routes

* Use project given from server

* Get scripts from server

* Run a project, but resource view does not open automatically

* Script runs on project start

* Run project opens resource view

* Accidentally deleted script element

* Select any project from frontend

* Can clone project from git

* Little bit of startview css

* Startview css and formatting things

* Better toolbar

* Back button, some fortmatting, css etc

* Back buttons

* Changeable project location, and some other things

* check for existence of project dir, and only slurp it up when interacting with projects

* disable project management buttons when inputs not populated

* Remove package-lock.json

* Add project metadata and save option

* add frontend/backend support to list project scripts in RunScript dropdown

* Added ability to delete files

* see/change which scripts are associated with each binary

* Hide project option if no project and add .trash when deleting

* remove leading /

* another leading slash

* postmerge cleanups

* remove unused imports

* oops

* Do mypy's bidding

* make associated script checkboxes work with script reset

* core init script functionality

* removing debug print

* refactor ProjectManagerCheckbox.svelte a bit, better styling

* add some on-hover hints for checkboxes, rename "Run" to "Launch"

* only show project options if experimental settings enabled

* add checkbox for experimental feature to landing page

* remove duplicated CSS class

* update version numbering

* isolate non-python dependencies

* correct script options to binary options

* Some tests for projects

* fix typo

* save project test

* test delete

* refactor bincopy dependency checking for function coverage

* double check dependencies on bincopy

* update experimental features checkbox colors

* test get project script

* update version numbers

* Test git clone

* Test open project

* linting

* remove empty test, use HTTPS instead of git URLs, fix project id to session id

* Changelog

* frontend lint from merge conflict

* update old project tests, fix minor bugs, use init script by default

* finish renaming "adventure" to "project"

* fix very dumb typo

* remove dead code, refactor for test coverage

* update changelog link and test coverage

* update version numbers

* flesh out changelog a bit more

* update version numbers to final release

* correctly update PatchMaker version

* fix project file deleting so that trashed files are restored on load if the metadata is not updated, and update GUI when files deleted

* throw error to notify user if they try to Launch with no binary selected

---------

Co-authored-by: Dan Pesce <[email protected]>
Co-authored-by: edward <[email protected]>
Co-authored-by: Dan Pesce <[email protected]>
Co-authored-by: dannyp303 <[email protected]>
  • Loading branch information
5 people authored Aug 10, 2023
1 parent ccb6e15 commit 53503f3
Show file tree
Hide file tree
Showing 12 changed files with 133 additions and 90 deletions.
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ofrak-app",
"version": "3.1.0",
"version": "3.2.0",
"description": "The graphical front-end for OFRAK.",
"homepage": "https://ofrak.com",
"private": true,
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -275,5 +275,7 @@ Answer by running riddle.answer('your answer here') from the console.`);
{/if}
<div class="bottomright">
<p><a href="https://ofrak.com" target="_blank" rel="noreferrer">v3.1.0</a></p>
<p>
<a href="https://ofrak.com" target="_blank" rel="noreferrer">v3.2.0</a>
</p>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import { selectedProject, settings, selected } from "../stores";
import Icon from "../Icon.svelte";
export let name;
export let args, selectedBinaryName, forceRefreshProject;
async function deleteBinary() {
await fetch(`${$settings.backendUrl}/delete_binary_from_project`, {
Expand All @@ -42,12 +42,14 @@
},
body: JSON.stringify({
id: $selectedProject.session_id,
binary: name,
binary: args.name,
}),
}).then(async (r) => {
if (!r.ok) {
throw Error(JSON.stringify(await r.json(), undefined, 2));
}
selectedBinaryName = undefined;
forceRefreshProject = {};
$selectedProject = await fetch(
`${$settings.backendUrl}/get_project_by_id?id=${$selectedProject.session_id}`
).then((r) => {
Expand All @@ -63,6 +65,6 @@

<div>
<button on:click|stopPropagation="{deleteBinary}"
><Icon url="/icons/trash.svg" />Delete {name} from project.</button
><Icon url="/icons/trash.svg" />Delete {args.name} from project.</button
>
</div>
13 changes: 8 additions & 5 deletions frontend/src/ProjectManager/ProjectManagerOptions.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,18 @@
</style>

<script>
export let focus;
export let focus, selectedBinaryName, forceRefreshProject;
</script>

<div class="hbox">
<div class="options">
{#if focus && typeof focus == "string"}
"{focus}"
{:else if focus && typeof focus == "object"}
<svelte:component this="{focus['object']}" {...focus["args"]} />
{#if focus}
<svelte:component
this="{focus.object}"
bind:selectedBinaryName="{selectedBinaryName}"
bind:forceRefreshProject="{forceRefreshProject}"
bind:args="{focus.args}"
/>
{:else}
Click anywhere to see its options.
{/if}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import { selectedProject, settings, selected } from "../stores";
import Icon from "../Icon.svelte";
export let name;
export let args;
async function deleteScript() {
await fetch(`${$settings.backendUrl}/delete_script_from_project`, {
Expand All @@ -41,7 +41,7 @@
},
body: JSON.stringify({
id: $selectedProject.session_id,
script: name,
script: args.name,
}),
}).then(async (r) => {
if (!r.ok) {
Expand All @@ -55,14 +55,13 @@
}
return r.json();
});
console.log($selectedProject);
return await r.json();
});
}
</script>

<div>
<button on:click|stopPropagation="{deleteScript}"
><Icon url="/icons/trash.svg" />Delete {name} from project.</button
><Icon url="/icons/trash.svg" />Delete {args.name} from project.</button
>
</div>
4 changes: 2 additions & 2 deletions frontend/src/ProjectManager/ProjectManagerToolbar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@
}
$selectedProject = await fetch(
`${$settings.backendUrl}/get_project_by_id?id=${$selectedProject.session_id}`
).then((r) => {
).then(async (r) => {
if (!r.ok) {
throw Error(r.statusText);
throw Error(JSON.stringify(await r.json(), undefined, 2));
}
return r.json();
});
Expand Down
85 changes: 54 additions & 31 deletions frontend/src/ProjectManager/ProjectManagerView.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,6 @@
scriptCheckboxHoverInfo = {};
let binariesForProject = [];
for (let binaryName in $selectedProject.binaries) {
if ($selectedProject.binaries.hasOwnProperty(binaryName)) {
binariesForProject.push(binaryName);
}
}
export let resources,
rootResourceLoadPromise,
Expand All @@ -88,6 +83,9 @@
showProjectManager;
async function openProject() {
if (!selectedBinaryName) {
throw Error("Select a binary to launch!");
}
let rootModel = await fetch(`${$settings.backendUrl}/open_project`, {
method: "POST",
headers: {
Expand All @@ -98,7 +96,12 @@
binary: selectedBinaryName,
script: $selectedProject.binaries[selectedBinaryName].init_script,
}),
}).then((r) => r.json());
}).then(async (r) => {
if (!r.ok) {
throw Error(JSON.stringify(await r.json(), undefined, 2));
}
return await r.json();
});
rootResource = remote_model_to_resource(rootModel, resources);
$selected = rootModel.id;
showProjectManager = false;
Expand Down Expand Up @@ -131,6 +134,14 @@
};
focusScript = undefined;
}
$: {
binariesForProject = [];
for (let binaryName in $selectedProject.binaries) {
if ($selectedProject.binaries.hasOwnProperty(binaryName)) {
binariesForProject.push(binaryName);
}
}
}
</script>

<div class="title">OFRAK Project Manager</div>
Expand All @@ -149,20 +160,25 @@
<ProjectManagerFocusableLabel
bind:focus="{focus}"
label="Binaries"
newFocus="{ProjectManagerAddBinaryToProject}"
newFocus="{{
object: ProjectManagerAddBinaryToProject,
args: {},
}}"
/>
</div>
<div class="hbox2">
<div class="content">
{#each binariesForProject as binaryName}
<div class="element">
<ProjectManagerCheckbox
ownValue="{binaryName}"
checkbox="{false}"
bind:focus="{focusBinary}"
/>
</div>
{/each}
{#key forceRefreshProject}
{#each binariesForProject as binaryName}
<div class="element">
<ProjectManagerCheckbox
ownValue="{binaryName}"
checkbox="{false}"
bind:focus="{focusBinary}"
/>
</div>
{/each}
{/key}
</div>
</div>
</Pane>
Expand All @@ -171,7 +187,10 @@
<ProjectManagerFocusableLabel
bind:focus="{focus}"
label="Scripts"
newFocus="{ProjectManagerAddScriptToProject}"
newFocus="{{
object: ProjectManagerAddScriptToProject,
args: {},
}}"
/>
</div>
<div class="hbox2">
Expand All @@ -191,10 +210,10 @@
</p>
{/if}
</div>
{#each $selectedProject.scripts as script}
<div class="element">
{#if selectedBinaryName}
{#key forceRefreshProject}
{#key forceRefreshProject}
{#each $selectedProject.scripts as script}
<div class="element">
{#if selectedBinaryName}
<ProjectManagerCheckbox
ownValue="{script['name']}"
inclusiveSelectionGroup="{$selectedProject.binaries[
Expand All @@ -205,21 +224,25 @@
bind:focus="{focusScript}"
bind:mouseoverInfo="{scriptCheckboxHoverInfo}"
/>
{/key}
{:else}
<ProjectManagerCheckbox
ownValue="{script['name']}"
bind:focus="{focusScript}"
/>
{/if}
</div>
{/each}
{:else}
<ProjectManagerCheckbox
ownValue="{script['name']}"
bind:focus="{focusScript}"
/>
{/if}
</div>
{/each}
{/key}
</div>
</div>
</Pane>
</Split>
<Pane slot="second" paddingVertical="{'1em'}">
<ProjectManagerOptions focus="{focus}" />
<ProjectManagerOptions
focus="{focus}"
bind:selectedBinaryName="{selectedBinaryName}"
bind:forceRefreshProject="{forceRefreshProject}"
/>
</Pane>
</Split>
</div>
Expand Down
4 changes: 4 additions & 0 deletions ofrak_core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,21 @@ All notable changes to `ofrak` will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased](https://github.com/redballoonsecurity/ofrak/tree/master)

## [3.2.0](https://github.com/redballoonsecurity/ofrak/compare/ofrak-v3.1.0...ofrak-v3.2.0)
### Added
- Add a JFFS2 packer and unpacker. ([#326](https://github.com/redballoonsecurity/ofrak/pull/326))
- Add method to Resource and data service to search for patterns in its data ([#333](https://github.com/redballoonsecurity/ofrak/pull/333))
- Add search bars to GUI in order to search for a string or bytes within a resource. ([#345](https://github.com/redballoonsecurity/ofrak/pull/345))
- Add Identifier, Unpacker, Packer for Intel Hex format. ([#349](https://github.com/redballoonsecurity/ofrak/pull/349))
- Add unpackers for EXT filesystems (versions 2 through 4). ([#337](https://github.com/redballoonsecurity/ofrak/pull/337))
- A new feature that allows users to create an OFRAK "project" that contains a collection of scripts and binaries. ([#360](https://github.com/redballoonsecurity/ofrak/pull/360))

### Changed
- Support uploading files in chunks to handle files larger than 2GB from the GUI ([#324](https://github.com/redballoonsecurity/ofrak/pull/324))

### Fixed
- Save resources affected by data patches and dependency updates on a resource being saved ([#355](https://github.com/redballoonsecurity/ofrak/pull/355))

## [3.1.0](https://github.com/redballoonsecurity/ofrak/compare/ofrak-v3.0.0...ofrak-v3.1.0)
### Added
Expand Down
Loading

0 comments on commit 53503f3

Please sign in to comment.