Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 21 additions & 0 deletions app/src/main/assets/wfm/LICENSE.WFM.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 BrunoSX

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
23 changes: 23 additions & 0 deletions app/src/main/assets/wfm/NOTICE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Winlator File Manager - GameNative native-copy patch
====================================================

The wfm.exe payload is built from the original Winlator File Manager:
https://github.com/brunodev85/wfm

Source commit:
cb1d078cef36d3d61eec822882febcde828f09e7

Only the copy/paste implementation and its conflict prompts are changed. The
patches are included alongside this notice as native-copy.patch,
replace-all-conflicts.patch, and copy-hardening.patch, in that application
order using standard `git apply` commands. Together they replace ACTION_COPY's
shell32 SHFileOperation call with direct Win32 file-copy calls; offer Replace
All, Review Each, or Cancel on the first conflict; and add safe handling for
read-only files, reparse points, type conflicts, copy errors, path limits,
copying a folder into its descendant through direct or aliased drive paths, and
basic directory metadata. Unsupported reparse-point entries are skipped and
summarized after the copy. The original WFM user interface, directory
enumeration, move behavior, and delete behavior are retained.

Winlator File Manager is licensed under the MIT License. Its copyright and
permission notice are included in LICENSE.WFM.txt.
37 changes: 37 additions & 0 deletions app/src/main/assets/wfm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Rebuilding `wfm.exe`

The payload is built from Winlator File Manager commit
`cb1d078cef36d3d61eec822882febcde828f09e7`.

Use the 64-bit w64devkit 2.9.0 archive
`w64devkit-x64-2.9.0.7z.exe`:

- Archive SHA-256:
`bff1d13fc2718eebd93548cf37f8d0332d925458d5e99506cff8f46eb5a9de5a`
- GCC: 16.1.0
- GNU binutils/windres: 2.47.20260726

Clone the upstream source, check out the pinned commit, copy the three patch
files from this directory into the checkout, and apply them in order:

```sh
git clone https://github.com/brunodev85/wfm.git
cd wfm
git checkout cb1d078cef36d3d61eec822882febcde828f09e7
git apply native-copy.patch
git apply replace-all-conflicts.patch
git apply copy-hardening.patch
```

From a w64devkit shell in that clean checkout, run this exact build command.
The object order is intentional and is required for a byte-identical result:

```sh
make CC=gcc RC=windres "INCLUDE_DIR=-I./include" "OBJS=obj/file_actions.o obj/main.o obj/content_view.o obj/toolbar.o obj/navbar.o obj/treeview.o obj/sizebar.o obj/statusbar.o obj/file_node.o obj/file_utils.o obj/input_dialog.o obj/resource.o" "CFLAGS=-O3 -std=c99 -DUNICODE -D_UNICODE -DCOBJMACROS -D_CRT_NON_CONFORMING_WCSTOK -D_WIN32_IE=0x0500 -DWINVER=0x500 -Wall -Wno-error=incompatible-pointer-types -Wno-error=int-conversion" "LDFLAGS=-s -lcomctl32 -lgdi32 -lole32 -luuid -Wl,--subsystem,windows"
```

The expected output is 304,640 bytes with SHA-256:

```text
a7bb48aa14c59ece23c011c43c8439869267b13387d4a972f462a06575deebbb
```
Loading
Loading