Skip to content

Commit

Permalink
Merge pull request #63 from gregandcin/gui-frontend
Browse files Browse the repository at this point in the history
Fyne GUI Frontend
  • Loading branch information
MrMilenko authored Mar 9, 2024
2 parents 788b9f5 + d1a31cb commit 1b539f4
Show file tree
Hide file tree
Showing 17 changed files with 1,451 additions and 68 deletions.
100 changes: 100 additions & 0 deletions .github/workflows/on-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: On Release Published

on:
release:
types: [published]

jobs:
publish-binaries-linux:
timeout-minutes: 20
runs-on: ubuntu-latest

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

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '^1.21.5'

- name: Get dependencies
run: |
sudo apt-get update \
&& sudo apt-get install gcc \
libgl1-mesa-dev libegl1-mesa-dev \
libgles2-mesa-dev libx11-dev xorg-dev \
libwayland-dev libxkbcommon-dev bc
- name: Install FyneCLI tool
run: go install fyne.io/fyne/v2/cmd/fyne@latest

- name: Build
run: make build-linux

- name: Rename archive
run: zip -r Pinecone_linux.zip bin/Pinecone.tar.xz bin/data && mv Pinecone_linux.zip bin/Pinecone_linux.zip

- name: Upload Linux Bin
uses: djn24/add-asset-to-release@v2
with:
token: ${{secrets.GITHUB_TOKEN}}
path: 'bin/Pinecone_linux.zip'

publish-binaries-mac:
timeout-minutes: 20
runs-on: macos-latest

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

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '^1.21.5'

- name: Install FyneCLI tool
run: go install fyne.io/fyne/v2/cmd/fyne@latest

- name: Build
run: make build-mac

- name: Zip App
run: zip -vr Pinecone_macos.zip bin/Pinecone.app bin/data -x "*.DS_Store" && mv Pinecone_macos.zip bin/


- name: Upload MacOS Bin
uses: djn24/add-asset-to-release@v2
with:
token: ${{secrets.GITHUB_TOKEN}}
path: 'bin/Pinecone_macos.zip'

publish-binaries-win:
timeout-minutes: 20
runs-on: windows-latest

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

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '^1.21.5'

- name: Install FyneCLI tool
run: go install fyne.io/fyne/v2/cmd/fyne@latest

- name: Build
run: make build-win

- name: Zip Binary
shell: pwsh
run: Compress-Archive -Path "bin/Pinecone.exe", "bin/data" -DestinationPath "Pinecone_win.zip" && mv Pinecone_win.zip bin/

- name: Upload Win Bin
uses: djn24/add-asset-to-release@v2
with:
token: ${{secrets.GITHUB_TOKEN}}
path: 'bin/Pinecone_win.zip'
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ dump/**/
*.dll
*.so
*.dylib
pinecone

# Test binary, built with `go test -c`
*.test
Expand All @@ -22,4 +23,7 @@ dump/**/
# vendor/

# Go workspace file
go.work
go.work

output/
pineconeSettings.json
6 changes: 6 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"golang.go",
"davidanson.vscode-markdownlint"
]
}
8 changes: 8 additions & 0 deletions FyneApp.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Website = "https://github.com/Xbox-Preservation-Project/Pinecone"

[Details]
Icon = "images/cleet.png"
Name = "Pinecone"
ID = "com.xbox-preservation.pinecone"
Version = "0.5.0"
Build = 3
24 changes: 24 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
build:
go build -o bin/
build-prod:
go build -ldflags "-s -w" -o bin/
run:
go run .
clean:
rm -rf bin/
build-mac: clean
mkdir bin
fyne package -os darwin --release
mv Pinecone.app bin/
cp -r data bin/data
build-linux: clean
mkdir bin
fyne package -os linux --release
mv Pinecone.tar.xz bin/
cp -r data bin/data
build-win: clean
mkdir bin
fyne package -os windows --release
mv Pinecone.exe bin/
cp -r data bin/data

14 changes: 14 additions & 0 deletions Pinecone.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"folders": [
{
"path": "."
}
],
"settings": {
"go.useLanguageServer": true,
"gopls": {
"formatting.gofumpt": true,
},
"editor.formatOnSave": true,
}
}
89 changes: 74 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@
<p align="center">I'm Cleet. Cletus T. Pine.</p>

# PineCone

* A content discovery tool, for original Xbox DLC and Title Updates.

# How-To

* Download the id_database.json
* Download the appropriate binary for your platform.
* Working Directory should look like this:
```

```sh
PineCone
|-- pinecone binary
|
Expand All @@ -24,35 +28,90 @@ PineCone
| |-- F (optional)
| |-- G (optional)
```

* Run your binary from the commandline. e.g: ./pinecone (or pinecone.exe) (optional flags: -fatxplorer (Windows only, mount E as X in fatxplorer))

# About

* Our buddy Harcroft has been keeping a rolling list of missing content for nearly 20 years.
* The idea of this software is to cut out as much of the manual digging as possible, and expand on it as a tool to archive this data.

# Hows this work?

* Drop UDATA and TDATA into a dump folder.
* Analyze the dump for userdata and DLC's, User Created Content, Content Update Files.
* (Optional) Analyze the dump for Homebrew content in a C E F G folder structure.

# Todo

* Disect Disk images
* Import archived dumps
* Export output for easy viewing
* Add more flags for more specific searches
* Create "Homebrew" JSON file to identify homebrew content.
* Beautify output, to make it easier on the eyes.
# Experimental Flags
* -fatxplorer: This flag will use a mounted E drive on partition X to scan.
* -update: This flag updates only the JSON. Useful between builds without major changes.
* -statistics: This will output statistics of the JSON, i.e totals.
* -titleid=ABCD1234: This will output the JSON details on a specific TitleID when provided.

# Flags

* `-f`/`--fatxplorer`: This flag will use a mounted E drive on partition X to scan.
* `-u`/`--update`: This flag updates only the JSON. Useful between builds without major changes.
* `-s`/`--statistics`: This will output statistics of the JSON, i.e totals.
* `-tID=ABCD1234`/`--titleid=ABCD1234`: This will output the JSON details on a specific TitleID when provided.
* `-l=path/to/dump`/`--location=path/to/dump`: Specify the directory where your dump is located
* `-g={true/false}`/`--gui={true/false}`: Enable the GUI interface (default = true)

# Example output

```sh
Pinecone v0.5.0
Please share output of this program with the Pinecone team if you find anything interesting!
Checking for Content...
====================================================================================================
============================================== Halo 2 ==============================================
Content is known and archived Bonus Map Pack
Content is known and archived Killtacular Pack
Content is known and archived Maptacular Pack
Content is known and archived Blastacular Pack
============================================ File Info =============================================
Title update found for Halo 2 (4d530064) (0000000300000803:RF English Update 5)
Path: dump\TDATA\4d530064\$u\default.xbe
SHA1: f1cc1ae660161f4439fc29ee131310a86e326447

```
Local JSON file exists.
Loading JSON data...
Traversing directory structure...
Found folder for "Advent Rising".
Advent Rising has unarchived content found at: TDATA/4d4a0009/$c/4d4a000900000003
Title ID 50430001 not present in JSON file. May want to investigate!
Traversing directory structure for Title Updates...
TDATA/4d4a0009/$u/test.xbe: 87088e689b192c389693b3db38d5f26f2c4d55ae
# Building from source
## Dependancies
* `go` 1.21.5 or later
* `fyne` 2.4.3 or later
* `gofumpt` 0.6.0 or later (our prefered formatter)
## Build instructions
1. Install the `fyne` CLI tool
```sh
go install fyne.io/fyne/v2/cmd/fyne@latest
```
2. Install `gofumpt` CLI tool
```sh
go install mvdan.cc/gofumpt@latest
```
3. Run `go mod tidy` in the root directory to install all depandancies
4. Run `go build .`. WARNING: First compile will take a long time. Be patient!
## Packaging for Release
Using our Makefile, run:
```sh
make build-{OS-NAME}
```
Where `OS-NAME` is either `win`, `linux`, or `mac` for your operating system of choice.
`FyneApp.toml` can be modified to change a variety of build variables, which you can find in the [fyne docs](https://docs.fyne.io/).
12 changes: 12 additions & 0 deletions bundled.go

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func printTotalStats() {
fmt.Println("Total Archived Items:", totalArchivedItems)
}

func promptForDownload(url string) bool {
func cliPromptForDownload(url string) bool {
var response string
fmt.Printf("The required JSON data is not found. It can be downloaded from %s\n", url)
fmt.Print("Do you want to download it now? (yes/no): ")
Expand All @@ -113,7 +113,7 @@ func startCLI(options CLIOptions) {
log.Fatalln(err)
}

err = checkDatabaseFile(options.JSONFilePath, options.JSONUrl, updateFlag)
err = checkDatabaseFile(options.JSONFilePath, options.JSONUrl, updateFlag, nil)
if err != nil {
log.Fatalln(err)
}
Expand All @@ -123,7 +123,7 @@ func startCLI(options CLIOptions) {
log.Fatalln(err)
}

fmt.Println("Pinecone v0.4.3b")
fmt.Printf("Pinecone v%s\n", version)
fmt.Println("Please share output of this program with the Pinecone team if you find anything interesting!")

err = checkParsingSettings()
Expand Down
Loading

0 comments on commit 1b539f4

Please sign in to comment.