Compare commits

..
Author SHA1 Message Date
56a115ca79
a bunch of bullshit
All checks were successful
Inkay-CI / build-inkay (push) Successful in 41s
2026-08-08 19:14:24 +02:00
cc7d9e8d84 Update src/lang/zh_CN.lang
Some checks failed
Inkay-CI / build-inkay (push) Failing after 24s
2026-08-08 02:45:12 +02:00
14501054ac Delete .github/workflows/codeql.yml
Some checks failed
Inkay-CI / build-inkay (push) Failing after 31s
2026-08-08 02:40:52 +02:00
dc1466eb36 fix ci
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Failing after 5s
CodeQL Advanced / Analyze (c-cpp) (push) Failing after 5s
Inkay-CI / build-inkay (push) Has been cancelled
2026-08-08 02:39:17 +02:00
bc2014fbe8 ci: fix for fj actions
Some checks failed
ci.yml / ci: fix for fj actions (push) Failing after 0s
CodeQL Advanced / Analyze (actions) (push) Failing after 14s
CodeQL Advanced / Analyze (c-cpp) (push) Failing after 6s
2026-08-08 02:36:04 +02:00
04bbcbfda9 fix language AGAIN 2026-08-08 02:25:26 +02:00
257d4ba119 fix language file issues 2026-08-08 02:17:48 +02:00
e14b6b69f1 merge with upstream inkay 2026-08-08 02:13:25 +02:00
e421ac5a40 malamar changes 2026-08-08 02:08:37 +02:00
Ash
5960ff1e40
Create codeql.yml 2026-07-29 21:38:46 +10:00
Ash Logan
890be941a9 Revert "Create codeql.yml"
This reverts commit 6df031b26d.
2026-07-29 21:33:03 +10:00
Ash
6df031b26d
Create codeql.yml 2026-07-29 21:28:40 +10:00
Ash Logan
10688b5ac2 fix(lang): include missing strings as blank 2026-07-28 22:54:16 +10:00
Ash Logan
df01b5b1dd feat(config): include line number in error reporting 2026-07-28 22:54:16 +10:00
Ash Logan
39dc7d8c8a fix: bad debug prints 2026-07-28 22:54:16 +10:00
Ash Logan
158c597aeb fix: shrink log data size slightly 2026-07-28 22:54:16 +10:00
Ash Logan
ccf5370f84 feat: switch config to C API and add missing strings
~40% bianry size reduction from RTTI/exceptions overhead
2026-07-28 22:54:16 +10:00
Ash Logan
e5020b88d0 fix: don't pull devoptab and sockets
requires new-ish aroma for LoggingModule i guess
2026-07-28 22:54:16 +10:00
Ash Logan
8cfbf64d54 chore: update toolchain 2026-07-28 22:54:16 +10:00
Ash
2df55177cb
Merge pull request #86 from PretendoNetwork/dependabot/github_actions/actions/checkout-7
chore: bump actions/checkout from 6 to 7
2026-07-27 20:36:28 +10:00
Daniel López Guimaraes
82cca21ff3
chore: Bump version to v3.1.0 2026-07-20 14:40:35 +01:00
d5f9207deb dont send splatoon patches if nn is enabled 2026-07-19 19:53:42 -04:00
1796ebebb5 OLV changes 2026-07-18 00:50:36 +02:00
dependabot[bot]
a43aed2456
chore: bump actions/checkout from 6 to 7
Bumps [actions/checkout](https://github.com/actions/checkout) from 6 to 7.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-22 07:23:48 +00:00
998abca200 Update actions/checkout action to v7 2026-06-18 15:15:47 +00:00
Ash
1c795ea15b
Merge pull request #68 from ADev531/main
feat: added language changer and korean
2026-05-26 12:02:31 +10:00
4c432b753c chore: remove mentions of spfn.cc 2026-05-24 21:57:29 +02:00
ADev531
8d85d88e4e
Merge branch 'main' into main 2026-05-23 22:43:50 +09:00
Ash
b4407310e5
Merge pull request #85 from jazamb/show-startup-toast-patch
feat: make startup toast optional
2026-05-23 23:16:57 +10:00
Ash
1508e7c1e0
Merge pull request #81 from PretendoNetwork/weblate
Translations update from Hosted Weblate
2026-05-23 23:16:43 +10:00
Jas
b04ebb8624 feat: make startup toast optional
added a configuration option to show/hide startup toast
2026-05-21 14:00:39 -04:00
7403eaecd3 Update ghcr.io/wiiu-env/wiiumodulesystem Docker tag to v20250219 2026-05-18 20:00:48 +00:00
bf5336cba9 Add renovate.json 2026-05-18 21:50:27 +02:00
c2e1eef7e5 ci: downgrade to v3 2026-05-18 21:41:50 +02:00
d01d322003 ci: try to fix up to work (it prob wont) 2026-05-18 21:38:18 +02:00
00a75e94cb initial spfn commit 2026-05-16 22:18:39 +02:00
Valentijn
7bb99c30d1
Translated using Weblate (Dutch)
Currently translated at 100.0% (13 of 13 strings)

Translation: Pretendo Network/Inkay
Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/nl/
2026-05-08 15:11:39 +00:00
Valentijn
cbe54f5467
Translated using Weblate (Dutch)
Currently translated at 84.6% (11 of 13 strings)

Translation: Pretendo Network/Inkay
Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/nl/
2026-05-08 15:11:38 +00:00
ADev531
52c877d2e8
Merge branch 'PretendoNetwork:main' into main 2026-03-21 07:22:50 +09:00
Ash
635f8b55ce
Merge pull request #83 from PretendoNetwork/dependabot/github_actions/actions/upload-artifact-7
chore: bump actions/upload-artifact from 6 to 7
2026-03-05 11:34:09 +11:00
dependabot[bot]
48ae2f97e0
chore: bump actions/upload-artifact from 6 to 7
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 6 to 7.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-02 07:28:53 +00:00
Ash
68afedb5ee
Merge pull request #71 from PretendoNetwork/weblate
Translations update from Hosted Weblate
2026-02-18 00:05:26 +11:00
kip
7be7a0040a
Translated using Weblate (Italian)
Currently translated at 100.0% (13 of 13 strings)

Translation: Pretendo Network/Inkay
Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/it/
2026-02-12 15:09:57 +01:00
BBasilio2001
9e90882ec8
Translated using Weblate (Chinese (Traditional Han script))
Currently translated at 100.0% (13 of 13 strings)

Translation: Pretendo Network/Inkay
Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/zh_Hant/
2026-02-12 15:09:56 +01:00
Fefuchs
1f2660f2c1
Translated using Weblate (German)
Currently translated at 100.0% (13 of 13 strings)

Translation: Pretendo Network/Inkay
Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/de/
2026-02-12 15:09:55 +01:00
Aaron Dewes
285d9f51fb
Translated using Weblate (German)
Currently translated at 92.3% (12 of 13 strings)

Translation: Pretendo Network/Inkay
Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/de/
2026-02-12 15:09:53 +01:00
adev531
a25a09cede fix: swap Italian and Spanish option on plugin settings 2026-01-29 13:45:00 +09:00
ADev531
d08482ae5d
Merge branch 'PretendoNetwork:main' into main 2025-12-18 21:29:58 +09:00
Ash
fd06e2f2aa
Merge pull request #78 from PretendoNetwork/dependabot/github_actions/actions/upload-artifact-6
chore: bump actions/upload-artifact from 5 to 6
2025-12-18 20:21:34 +11:00
dependabot[bot]
62c6cec406
chore: bump actions/upload-artifact from 5 to 6
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 5 to 6.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-15 07:25:29 +00:00
Ash
b7c86c9edc
Merge pull request #77 from PretendoNetwork/dependabot/github_actions/actions/checkout-6 2025-11-24 20:02:57 +11:00
dependabot[bot]
4c38d9e303
chore: bump actions/checkout from 5 to 6
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-24 07:42:52 +00:00
Ash
c59e15395c
Merge pull request #76 from PretendoNetwork/dependabot/github_actions/actions/upload-artifact-5
chore: bump actions/upload-artifact from 4 to 5
2025-11-13 10:52:34 +11:00
dependabot[bot]
fe55961a18
chore: bump actions/upload-artifact from 4 to 5
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-27 08:07:17 +00:00
Ash
e3ff447fa6
Merge pull request #74 from PretendoNetwork/dependabot/github_actions/actions/checkout-5 2025-10-13 10:25:05 +11:00
Ash
257f7af9f8
Merge pull request #65 from PretendoNetwork/dependabot/docker/wiiu-env/devkitppc-20250608 2025-10-13 10:09:28 +11:00
dependabot[bot]
4c2cdd09d3
chore: bump actions/checkout from 4 to 5
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-12 23:09:25 +00:00
Ash
c90d91cd62
Merge pull request #72 from ScottBrenner/patch-1 2025-10-13 10:08:47 +11:00
William Oldham
ca313e193e
Merge pull request #73 from ScottBrenner/alert-autofix-1
fix(CI): Code scanning alert: Workflow does not contain permissions
2025-10-12 10:23:47 +01:00
Scott Brenner
9fa4beae2e
Potential fix for code scanning alert no. 1: Workflow does not contain permissions
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-10-11 19:34:49 -07:00
Scott Brenner
79bc63adb8
feat(CI): Extend Dependabot workflow for GitHub Actions 2025-10-11 19:29:26 -07:00
ADev531
83790b26bf
Merge branch 'PretendoNetwork:main' into main 2025-09-16 21:55:58 +09:00
Ash
bda6bc0d32
Merge pull request #70 from PretendoNetwork/weblate
Translations update from Hosted Weblate
2025-09-16 11:45:40 +10:00
Dimitri A
cfd4c01896
Translated using Weblate (French)
Currently translated at 100.0% (13 of 13 strings)

Translation: Pretendo Network/Inkay
Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/fr/
2025-09-15 23:01:58 +02:00
Apueblar
eb26bc32d8
Translated using Weblate (Spanish)
Currently translated at 100.0% (13 of 13 strings)

Translation: Pretendo Network/Inkay
Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/es/
2025-09-11 00:02:02 +00:00
Dimitri A
d0985dd17a
Translated using Weblate (Italian)
Currently translated at 84.6% (11 of 13 strings)

Translation: Pretendo Network/Inkay
Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/it/
2025-08-22 22:02:22 +02:00
Arnau Bàrcia
0b0fbfc742
Translated using Weblate (Spanish)
Currently translated at 92.3% (12 of 13 strings)

Translation: Pretendo Network/Inkay
Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/es/
2025-08-21 13:02:24 +00:00
Ash
f1b725867a
Merge pull request #69 from PretendoNetwork/weblate
Translations update from Hosted Weblate
2025-08-07 20:07:49 +10:00
Arnau Bàrcia
4ad4666272
Translated using Weblate (Spanish)
Currently translated at 84.6% (11 of 13 strings)

Translation: Pretendo Network/Inkay
Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/es/
2025-08-06 03:02:43 +02:00
ADev531
6e1122e1b3 fix: added Korean and UwU to language changer 2025-07-21 21:15:09 +09:00
ADev531
907de64376 feat: added language changing 2025-07-21 20:59:55 +09:00
ADev531
979d9de91a feat: added korean 2025-07-21 20:58:20 +09:00
Ash
8da5fde962
Merge pull request #67 from PretendoNetwork/weblate
Translations update from Hosted Weblate
2025-07-02 15:58:50 +10:00
Ash Tails
194dc90f59
Translated using Weblate (Chinese (Traditional Han script))
Currently translated at 76.9% (10 of 13 strings)

Translation: Pretendo Network/Inkay
Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/zh_Hant/
2025-07-02 05:16:34 +02:00
Ash Tails
3647725527
Translated using Weblate (Chinese (Traditional Han script))
Currently translated at 76.9% (10 of 13 strings)

Translation: Pretendo Network/Inkay
Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/zh_Hant/
2025-07-02 05:16:33 +02:00
Ash Tails
f3522fb5ac
Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 100.0% (13 of 13 strings)

Translation: Pretendo Network/Inkay
Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/zh_Hans/
2025-07-02 05:16:31 +02:00
Ash Tails
e62f921d71
Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 100.0% (13 of 13 strings)

Translation: Pretendo Network/Inkay
Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/zh_Hans/
2025-07-02 05:16:30 +02:00
Maxime Tourneur
d1b5ba6113
Translated using Weblate (French)
Currently translated at 84.6% (11 of 13 strings)

Translation: Pretendo Network/Inkay
Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/fr/
2025-07-02 05:16:26 +02:00
Ash Tails
889794f239
Translated using Weblate (English)
Currently translated at 100.0% (13 of 13 strings)

Translation: Pretendo Network/Inkay
Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/en/
2025-07-02 05:16:24 +02:00
Chris
724060d1c7
Translated using Weblate (Chinese (Traditional Han script))
Currently translated at 92.3% (12 of 13 strings)

Translation: Pretendo Network/Inkay
Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/zh_Hant/
2025-06-30 18:24:15 +02:00
Ash Tails
6a54c86d06
Translated using Weblate (English)
Currently translated at 100.0% (13 of 13 strings)

Translation: Pretendo Network/Inkay
Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/en/
2025-06-30 18:24:15 +02:00
Chris
2db5735085
Translated using Weblate (English)
Currently translated at 100.0% (13 of 13 strings)

Translation: Pretendo Network/Inkay
Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/en/
2025-06-30 18:24:14 +02:00
Ash Logan
ee49400d55 Merge remote-tracking branch 'weblate/main' 2025-06-30 18:02:07 +10:00
SMU8
c1430e5a8c
Translated using Weblate (Dutch)
Currently translated at 100.0% (13 of 13 strings)

Translation: Pretendo Network/Inkay
Translate-URL: https://hosted.weblate.org/projects/pretendonetwork/inkay/nl/
2025-06-10 15:03:02 +02:00
dependabot[bot]
ea41e73d8d
chore: bump wiiu-env/devkitppc from 20241128 to 20250608
Bumps wiiu-env/devkitppc from 20241128 to 20250608.

---
updated-dependencies:
- dependency-name: wiiu-env/devkitppc
  dependency-version: '20250608'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-09 07:39:05 +00:00
36 changed files with 639 additions and 284 deletions

View file

@ -1,13 +0,0 @@
# 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/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
version: 2
updates:
- package-ecosystem: "docker" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
commit-message:
prefix: "chore: "

View file

@ -1,4 +1,6 @@
name: Inkay-CI name: Inkay-CI
permissions:
contents: read
on: on:
- push - push
@ -6,15 +8,15 @@ on:
jobs: jobs:
build-inkay: build-inkay:
runs-on: ubuntu-22.04 runs-on: debian-trixie
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v7
- name: build toolchain container - name: build toolchain container
run: docker build . -t builder run: docker build . -t builder
- uses: ammaraskar/gcc-problem-matcher@master - uses: https://github.com/ammaraskar/gcc-problem-matcher@master
- name: build Inkay - name: build Inkay
run: docker run --rm -v ${PWD}:/app -w /app builder run: docker run --rm -v ${PWD}:/app -w /app builder
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v3
with: with:
name: inkay name: inkay
path: dist/ path: dist/

View file

@ -1,10 +1,10 @@
FROM ghcr.io/wiiu-env/devkitppc:20241128 FROM ghcr.io/wiiu-env/devkitppc:20260504
COPY --from=ghcr.io/wiiu-env/libnotifications:20240426 /artifacts $DEVKITPRO COPY --from=ghcr.io/wiiu-env/libnotifications:20240426 /artifacts $DEVKITPRO
COPY --from=ghcr.io/wiiu-env/libfunctionpatcher:20230621 /artifacts $DEVKITPRO COPY --from=ghcr.io/wiiu-env/libfunctionpatcher:20230621 /artifacts $DEVKITPRO
COPY --from=ghcr.io/wiiu-env/libkernel:20230621 /artifacts $DEVKITPRO COPY --from=ghcr.io/wiiu-env/libkernel:20230621 /artifacts $DEVKITPRO
COPY --from=ghcr.io/wiiu-env/libmocha:20231127 /artifacts $DEVKITPRO COPY --from=ghcr.io/wiiu-env/libmocha:20231127 /artifacts $DEVKITPRO
COPY --from=ghcr.io/wiiu-env/wiiumodulesystem:20250208 /artifacts $DEVKITPRO COPY --from=ghcr.io/wiiu-env/wiiumodulesystem:20250219 /artifacts $DEVKITPRO
COPY --from=ghcr.io/wiiu-env/wiiupluginsystem:20240505 /artifacts $DEVKITPRO COPY --from=ghcr.io/wiiu-env/wiiupluginsystem:20240505 /artifacts $DEVKITPRO
WORKDIR /app WORKDIR /app

View file

@ -19,7 +19,7 @@ WUT_ROOT := $(DEVKITPRO)/wut
# DATA is a list of directories containing data files # DATA is a list of directories containing data files
# INCLUDES is a list of directories containing header files # INCLUDES is a list of directories containing header files
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
TARGET := Inkay-pretendo TARGET := Malamar-spfn
BUILD := build BUILD := build
SOURCES := src src/patches src/utils src/ext/inih common SOURCES := src src/patches src/utils src/ext/inih common
DATA := data DATA := data

View file

@ -1,8 +1,6 @@
# Inkay - Aroma patches for Pretendo # Malamar - Aroma patches for Splatfestival Network/Spacebar
[![Pretendo network logo](https://github.com/PretendoNetwork/website/raw/master/public/assets/images/opengraph/opengraph-image.png)](https://pretendo.network) Malamar is an Aroma/WUPS plugin based on Pretendo's Malamar that patches various Nintendo Network URLs on a Wii U to use Splatfestival/Spacebar Network instead. It also (for the time being) bypasses SSL verification in most cases. It redirects Nintendo Network in:
Inkay is an Aroma/WUPS plugin that patches various Nintendo Network URLs on a Wii U to use Pretendo Network instead. It also (for the time being) bypasses SSL verification in most cases. It redirects Nintendo Network in:
- IOSU-side connections (Friends, SpotPass, accounts etc.) - IOSU-side connections (Friends, SpotPass, accounts etc.)
- Account Settings - Account Settings
@ -11,27 +9,27 @@ Inkay is an Aroma/WUPS plugin that patches various Nintendo Network URLs on a Wi
- Miiverse (in-game) - Miiverse (in-game)
- Miiverse applet - Miiverse applet
Inkay also includes game-specific patches to add extra features: Malamar also includes game-specific patches to add extra features:
- Modpack-specific matchmaking for global, regional rooms (by simulating extra DLC) - **Mario Kart 8** - Modpack-specific matchmaking for global, regional rooms (by simulating extra DLC) - **Mario Kart 8**
- P2P port override for better connection stability (if you port forward) - **Minecraft: Wii U Edition**, **Mario Kart 8**, **Splatoon** - P2P port override for better connection stability (if you port forward) - **Minecraft: Wii U Edition**, **Mario Kart 8**, **Splatoon**
## Requirements ## Requirements
Inkay is only supported on the release version of Aroma configured for autoboot/coldboot. Other configurations (specifically lacking coldboot) may cause issues with SpotPass. Malamar is only supported on the release version of Aroma configured for autoboot/coldboot. Other configurations (specifically lacking coldboot) may cause issues with SpotPass.
## Safety ## Safety
Inkay's patches are all temporary, and only applied in-memory without modifying your console. The SSL patch, while also temporary, could reduce the overall security of your console while active - this is because it no longer checks if a server is verified. However, this does not apply to the Internet Browser, where SSL still works as expected. Malamar's patches are all temporary, and only applied in-memory without modifying your console. The SSL patch, while also temporary, could reduce the overall security of your console while active - this is because it no longer checks if a server is verified. However, this does not apply to the Internet Browser, where SSL still works as expected.
## Compiling - Docker ## Compiling - Docker
Inkay's dependencies and build tooling can be handled as a container, which is recommended for WUPS plugins. Using `docker` or `podman`: Malamar's dependencies and build tooling can be handled as a container, which is recommended for WUPS plugins. Using `docker` or `podman`:
```shell ```shell
docker build -t inkay . docker build -t malamar .
docker run --rm -v $(pwd):/app inkay make docker run --rm -v $(pwd):/app malamar make
# you can replace "make" with other commands - e.g. make clean # you can replace "make" with other commands - e.g. make clean
``` ```
If using `podman` on SELinux systems (like Fedora Linux), you might need to use `$(pwd):/app:Z` instead of `$(pwd):/app`. If using `podman` on SELinux systems (like Fedora Linux), you might need to use `$(pwd):/app:Z` instead of `$(pwd):/app`.
## Compiling - System ## Compiling - System
Inkay has the following dependencies aside from devkitPPC and wut: Malamar has the following dependencies aside from devkitPPC and wut:
- [WiiUPluginSystem](https://github.com/wiiu-env/WiiUPluginSystem) - [WiiUPluginSystem](https://github.com/wiiu-env/WiiUPluginSystem)
- [WiiUModuleSystem](https://github.com/wiiu-env/WiiUModuleSystem) - [WiiUModuleSystem](https://github.com/wiiu-env/WiiUModuleSystem)
- [libmocha](https://github.com/wiiu-env/libmocha) - [libmocha](https://github.com/wiiu-env/libmocha)
@ -39,7 +37,4 @@ Inkay has the following dependencies aside from devkitPPC and wut:
- [libnotifications](https://github.com/wiiu-env/libnotifications/) - [libnotifications](https://github.com/wiiu-env/libnotifications/)
- [libfunctionpatcher](https://github.com/wiiu-env/libfunctionpatcher) - [libfunctionpatcher](https://github.com/wiiu-env/libfunctionpatcher)
Each of these should be `make install`-able. After that, you can compile Inkay with `make`. Each of these should be `make install`-able. After that, you can compile Malamar with `make`.
## TODO
See [Issues](https://github.com/PretendoNetwork/Inkay/issues).

View file

@ -15,7 +15,7 @@
#endif #endif
#ifndef NETWORK_BASEURL #ifndef NETWORK_BASEURL
#define NETWORK_BASEURL "pretendo.cc" #define NETWORK_BASEURL "spbr.net"
#endif #endif
#endif //INKAY_INKAY_CONFIG_H #endif //INKAY_INKAY_CONFIG_H

View file

@ -4,41 +4,44 @@
#include "lang.h" #include "lang.h"
config_strings get_config_strings(nn::swkbd::LanguageType language) { config_strings get_config_strings(inkay_language language) {
switch (language) { switch (language) {
case nn::swkbd::LanguageType::English: case inkay_language::English:
default: return { default: return {
#include "en_US.lang" #include "en_US.lang"
}; };
case nn::swkbd::LanguageType::Spanish: return { case inkay_language::Spanish: return {
#include "es_ES.lang" #include "es_ES.lang"
}; };
case nn::swkbd::LanguageType::French: return { case inkay_language::French: return {
#include "fr_FR.lang" #include "fr_FR.lang"
}; };
case nn::swkbd::LanguageType::Italian: return { case inkay_language::Italian: return {
#include "it_IT.lang" #include "it_IT.lang"
}; };
case nn::swkbd::LanguageType::German: return { case inkay_language::German: return {
#include "de_DE.lang" #include "de_DE.lang"
}; };
case nn::swkbd::LanguageType::SimplifiedChinese: return { case inkay_language::SimplifiedChinese: return {
#include "zh_CN.lang" #include "zh_CN.lang"
}; };
case nn::swkbd::LanguageType::TraditionalChinese: return { case inkay_language::Portuguese: return {
#include "zh_Hant.lang"
};
case nn::swkbd::LanguageType::Portuguese: return {
#include "pt_BR.lang" #include "pt_BR.lang"
}; };
case nn::swkbd::LanguageType::Japanese: return { case inkay_language::Japanese: return {
#include "ja_JP.lang" #include "ja_JP.lang"
}; };
case nn::swkbd::LanguageType::Dutch: return { case inkay_language::Dutch: return {
#include "nl_NL.lang" #include "nl_NL.lang"
}; };
case nn::swkbd::LanguageType::Russian: return { case inkay_language::Russian: return {
#include "ru_RU.lang" #include "ru_RU.lang"
}; };
case inkay_language::Korean: return {
#include "ko_KR.lang"
};
case inkay_language::EnUwU: return {
#include "en@uwu.lang"
};
} }
} }

View file

@ -1,12 +1,32 @@
#pragma once #pragma once
#include <string_view> #include <string_view>
#include <nn/swkbd.h>
enum inkay_language {
// Wii U System Languages
Japanese = 0,
English,
French,
German,
Italian,
Spanish,
SimplifiedChinese,
Korean,
Dutch,
Portuguese,
Russian,
TraditionalChinese,
Invalid,
// Custom Languages
System,
EnUwU,
};
struct config_strings { struct config_strings {
const char *plugin_name; const char *plugin_name;
std::string_view network_category; std::string_view network_category;
std::string_view connect_to_network_setting; std::string_view connect_to_network_setting;
std::string_view show_startup_toast_setting;
std::string_view other_category; std::string_view other_category;
std::string_view reset_wwp_setting; std::string_view reset_wwp_setting;
std::string_view press_a_action; std::string_view press_a_action;
@ -17,6 +37,11 @@ struct config_strings {
std::string_view multiplayer_port_display; std::string_view multiplayer_port_display;
std::string_view module_not_found; std::string_view module_not_found;
std::string_view module_init_not_found; std::string_view module_init_not_found;
std::string_view setting_yes;
std::string_view setting_no;
std::string_view language_setting;
std::string_view language_name;
std::string_view system_language;
}; };
config_strings get_config_strings(nn::swkbd::LanguageType language); config_strings get_config_strings(inkay_language language);

View file

@ -53,7 +53,7 @@ nn::swkbd::LanguageType get_system_language() {
return nn::swkbd::LanguageType::English; return nn::swkbd::LanguageType::English;
} }
DEBUG_FUNCTION_LINE_VERBOSE("System language found: %d", language); DEBUG_FUNCTION_LINE_VERBOSE("System language found: %d", static_cast<int>(language));
cached_language = language; cached_language = language;
return language; return language;
} }
@ -80,7 +80,7 @@ static void get_mcp_config() {
mcp_os_version = os_version; mcp_os_version = os_version;
DEBUG_FUNCTION_LINE_VERBOSE("Running on %d.%d.%d%c; %s%s", DEBUG_FUNCTION_LINE_VERBOSE("Running on %d.%d.%d%c; %s%s",
os_version.major, os_version.minor, os_version.patch, os_version.region os_version.major, os_version.minor, os_version.patch, os_version.region,
config.code_id, config.serial_id config.code_id, config.serial_id
); );
} }

View file

@ -19,7 +19,7 @@ WUMS_ROOT := $(DEVKITPRO)/wums
# DATA is a list of directories containing data files # DATA is a list of directories containing data files
# INCLUDES is a list of directories containing header files # INCLUDES is a list of directories containing header files
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
TARGET := Inkay-pretendo TARGET := Malamar-spfn
BUILD := build BUILD := build
SOURCES := src src/utils ../common SOURCES := src src/utils ../common
DATA := data DATA := data

View file

@ -25,6 +25,7 @@
#include <wups.h> #include <wups.h>
#include <wups/storage.h> #include <wups/storage.h>
#include <wups/config_api.h> #include <wups/config_api.h>
#include <wups/config/WUPSConfigItemMultipleValues.h>
#include <wups/config/WUPSConfigItemBoolean.h> #include <wups/config/WUPSConfigItemBoolean.h>
#include <wups/config/WUPSConfigItemStub.h> #include <wups/config/WUPSConfigItemStub.h>
@ -39,12 +40,15 @@
static config_strings strings; static config_strings strings;
bool Config::connect_to_network = true; bool Config::connect_to_network = true;
bool Config::show_startup_toast = true;
bool Config::need_relaunch = false; bool Config::need_relaunch = false;
bool Config::unregister_task_item_pressed = false; bool Config::unregister_task_item_pressed = false;
bool Config::is_wiiu_menu = false; bool Config::is_wiiu_menu = false;
uint32_t Config::language = 13;
inkay_language Config::current_language = English;
static WUPSConfigAPICallbackStatus report_error(WUPSConfigAPIStatus err) { static WUPSConfigAPICallbackStatus report_error(WUPSConfigAPIStatus err, int line) {
DEBUG_FUNCTION_LINE_VERBOSE("WUPS config error: %s", WUPSConfigAPI_GetStatusStr(err)); DEBUG_FUNCTION_LINE_VERBOSE("WUPS config error: %s (L%04d)", WUPSConfigAPI_GetStatusStr(err), line);
return WUPSCONFIG_API_CALLBACK_RESULT_ERROR; return WUPSCONFIG_API_CALLBACK_RESULT_ERROR;
} }
@ -52,43 +56,63 @@ static void report_storage_error(WUPSStorageError err) {
DEBUG_FUNCTION_LINE_VERBOSE("WUPS storage error: %s", WUPSStorageAPI_GetStatusStr(err)); DEBUG_FUNCTION_LINE_VERBOSE("WUPS storage error: %s", WUPSStorageAPI_GetStatusStr(err));
} }
static void connect_to_network_changed(ConfigItemBoolean* item, bool new_value) { static void connect_to_network_changed(ConfigItemBoolean *item, bool new_value) {
DEBUG_FUNCTION_LINE_VERBOSE("connect_to_network changed to: %d", new_value); DEBUG_FUNCTION_LINE_VERBOSE("connect_to_network changed to: %d", new_value);
if (new_value != Config::connect_to_network) { if (new_value != Config::connect_to_network) {
Config::need_relaunch = true; Config::need_relaunch = true;
} }
Config::connect_to_network = new_value; Config::connect_to_network = new_value;
WUPSStorageError res; WUPSStorageError res = WUPSStorageAPI_StoreBool(nullptr, "connect_to_network", Config::connect_to_network);
res = WUPSStorageAPI::Store<bool>("connect_to_network", Config::connect_to_network); if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res);
}
static void language_changed(ConfigItemMultipleValues *item, uint32_t new_value) {
DEBUG_FUNCTION_LINE_VERBOSE("language changed to: %d", new_value);
if (new_value != Config::language) {
if (new_value == inkay_language::System)
Config::current_language = (inkay_language) get_system_language();
else
Config::current_language = (inkay_language) new_value;
}
Config::language = new_value;
WUPSStorageError res = WUPSStorageAPI_StoreU32(nullptr, "language", Config::language);
if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res);
}
static void show_startup_toast_changed(ConfigItemBoolean *item, bool new_value) {
DEBUG_FUNCTION_LINE_VERBOSE("show_startup_toast changed to: %d", new_value);
Config::show_startup_toast = new_value;
WUPSStorageError res = WUPSStorageAPI_StoreBool(nullptr, "show_startup_toast", Config::show_startup_toast);
if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res); if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res);
} }
static void unregister_task_item_on_input_cb(void *context, WUPSConfigSimplePadData input) { static void unregister_task_item_on_input_cb(void *context, WUPSConfigSimplePadData input) {
if (!Config::unregister_task_item_pressed && Config::is_wiiu_menu && ((input.buttons_d & WUPS_CONFIG_BUTTON_A) == WUPS_CONFIG_BUTTON_A)) { if (!Config::unregister_task_item_pressed && Config::is_wiiu_menu && (
(input.buttons_d & WUPS_CONFIG_BUTTON_A) == WUPS_CONFIG_BUTTON_A)) {
nn::act::Initialize(); nn::act::Initialize();
Initialize__Q2_2nn4bossFv(); Initialize__Q2_2nn4bossFv();
for (uint8_t i = 1; i <= nn::act::GetNumOfAccounts(); i++) for (uint8_t i = 1; i <= nn::act::GetNumOfAccounts(); i++) {
{ if (nn::act::IsSlotOccupied(i) && nn::act::IsNetworkAccountEx(i)) {
if (nn::act::IsSlotOccupied(i) && nn::act::IsNetworkAccountEx(i)) nn::boss::Task task{};
{ nn::act::PersistentId persistentId = nn::act::GetPersistentIdEx(i);
nn::boss::Task task{};
nn::act::PersistentId persistentId = nn::act::GetPersistentIdEx(i);
__ct__Q3_2nn4boss4TaskFv(&task); __ct__Q3_2nn4boss4TaskFv(&task);
Initialize__Q3_2nn4boss4TaskFPCcUi(&task, "oltopic", persistentId); Initialize__Q3_2nn4boss4TaskFPCcUi(&task, "oltopic", persistentId);
// bypasses compiler warning about unused variable // bypasses compiler warning about unused variable
#ifdef DEBUG #ifdef DEBUG
uint32_t res = Unregister__Q3_2nn4boss4TaskFv(&task); uint32_t res = Unregister__Q3_2nn4boss4TaskFv(&task);
DEBUG_FUNCTION_LINE_VERBOSE("Unregistered oltopic for: SlotNo %d | Persistent ID %08x -> 0x%08x", i, persistentId, res); DEBUG_FUNCTION_LINE_VERBOSE("Unregistered oltopic for: SlotNo %d | Persistent ID %08x -> 0x%08x", i,
#else persistentId, res);
Unregister__Q3_2nn4boss4TaskFv(&task); #else
#endif Unregister__Q3_2nn4boss4TaskFv(&task);
} #endif
} }
}
Finalize__Q2_2nn4bossFv(); Finalize__Q2_2nn4bossFv();
nn::act::Finalize(); nn::act::Finalize();
@ -108,89 +132,141 @@ static int32_t unregister_task_item_get_display_value(void *context, char *out_b
} }
} }
if ((int)string.length() > out_size - 1) return -1; if ((int) string.length() > out_size - 1) return -1;
string.copy(out_buf, string.length()); string.copy(out_buf, string.length());
out_buf[string.length()] = '\0'; out_buf[string.length()] = '\0';
return 0; return 0;
} }
static WUPSConfigAPICallbackStatus ConfigMenuOpenedCallback(WUPSConfigCategoryHandle rootHandle) { static WUPSConfigAPICallbackStatus ConfigMenuOpenedCallback(WUPSConfigCategoryHandle root_cat) {
WUPSConfigAPIStatus err; WUPSConfigAPIStatus err;
bool res;
uint64_t current_title_id = OSGetTitleID(); uint64_t current_title_id = OSGetTitleID();
uint64_t wiiu_menu_tid = _SYSGetSystemApplicationTitleId(SYSTEM_APP_ID_WII_U_MENU); uint64_t wiiu_menu_tid = _SYSGetSystemApplicationTitleId(SYSTEM_APP_ID_WII_U_MENU);
Config::is_wiiu_menu = (current_title_id == wiiu_menu_tid); Config::is_wiiu_menu = (current_title_id == wiiu_menu_tid);
// get translation strings // get translation strings
strings = get_config_strings(get_system_language()); strings = get_config_strings(Config::current_language);
// create root config category // Network submenu
WUPSConfigCategory root = WUPSConfigCategory(rootHandle); // Connect to Pretendo Network Yes/No
// Using UDP port 5000 for multiplayer
auto network_cat = WUPSConfigCategory::Create(strings.network_category, err); WUPSConfigCategoryHandle network_cat;
if (!network_cat) return report_error(err); err = WUPSConfigAPI_Category_Create({strings.network_category.data()}, &network_cat);
if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err, __LINE__);
// config id display name default current value changed callback WUPSConfigItemHandle connect_item;
auto connect_item = WUPSConfigItemBoolean::Create("connect_to_network", strings.connect_to_network_setting, true, Config::connect_to_network, &connect_to_network_changed, err); err = WUPSConfigItemBoolean_CreateEx(
if (!connect_item) return report_error(err); "connect_to_network", strings.connect_to_network_setting.data(), true, Config::connect_to_network,
&connect_to_network_changed, strings.setting_yes.data(), strings.setting_no.data(), &connect_item);
if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err, __LINE__);
res = network_cat->add(std::move(*connect_item), err); err = WUPSConfigAPI_Category_AddItem(network_cat, connect_item);
if (!res) return report_error(err); if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err, __LINE__);
{ const uint16_t port = get_console_peertopeer_port();
uint16_t port = get_console_peertopeer_port(); char buffer[256];
char buffer[256]; snprintf(buffer, sizeof(buffer), strings.multiplayer_port_display.data(), port);
snprintf(buffer, sizeof(buffer), strings.multiplayer_port_display.data(), port);
auto multiplayer_port_display = WUPSConfigItemStub::Create(buffer, err);
if (!multiplayer_port_display) return report_error(err);
res = network_cat->add(std::move(*multiplayer_port_display), err); WUPSConfigItemHandle multiplayer_port_display;
if (!res) return report_error(err); err = WUPSConfigItemStub_Create(buffer, &multiplayer_port_display);
} if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err, __LINE__);
res = root.add(std::move(*network_cat), err); err = WUPSConfigAPI_Category_AddItem(network_cat, multiplayer_port_display);
if (!res) return report_error(err); if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err, __LINE__);
auto other_cat = WUPSConfigCategory::Create(strings.other_category, err); // Add to root and finish
if (!other_cat) return report_error(err); err = WUPSConfigAPI_Category_AddCategory(root_cat, network_cat);
if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err, __LINE__);
WUPSConfigAPIItemCallbacksV2 unregisterTasksItemCallbacks = { // Other category
.getCurrentValueDisplay = unregister_task_item_get_display_value, // Reset Wara Wara Plaza Press A
.getCurrentValueSelectedDisplay = unregister_task_item_get_display_value, // Language English/Spanish/etc..
.onSelected = nullptr, // Show startup toast Yes/No
.restoreDefault = nullptr,
.isMovementAllowed = nullptr,
.onCloseCallback = nullptr,
.onInput = unregister_task_item_on_input_cb,
.onInputEx = nullptr,
.onDelete = nullptr
};
WUPSConfigAPIItemOptionsV2 unregisterTasksItemOptions = { WUPSConfigCategoryHandle other_cat;
.displayName = strings.reset_wwp_setting.data(), err = WUPSConfigAPI_Category_Create({strings.other_category.data()}, &other_cat);
.context = nullptr, if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err, __LINE__);
.callbacks = unregisterTasksItemCallbacks,
};
WUPSConfigItemHandle unregisterTasksItem; WUPSConfigItemHandle unregisterTasksItem;
err = WUPSConfigAPI_Item_Create(unregisterTasksItemOptions, &unregisterTasksItem); err = WUPSConfigAPI_Item_Create({
if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err); .displayName = strings.reset_wwp_setting.data(),
.context = nullptr,
.callbacks = {
.getCurrentValueDisplay = unregister_task_item_get_display_value,
.getCurrentValueSelectedDisplay = unregister_task_item_get_display_value,
.onSelected = nullptr,
.restoreDefault = nullptr,
.isMovementAllowed = nullptr,
.onCloseCallback = nullptr,
.onInput = unregister_task_item_on_input_cb,
.onInputEx = nullptr,
.onDelete = nullptr
},
}, &unregisterTasksItem);
if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err, __LINE__);
err = WUPSConfigAPI_Category_AddItem(other_cat->getHandle(), unregisterTasksItem); err = WUPSConfigAPI_Category_AddItem(other_cat, unregisterTasksItem);
if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err); if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err, __LINE__);
res = root.add(std::move(*other_cat), err); // TODO localise these!
if (!res) return report_error(err); constexpr std::array<ConfigItemMultipleValuesPair, 14> languages = {
{
{0, "Japanese"},
{1, "English"},
{2, "French"},
{3, "German"},
{4, "Italian"},
{5, "Spanish"},
{6, "Simplified Chinese"},
{7, "Korean"},
{8, "Dutch"},
{9, "Portuguese"},
{10, "Russian"},
{11, "Traditional Chinese"},
{13, "System"},
{14, "English (UwU)"},
}
};
constexpr auto find_lang = [languages](const uint32_t lang) -> int {
return std::ranges::find_if(languages, [lang](auto const l) { return l.value == lang; }) -
std::begin(languages);
};
constexpr int system_language = find_lang(13 /* System */);
const int current_language = find_lang(Config::language);
WUPSConfigItemHandle language_item;
err = WUPSConfigItemMultipleValues_Create("language", strings.language_setting.data(), system_language,
current_language,
const_cast<ConfigItemMultipleValuesPair *>(languages.data()), // Yikes!
languages.size(), &language_changed, &language_item);
if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err, __LINE__);
err = WUPSConfigAPI_Category_AddItem(other_cat, language_item);
if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err, __LINE__);
WUPSConfigItemHandle startup_toast_item;
err = WUPSConfigItemBoolean_CreateEx("show_startup_toast", strings.show_startup_toast_setting.data(), true,
Config::show_startup_toast, &show_startup_toast_changed,
strings.setting_yes.data(), strings.setting_no.data(), &startup_toast_item);
if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err, __LINE__);
err = WUPSConfigAPI_Category_AddItem(other_cat, startup_toast_item);
if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err, __LINE__);
// finish up
err = WUPSConfigAPI_Category_AddCategory(root_cat, other_cat);
if (err != WUPSCONFIG_API_RESULT_SUCCESS) return report_error(err, __LINE__);
return WUPSCONFIG_API_CALLBACK_RESULT_SUCCESS; return WUPSCONFIG_API_CALLBACK_RESULT_SUCCESS;
} }
static void ConfigMenuClosedCallback() { static void ConfigMenuClosedCallback() {
// Save all changes // Save all changes
WUPSStorageError res; WUPSStorageError res = WUPSStorageAPI_SaveStorage(false);
res = WUPSStorageAPI::SaveStorage();
if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res); if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res);
if (Config::need_relaunch) { if (Config::need_relaunch) {
@ -202,33 +278,54 @@ static void ConfigMenuClosedCallback() {
} }
void Config::Init() { void Config::Init() {
WUPSConfigAPIStatus cres;
// Init the config api // Init the config api
WUPSConfigAPIOptionsV1 configOptions = { .name = "Inkay" }; WUPSConfigAPIStatus cres =
cres = WUPSConfigAPI_Init(configOptions, ConfigMenuOpenedCallback, ConfigMenuClosedCallback); WUPSConfigAPI_Init({.name = "Inkay"}, ConfigMenuOpenedCallback, ConfigMenuClosedCallback);
if (cres != WUPSCONFIG_API_RESULT_SUCCESS) return (void)report_error(cres); if (cres != WUPSCONFIG_API_RESULT_SUCCESS) return (void) report_error(cres, __LINE__);
WUPSStorageError res; WUPSStorageError res;
// Try to get value from storage // Try to get values from storage
res = WUPSStorageAPI::Get<bool>("connect_to_network", Config::connect_to_network); res = WUPSStorageAPI_GetBool(nullptr, "connect_to_network", &Config::connect_to_network);
if (res == WUPS_STORAGE_ERROR_NOT_FOUND) { if (res == WUPS_STORAGE_ERROR_NOT_FOUND) {
DEBUG_FUNCTION_LINE("Connect to network value not found, attempting to migrate/create"); DEBUG_FUNCTION_LINE_VERBOSE("Connect to network value not found, attempting to migrate/create");
bool skipPatches = false; bool skipPatches = false;
if (WUPSStorageAPI::Get<bool>("skipPatches", skipPatches) == WUPS_STORAGE_ERROR_SUCCESS) { if (WUPSStorageAPI_GetBool(nullptr, "skipPatches", &skipPatches) == WUPS_STORAGE_ERROR_SUCCESS) {
// Migrate old config value // Migrate old config value
Config::connect_to_network = !skipPatches; Config::connect_to_network = !skipPatches;
WUPSStorageAPI::DeleteItem("skipPatches"); WUPSStorageAPI_DeleteItem(nullptr, "skipPatches");
} }
// Add the value to the storage if it's missing. // Add the value to the storage if it's missing.
res = WUPSStorageAPI::Store<bool>("connect_to_network", connect_to_network); res = WUPSStorageAPI_StoreBool(nullptr, "connect_to_network", connect_to_network);
if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res); if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res);
} } else if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res);
else if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res);
res = WUPSStorageAPI_GetU32(nullptr, "language", &Config::language);
if (res == WUPS_STORAGE_ERROR_NOT_FOUND) {
DEBUG_FUNCTION_LINE_VERBOSE("Language value not found, attempting to create");
// Add the value to the storage.
res = WUPSStorageAPI_StoreU32(nullptr, "language", Config::language);
if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res);
} else if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res);
res = WUPSStorageAPI_GetBool(nullptr, "show_startup_toast", &Config::show_startup_toast);
if (res == WUPS_STORAGE_ERROR_NOT_FOUND) {
DEBUG_FUNCTION_LINE_VERBOSE("Show startup toast value not found, attempting to create");
// Add the value to the storage if it's missing.
res = WUPSStorageAPI_StoreBool(nullptr, "show_startup_toast", show_startup_toast);
if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res);
} else if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res);
// Set the language that's currently used
if (Config::language == inkay_language::System)
Config::current_language = (inkay_language) get_system_language();
else
Config::current_language = (inkay_language) Config::language;
// Save storage // Save storage
res = WUPSStorageAPI::SaveStorage(); res = WUPSStorageAPI_SaveStorage(false);
if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res); if (res != WUPS_STORAGE_ERROR_SUCCESS) return report_storage_error(res);
} }

View file

@ -5,12 +5,18 @@
#ifndef INKAY_CONFIG_H #ifndef INKAY_CONFIG_H
#define INKAY_CONFIG_H #define INKAY_CONFIG_H
#include <stdint.h>
#include "lang.h"
class Config { class Config {
public: public:
static void Init(); static void Init();
// wups config items // wups config items
static bool connect_to_network; static bool connect_to_network;
static uint32_t language;
static bool show_startup_toast;
// private stuff // private stuff
static bool need_relaunch; static bool need_relaunch;
@ -18,6 +24,7 @@ public:
// private stuff // private stuff
static bool is_wiiu_menu; static bool is_wiiu_menu;
static inkay_language current_language;
static bool unregister_task_item_pressed; static bool unregister_task_item_pressed;
}; };

View file

@ -21,27 +21,108 @@
#include <notifications/notifications.h> #include <notifications/notifications.h>
#include <utils/logger.h> #include <utils/logger.h>
#include "config.h" #include "config.h"
#include<coreinit/title.h>
#include<coreinit/dynload.h>
#include<vector>
#include "module.h" #include "module.h"
#define INKAY_VERSION "v3.0.0" #define INKAY_VERSION "v3.1.0"
/** /**
Mandatory plugin information. Mandatory plugin information.
If not set correctly, the loader will refuse to use the plugin. If not set correctly, the loader will refuse to use the plugin.
**/ **/
WUPS_PLUGIN_NAME("Inkay"); WUPS_META(name, "Malamar (SPFN)");
WUPS_PLUGIN_DESCRIPTION("Pretendo Network Patcher"); WUPS_META(wups, WUPS_VERSION_STR);
WUPS_USE_WUT_MALLOC();
WUPS_USE_WUT_SOCKETS();
WUPS_USE_WUT_NEWLIB();
WUPS___INIT_WRAPPER();
WUPS___FINI_WRAPPER();
WUPS_INIT_CONFIG_FUNCTIONS();
WUPS_META(buildtimestamp, __DATE__ " " __TIME__);
extern const char wups_meta_plugin_name[] WUPS_SECTION("meta");
const char wups_meta_plugin_name[] = "Malamar (SPFN)";
extern const char wups_meta_info_dump[] WUPS_SECTION("meta");
const char wups_meta_info_dump[] = "(plugin: Malamar (SPFN);" \
"wups " WUPS_VERSION_STR ";" \
"buildtime: " __DATE__ " " __TIME__ ")";
extern const char wups_meta_info_linking_order[] WUPS_SECTION("meta");
const char wups_meta_info_linking_order[] = "Loading \"Malamar (SPFN)\" failed.\n" \
"Function \"wut_get_thread_specific\" returned unexpected value.\n" \
"Please check linking order (expected \"-lwups -lwut\")";
WUPS_PLUGIN_DESCRIPTION("SPFN Network Patcher");
WUPS_PLUGIN_VERSION(INKAY_VERSION); WUPS_PLUGIN_VERSION(INKAY_VERSION);
WUPS_PLUGIN_AUTHOR("Pretendo contributors"); WUPS_PLUGIN_AUTHOR("redbinder0526, kittentm and Pretendo contributors");
WUPS_PLUGIN_LICENSE("GPLv3"); WUPS_PLUGIN_LICENSE("GPLv3");
WUPS_USE_STORAGE("inkay"); WUPS_USE_STORAGE("inkay");
WUPS_USE_WUT_DEVOPTAB(); WUPS_USE_WUT_DEVOPTAB();
bool is_current_game_splatoon(){
auto current_game = OSGetTitleID();
if(
current_game == 0x0005000010162B00 ||
current_game == 0x0005000010176900 ||
current_game == 0x0005000010176A00
){
return true;
}
return false;
}
void splatoon_patcher(){
if (!Config::connect_to_network) {
DEBUG_FUNCTION_LINE_VERBOSE("Inkay: Splatoon patches skipped");
return;
}
if(is_current_game_splatoon()){
NotificationModule_AddInfoNotification("Splatoon Detected, applying patch");
auto rpl_count = OSDynLoad_GetNumberOfRPLs();
std::vector<OSDynLoad_NotifyData> rpls(rpl_count);
if(!OSDynLoad_GetRPLInfo(0, rpl_count, rpls.data())){
NotificationModule_AddInfoNotification("failed to get rpls");
}
for(auto rpl: rpls){
if(rpl.name != 0){
if(strstr(rpl.name, "Gambit") != NULL){
NotificationModule_AddInfoNotification(rpl.name);
auto text_color = NMColor();
text_color.r = 255;
text_color.g = 255;
text_color.b = 255;
text_color.a = 255;
auto bg_color = NMColor();
bg_color.r = 0;
bg_color.g = 0;
bg_color.b = 0;
bg_color.a = 0;
NotificationModule_AddInfoNotificationEx(rpl.name, 30.0f, text_color, bg_color, nullptr, nullptr, true);
NotificationModule_AddInfoNotification("applying patches!!!!");
void* game_data_region = (void*)rpl.dataAddr;
auto str_loc = (char*)(0x000009ac + (uint32_t)game_data_region);
strcpy(str_loc, "https://splatpost.spbr.net/post");
}
}
}
}
}
INITIALIZE_PLUGIN() { INITIALIZE_PLUGIN() {
WHBLogCafeInit(); WHBLogCafeInit();
WHBLogUdpInit();
Config::Init(); Config::Init();
@ -50,7 +131,7 @@ INITIALIZE_PLUGIN() {
} }
// if using pretendo then (try to) apply the ssl patches // if using pretendo then (try to) apply the ssl patches
Inkay_Initialize(Config::connect_to_network); Inkay_Initialize(Config::connect_to_network, Config::show_startup_toast);
} }
DEINITIALIZE_PLUGIN() { DEINITIALIZE_PLUGIN() {
@ -58,11 +139,11 @@ DEINITIALIZE_PLUGIN() {
NotificationModule_DeInitLibrary(); NotificationModule_DeInitLibrary();
WHBLogCafeDeinit(); WHBLogCafeDeinit();
WHBLogUdpDeinit();
} }
ON_APPLICATION_START() { ON_APPLICATION_START() {
// Tell the module the plugin is running! // Tell the module the plugin is running!
splatoon_patcher();
Inkay_SetPluginRunning(); Inkay_SetPluginRunning();
} }

View file

@ -18,25 +18,25 @@
#include "Notification.h" #include "Notification.h"
#include "utils/logger.h" #include "utils/logger.h"
#include "sysconfig.h" #include "config.h"
#include "lang.h" #include "lang.h"
#include <coreinit/dynload.h> #include <coreinit/dynload.h>
static OSDynLoad_Module module; static OSDynLoad_Module module;
static void (*moduleInitialize)(bool) = nullptr; static void (*moduleInitialize)(bool, bool, inkay_language) = nullptr;
static InkayStatus (*moduleGetStatus)() = nullptr; static InkayStatus (*moduleGetStatus)() = nullptr;
static void (*moduleSetPluginRunning)() = nullptr; static void (*moduleSetPluginRunning)() = nullptr;
static const char *get_module_not_found_message() { static const char *get_module_not_found_message() {
return get_config_strings(get_system_language()).module_not_found.data(); return get_config_strings(Config::current_language).module_not_found.data();
} }
static const char *get_module_init_not_found_message() { static const char *get_module_init_not_found_message() {
return get_config_strings(get_system_language()).module_init_not_found.data(); return get_config_strings(Config::current_language).module_init_not_found.data();
} }
void Inkay_Initialize(bool apply_patches) { void Inkay_Initialize(bool apply_patches, bool show_startup_toast) {
if (module) { if (module) {
return; return;
} }
@ -48,13 +48,13 @@ void Inkay_Initialize(bool apply_patches) {
} }
if (OSDynLoad_FindExport(module, OS_DYNLOAD_EXPORT_FUNC, "Inkay_Initialize", reinterpret_cast<void * *>(&moduleInitialize)) != OS_DYNLOAD_OK) { if (OSDynLoad_FindExport(module, OS_DYNLOAD_EXPORT_FUNC, "Inkay_Initialize", reinterpret_cast<void * *>(&moduleInitialize)) != OS_DYNLOAD_OK) {
DEBUG_FUNCTION_LINE("Failed to find initialization function"); DEBUG_FUNCTION_LINE("Failed to find function %s", "Inkay_Initialize");
ShowNotification(get_module_init_not_found_message()); ShowNotification(get_module_init_not_found_message());
OSDynLoad_Release(module); OSDynLoad_Release(module);
return; return;
} }
moduleInitialize(apply_patches); moduleInitialize(apply_patches, show_startup_toast, Config::current_language);
} }
void Inkay_Finalize() { void Inkay_Finalize() {
@ -72,7 +72,7 @@ InkayStatus Inkay_GetStatus() {
} }
if (!moduleGetStatus && OSDynLoad_FindExport(module, OS_DYNLOAD_EXPORT_FUNC, "Inkay_GetStatus", reinterpret_cast<void * *>(&moduleGetStatus)) != OS_DYNLOAD_OK) { if (!moduleGetStatus && OSDynLoad_FindExport(module, OS_DYNLOAD_EXPORT_FUNC, "Inkay_GetStatus", reinterpret_cast<void * *>(&moduleGetStatus)) != OS_DYNLOAD_OK) {
DEBUG_FUNCTION_LINE("Failed to find status function"); DEBUG_FUNCTION_LINE("Failed to find function %s", "Inkay_GetStatus");
return InkayStatus::Error; return InkayStatus::Error;
} }
@ -85,7 +85,7 @@ void Inkay_SetPluginRunning() {
} }
if (!moduleSetPluginRunning && OSDynLoad_FindExport(module, OS_DYNLOAD_EXPORT_FUNC, "Inkay_SetPluginRunning", reinterpret_cast<void * *>(&moduleSetPluginRunning)) != OS_DYNLOAD_OK) { if (!moduleSetPluginRunning && OSDynLoad_FindExport(module, OS_DYNLOAD_EXPORT_FUNC, "Inkay_SetPluginRunning", reinterpret_cast<void * *>(&moduleSetPluginRunning)) != OS_DYNLOAD_OK) {
DEBUG_FUNCTION_LINE("Failed to find \"Inkay_SetPluginRunning\" function"); DEBUG_FUNCTION_LINE("Failed to find function %s", "Inkay_SetPluginRunning");
return; return;
} }

View file

@ -24,7 +24,7 @@ enum class InkayStatus {
Error = -1 ///< Failed to retrieve the module status Error = -1 ///< Failed to retrieve the module status
}; };
void Inkay_Initialize(bool apply_patches); void Inkay_Initialize(bool apply_patches, bool show_startup_toast);
void Inkay_Finalize(); void Inkay_Finalize();
InkayStatus Inkay_GetStatus(); InkayStatus Inkay_GetStatus();
void Inkay_SetPluginRunning(); void Inkay_SetPluginRunning();

3
renovate.json Normal file
View file

@ -0,0 +1,3 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json"
}

View file

@ -18,6 +18,7 @@
#include "config.h" #include "config.h"
bool Config::connect_to_network = false; bool Config::connect_to_network = false;
bool Config::show_startup_toast = false;
bool Config::initialized = false; bool Config::initialized = false;
bool Config::shown_warning = false; bool Config::shown_warning = false;
bool Config::plugin_is_loaded = false; bool Config::plugin_is_loaded = false;

View file

@ -10,6 +10,8 @@ public:
static bool connect_to_network; static bool connect_to_network;
static bool show_startup_toast;
static bool initialized; static bool initialized;
static bool shown_warning; static bool shown_warning;

View file

@ -8,35 +8,35 @@ typedef struct URL_Patch {
static const URL_Patch url_patches[] = { static const URL_Patch url_patches[] = {
//nim-boss .rodata //nim-boss .rodata
{0xE2282550, "http://pushmore.wup.shop.pretendo.cc/pushmore/r/%s"}, {0xE2282550, "http://pushmorewupshop.spbr.net/pushmore/r/%s"},
{0xE229A0A0, "http://npns-dev.c.app.pretendo.cc/bst.dat"}, {0xE229A0A0, "http://npns-devcapp.spbr.net/bst.dat"},
{0xE229A0D0, "http://npns-dev.c.app.pretendo.cc/bst2.dat"}, {0xE229A0D0, "http://npns-devcapp.spbr.net/bst2.dat"},
{0xE2281964, "https://tagaya.wup.shop.pretendo.cc/tagaya/versionlist/%s/%s/%s"}, {0xE2281964, "https://tagayawupshop.spbr.net/tagaya/versionlist/%s/%s/%s"},
{0xE22819B4, "https://tagaya.wup.shop.pretendo.cc/tagaya/versionlist/%s/%s/latest_version"}, {0xE22819B4, "https://tagayawupshop.spbr.net/tagaya/versionlist/%s/%s/latest_version"},
{0xE2282584, "http://pushmo.wup.shop.pretendo.cc/pushmo/d/%s/%u"}, {0xE2282584, "http://pushmowupshop.spbr.net/pushmo/d/%s/%u"},
{0xE22825B8, "http://pushmo.wup.shop.pretendo.cc/pushmo/c/%u/%u"}, {0xE22825B8, "http://pushmowupshop.spbr.net/pushmo/c/%u/%u"},
{0xE2282DB4, "https://ecs.wup.shop.pretendo.cc/ecs/services/ECommerceSOAP"}, {0xE2282DB4, "https://ecswupshop.spbr.net/ecs/services/ECommerceSOAP"},
{0xE22830A0, "https://ecs.wup.shop.pretendo.cc/ecs/services/ECommerceSOAP"}, {0xE22830A0, "https://ecswupshop.spbr.net/ecs/services/ECommerceSOAP"},
{0xE22830E0, "https://nus.wup.shop.pretendo.cc/nus/services/NetUpdateSOAP"}, {0xE22830E0, "https://nuswupshop.spbr.net/nus/services/NetUpdateSOAP"},
{0xE2299990, "nppl.app.pretendo.cc"}, {0xE2299990, "policylist.spbr.net"},
{0xE229A600, "https://pls.wup.shop.pretendo.cc/pls/upload"}, {0xE229A600, "https://plswupshop.spbr.net/pls/upload"},
{0xE229A6AC, "https://npvk-dev.app.pretendo.cc/reports"}, {0xE229A6AC, "https://npvk-devapp.spbr.net/reports"},
{0xE229A6D8, "https://npvk.app.pretendo.cc/reports"}, {0xE229A6D8, "https://npvkapp.spbr.net/reports"},
{0xE229B1F4, "https://npts.app.pretendo.cc/p01/tasksheet/%s/%s/%s/%s?c=%s&l=%s"}, {0xE229B1F4, "https://tasksheets.spbr.net/p01/tasksheet/%s/%s/%s/%s?c=%s&l=%s"},
{0xE229B238, "https://npts.app.pretendo.cc/p01/tasksheet/%s/%s/%s?c=%s&l=%s"}, {0xE229B238, "https://tasksheets.spbr.net/p01/tasksheet/%s/%s/%s?c=%s&l=%s"},
{0xE22AB2D8, "https://idbe-wup.cdn.pretendo.cc/icondata/%02X/%016llX.idbe"}, {0xE22AB2D8, "https://idbe-wupcdn.spbr.net/icondata/%02X/%016llX.idbe"},
{0xE22AB318, "https://idbe-ctr.cdn.pretendo.cc/icondata/%02X/%016llX.idbe"}, {0xE22AB318, "https://idbe-ctrcdn.spbr.net/icondata/%02X/%016llX.idbe"},
{0xE22AB358, "https://idbe-wup.cdn.pretendo.cc/icondata/%02X/%016llX-%d.idbe"}, {0xE22AB358, "https://idbe-wupcdn.spbr.net/icondata/%02X/%016llX-%d.idbe"},
{0xE22AB398, "https://idbe-ctr.cdn.pretendo.cc/icondata/%02X/%016llX-%d.idbe"}, {0xE22AB398, "https://idbe-ctrcdn.spbr.net/icondata/%02X/%016llX-%d.idbe"},
{0xE22B3EF8, "https://ecs.c.shop.pretendo.cc"}, {0xE22B3EF8, "https://ecscshop.spbr.net"},
{0xE22B3F30, "https://ecs.c.shop.pretendo.cc/ecs/services/ECommerceSOAP"}, {0xE22B3F30, "https://ecscshop.spbr.net/ecs/services/ECommerceSOAP"},
{0xE22B3F70, "https://ias.c.shop.pretendo.cc/ias/services/IdentityAuthenticationSOAP"}, {0xE22B3F70, "https://iascshop.spbr.net/ias/services/IdentityAuthenticationSOAP"},
{0xE22B3FBC, "https://cas.c.shop.pretendo.cc/cas/services/CatalogingSOAP"}, {0xE22B3FBC, "https://cascshop.spbr.net/cas/services/CatalogingSOAP"},
{0xE22B3FFC, "https://nus.c.shop.pretendo.cc/nus/services/NetUpdateSOAP"}, {0xE22B3FFC, "https://nuscshop.spbr.net/nus/services/NetUpdateSOAP"},
{0xE229DE0C, "n.app.pretendo.cc"}, {0xE229DE0C, "n.app.spbr.net"},
//nim-boss .bss //nim-boss .bss
{0xE24B8A24, "https://nppl.app.pretendo.cc/p01/policylist/1/1/UNK"}, {0xE24B8A24, "https://policylist.spbr.net/p01/policylist/1/1/UNK"},
{0xE31930D4, "https://%s%saccount.pretendo.cc/v%u/api/"} {0xE31930D4, "https://%s%saccount.spbr.net/v%u/api/"}
}; };

View file

@ -1,13 +1,18 @@
.plugin_name="Inkay" .plugin_name="Inkay"
,.network_category="Netzwerkauswahl" ,.network_category="Netzwerkauswahl"
,.connect_to_network_setting="Verbinde zum Pretendo Network" ,.connect_to_network_setting="Verbinde zum SPFN"
,.other_category="Andere Einstellungen" ,.other_category="Andere Einstellungen"
,.reset_wwp_setting="Wara Wara Plaza zurücksetzen" ,.reset_wwp_setting="Wara Wara Plaza zurücksetzen"
,.press_a_action="Drücke A" ,.press_a_action="Drücke A"
,.restart_to_apply_action="Neustarten zum Anwenden" ,.restart_to_apply_action="Neustarten zum Anwenden"
,.need_menu_action="Nur vom Wii U-Menü aus" ,.need_menu_action="Nur vom Wii U-Menü aus"
,.using_nintendo_network="Nutze Nintendo Network" ,.using_nintendo_network="Nutze Nintendo Network"
,.using_pretendo_network="Nutze Pretendo Network" ,.using_pretendo_network="Nutze SPFN"
,.multiplayer_port_display="Nutze UDP Port %hu für Mehrspieler" ,.multiplayer_port_display="Nutze UDP Port %hu für Mehrspieler"
,.module_not_found="Pretendo Patch fehlgeschlagen - nutze Aroma Updater zum Reparieren (686-1001 Module missing)" ,.module_not_found="SPFN Patch fehlgeschlagen - nutze Aroma Updater zum Reparieren (686-1001 Module missing)"
,.module_init_not_found="Pretendo Patch fehlgeschlagen - nutze Aroma Updater zum Reparieren (686-1002 Module init)" ,.module_init_not_found="SPFN Patch fehlgeschlagen - nutze Aroma Updater zum Reparieren (686-1002 Module init)"
,.setting_yes=""
,.setting_no=""
,.language_setting=""
,.language_name="Deutsch"
,.system_language=""

View file

@ -1,8 +1,7 @@
.plugin_name="Inky ^w^" .plugin_name="Inky ^w^"
,.network_category="Newowk sewectiown! :3" ,.network_category="Newowk sewectiown! :3"
,.connect_to_network_setting="use dah pretender!!!!" ,.connect_to_network_setting="use dah pretender!!!!"
,.show_startup_toast_setting="show da deets :3"
,.other_category="oth3r stuffzz" ,.other_category="oth3r stuffzz"
,.reset_wwp_setting="warah wara go BYEBYE x3c" ,.reset_wwp_setting="warah wara go BYEBYE x3c"
,.press_a_action="Press A plz?" ,.press_a_action="Press A plz?"
@ -13,3 +12,8 @@
,.multiplayer_port_display="mah secret word is %hu... ur modem will know" ,.multiplayer_port_display="mah secret word is %hu... ur modem will know"
,.module_not_found="oh noez! pls get aroma updater help :( (686-1001 Module missing)" ,.module_not_found="oh noez! pls get aroma updater help :( (686-1001 Module missing)"
,.module_init_not_found="oh noez! pls get aroma updater help :( (686-1002 Module init)" ,.module_init_not_found="oh noez! pls get aroma updater help :( (686-1002 Module init)"
,.setting_yes="yaah!"
,.setting_no="nu >w<"
,.language_setting="spek..."
,.language_name="kitteh speak!!"
,.system_language="System"

View file

@ -1,13 +1,19 @@
.plugin_name = "Inkay" .plugin_name="Malamar"
,.network_category = "Network selection" ,.network_category="Network selection"
,.connect_to_network_setting = "Connect to the Pretendo network" ,.connect_to_network_setting="Connect to SPFN"
,.other_category = "Other settings" ,.show_startup_toast_setting="Show startup toast"
,.reset_wwp_setting = "Reset Wara Wara Plaza" ,.other_category="Other settings"
,.press_a_action = "Press A" ,.reset_wwp_setting="Reset Wara Wara Plaza"
,.restart_to_apply_action = "Restart to apply" ,.press_a_action="Press A"
,.need_menu_action = "From WiiU menu only" ,.restart_to_apply_action="Restart to apply"
,.using_nintendo_network = "Using Nintendo Network" ,.need_menu_action="From WiiU menu only"
,.using_pretendo_network = "Using Pretendo Network" ,.using_nintendo_network="Using Nintendo Network"
,.multiplayer_port_display = "Using UDP port %hu for multiplayer" ,.using_pretendo_network="Using SPFN"
,.module_not_found = "Pretendo patch failed - use Aroma Updater to repair (686-1001 Module missing)" ,.multiplayer_port_display="Using UDP port %hu for multiplayer"
,.module_init_not_found = "Pretendo patch failed - use Aroma Updater to repair (686-1002 Module init)" ,.module_not_found="SPFN patch failed - use Aroma Updater to repair (686-1001 Module missing)"
,.module_init_not_found="SPFN patch failed - use Aroma Updater to repair (686-1002 Module init)"
,.setting_yes="Yes"
,.setting_no="No"
,.language_setting="Language"
,.language_name="English"
,.system_language="System"

View file

@ -1,13 +1,19 @@
.plugin_name="Inkay" .plugin_name="Inkay"
,.network_category="Seleccionar red" ,.network_category="Seleccionar red"
,.connect_to_network_setting="Conectar a la red Pretendo" ,.connect_to_network_setting="Conectar a SPFN"
,.show_startup_toast_setting=""
,.other_category="Otros ajustes" ,.other_category="Otros ajustes"
,.reset_wwp_setting="Restablecer Plaza Wara Wara" ,.reset_wwp_setting="Restablecer Plaza Wara Wara"
,.press_a_action="Pulsa A" ,.press_a_action="Pulsa A"
,.restart_to_apply_action="Reiniciar para aplicar" ,.restart_to_apply_action="Reiniciar para aplicar"
,.need_menu_action="Solo desde el Menú de Wii U" ,.need_menu_action="Solo desde el Menú de Wii U"
,.using_nintendo_network="Usando Nintendo Network" ,.using_nintendo_network="Usando Nintendo Network"
,.using_pretendo_network="Usando Pretendo Network" ,.using_pretendo_network="Usando SPFN"
,.multiplayer_port_display="Usando puerto UDP %hu para multijugador" ,.multiplayer_port_display="Usando puerto UDP %hu para multijugador"
,.module_not_found="Falló el parche Pretendo - usa Aroma Updater para reparar (686-1001 Falta un módulo)" ,.module_not_found="Ha fallado el parche SPFN - usa Aroma Updater para repararlo (686-1001 Falta un módulo)"
,.module_init_not_found="Falló el parche Pretendo - usa Aroma Updater para reparar (686-1002 Inicialización del módulo)" ,.module_init_not_found="Ha fallado el parche SPFN - usa Aroma Updater para repararlo (686-1002 Inicialización del módulo)"
,.setting_yes=""
,.setting_no=""
,.language_setting=""
,.language_name="Español"
,.system_language=""

View file

@ -1,13 +1,18 @@
.plugin_name="Inkay" .plugin_name="Inkay"
,.network_category="Sélection du réseau" ,.network_category="Sélection du réseau"
,.connect_to_network_setting="Connexion au Pretendo Network" ,.connect_to_network_setting="Connexion au SPFN"
,.other_category="Autres paramètres" ,.other_category="Autres paramètres"
,.reset_wwp_setting="Réinitialiser la place WaraWara" ,.reset_wwp_setting="Réinitialiser la place WaraWara"
,.press_a_action="Appuyez sur A" ,.press_a_action="Appuyez sur A"
,.restart_to_apply_action="(prendra effet au redémarrage)" ,.restart_to_apply_action="Redémarrer pour appliquer"
,.need_menu_action="(retournez d'abord au menu Wii U)" ,.need_menu_action="(retournez d'abord au menu Wii U)"
,.using_nintendo_network="Réseau sélectionné : Nintendo Network" ,.using_nintendo_network="Réseau sélectionné : Nintendo Network"
,.using_pretendo_network="Réseau sélectionné : Pretendo Network" ,.using_pretendo_network="Réseau sélectionné : SPFN"
,.multiplayer_port_display="Le port UDP %hu sera utilisé pour le multijoueur" ,.multiplayer_port_display="Le port UDP %hu sera utilisé pour le multijoueur"
,.module_not_found="Le patch Pretendo a échoué, veuillez le réparer avec Aroma Updater (686-1001 Module introuvable)" ,.module_not_found="Le patch SPFN a rencontré un problème, veuillez le réparer avec Aroma Updater (686-1001 Module missing)"
,.module_init_not_found="Le patch Pretendo a échoué, veuillez le réparer avec Aroma Updater (686-1002 Point d'entrée du module)" ,.module_init_not_found="Le patch SPFN a rencontré un problème, veuillez le réparer avec Aroma Updater (686-1002 Module init)"
,.setting_yes=""
,.setting_no=""
,.language_setting=""
,.language_name="Français"
,.system_language=""

View file

@ -1,13 +1,19 @@
.plugin_name="Inkay" .plugin_name="Inkay"
,.network_category="Seleziona la rete" ,.network_category="Seleziona la rete"
,.connect_to_network_setting="Connettiti alla rete Pretendo" ,.connect_to_network_setting="Connettiti a SPFN"
,.show_startup_toast_setting=""
,.other_category="Altre impostazioni" ,.other_category="Altre impostazioni"
,.reset_wwp_setting="Ripristina Wara Wara Plaza" ,.reset_wwp_setting="Ripristina Wara Wara Plaza"
,.press_a_action="Premi A" ,.press_a_action="Premi A"
,.restart_to_apply_action="Riavvia per applicare" ,.restart_to_apply_action="Riavvia per applicare"
,.need_menu_action="Solo dal menu WiiU" ,.need_menu_action="Solo dal menu WiiU"
,.using_nintendo_network="In uso Nintendo Network" ,.using_nintendo_network="In uso Nintendo Network"
,.using_pretendo_network="In uso Pretendo Network" ,.using_pretendo_network="In uso SPFN"
,.multiplayer_port_display="È in uso la porta UDP %hu per il multigiocatore" ,.multiplayer_port_display="È in uso la porta UDP %hu per il multigiocatore"
,.module_not_found="Patch di Pretendo fallita - usa Aroma Updater per correggere (686-1001 Modulo mancante)" ,.module_not_found="Patch di SPFN fallita - usa Aroma Updater per correggere (686-1001 Modulo mancante)"
,.module_init_not_found="Patch di Pretendo fallita - usa Aroma Updater per correggere (686-1002 Module init)" ,.module_init_not_found="Patch di SPFN fallita - usa Aroma Updater per correggere (686-1002 Module init)"
,.setting_yes=""
,.setting_no=""
,.language_setting=""
,.language_name="Italiano"
,.system_language=""

View file

@ -1,13 +1,19 @@
.plugin_name="Inkay" .plugin_name="Inkay"
,.network_category="ネットワークの選択" ,.network_category="ネットワークの選択"
,.connect_to_network_setting="Pretendoネットワークに接続する" ,.connect_to_network_setting="SPFNネットワークに接続する"
,.show_startup_toast_setting=""
,.other_category="その他の設定" ,.other_category="その他の設定"
,.reset_wwp_setting="わらわら広場をリセット" ,.reset_wwp_setting="わらわら広場をリセット"
,.press_a_action="Aボタンを押そう" ,.press_a_action="Aボタンを押そう"
,.restart_to_apply_action="再起動後に反映されます" ,.restart_to_apply_action="再起動後に反映されます"
,.need_menu_action="Wii Uメニューからのみ実行可能" ,.need_menu_action="Wii Uメニューからのみ実行可能"
,.using_nintendo_network="選択済み:ニンテンドーネットワーク" ,.using_nintendo_network="選択済み:ニンテンドーネットワーク"
,.using_pretendo_network="選択済み:Pretendo ネットワーク" ,.using_pretendo_network="選択済み:SPFN ネットワーク"
,.multiplayer_port_display="マルチプレイに UDPポート %hu を使用します" ,.multiplayer_port_display="マルチプレイに UDPポート %hu を使用します"
,.module_not_found="Pretendo パッチに失敗しました。Aroma Updaterを使用して解決してみてください。(686-1001 Module missing)" ,.module_not_found="SPFN パッチに失敗しました。Aroma Updaterを使用して解決してみてください。(686-1001 Module missing)"
,.module_init_not_found="Pretendo パッチに失敗しました。Aroma Updaterを使用して解決してみてください。(686-1002 Module init)" ,.module_init_not_found="SPFN パッチに失敗しました。Aroma Updaterを使用して解決してみてください。(686-1002 Module init)"
,.setting_yes=""
,.setting_no=""
,.language_setting=""
,.language_name="日本語"
,.system_language=""

19
src/lang/ko_KR.lang Normal file
View file

@ -0,0 +1,19 @@
.plugin_name="Inkay"
,.network_category="네트워크 선택"
,.connect_to_network_setting="SPFN 사용"
,.show_startup_toast_setting=""
,.other_category="기타 설정"
,.reset_wwp_setting="Wara Wara Plaza 초기화"
,.press_a_action="A 버튼을 누르세요"
,.restart_to_apply_action="재시작 후 적용"
,.need_menu_action="Wii U 메뉴에서만"
,.using_nintendo_network="Nintendo Network 사용 중"
,.using_pretendo_network="SPFN 사용 중"
,.multiplayer_port_display="멀티플레이어에 UDP 포트 %hu을(를) 사용합니다"
,.module_not_found="패치를 적용하는 데 실패했습니다. Aroma Updater로 복구해 주세요. (686-1001 모듈 없음)"
,.module_init_not_found="패치를 적용하는 데 실패했습니다. Aroma Updater로 복구해 주세요. (686-1002 모듈 초기화)"
,.setting_yes=""
,.setting_no=""
,.language_setting=""
,.language_name="한국어"
,.system_language=""

View file

@ -1,13 +1,19 @@
.plugin_name="Inkay" .plugin_name="Inkay"
,.network_category="Netwerkselectie" ,.network_category="Netwerkselectie"
,.connect_to_network_setting="Verbind met het Pretendo-netwerk" ,.connect_to_network_setting="Verbind met het SPFN-netwerk"
,.show_startup_toast_setting=""
,.other_category="Overige instellingen" ,.other_category="Overige instellingen"
,.reset_wwp_setting="Reset het Wara Wara Plaza" ,.reset_wwp_setting="Reset het Wara Wara Plaza"
,.press_a_action="Druk A" ,.press_a_action="Druk A"
,.restart_to_apply_action="Herstart om toe te passen" ,.restart_to_apply_action="Herstart om toe te passen"
,.need_menu_action="Alleen vanuit het WiiU-menu" ,.need_menu_action="Alleen vanuit het WiiU-menu"
,.using_nintendo_network="Nintendo Network wordt gebruikt" ,.using_nintendo_network="Nintendo Network wordt gebruikt"
,.using_pretendo_network="Pretendo Network wordt gebruikt" ,.using_pretendo_network="SPFN wordt gebruikt"
,.multiplayer_port_display = "Using UDP port %hu for multiplayer" ,.multiplayer_port_display="Gebruikt UDP port %hu voor multiplayer"
,.module_not_found="Pretendo patch mislukt - gebruik Aroma Updater om het te herstellen (686-1001 Module ontbreekt)" ,.module_not_found="SPFN patch mislukt - gebruik Aroma Updater om het te herstellen (686-1001 Module ontbreekt)"
,.module_init_not_found="Pretendo patch mislukt - gebruik Aroma Updater om het te herstellen (686-1002 Module init)" ,.module_init_not_found="SPFN patch mislukt - gebruik Aroma Updater om het te herstellen (686-1002 Module init)"
,.setting_yes=""
,.setting_no=""
,.language_setting=""
,.language_name="Nederlands"
,.system_language=""

View file

@ -1,13 +1,19 @@
.plugin_name="Inkay" .plugin_name="Inkay"
,.network_category="Selecionar rede" ,.network_category="Selecionar rede"
,.connect_to_network_setting="Conecta-se à Pretendo Network" ,.connect_to_network_setting="Conecta-se à SPFN"
,.show_startup_toast_setting=""
,.other_category="Outras configurações" ,.other_category="Outras configurações"
,.reset_wwp_setting="Resetar Wara Wara Plaza" ,.reset_wwp_setting="Resetar Wara Wara Plaza"
,.press_a_action="Aperte A" ,.press_a_action="Aperte A"
,.restart_to_apply_action="Reinicie para aplicar" ,.restart_to_apply_action="Reinicie para aplicar"
,.need_menu_action="Apenas no menu do Wii U" ,.need_menu_action="Apenas no menu do Wii U"
,.using_nintendo_network="Usando Nintendo Network" ,.using_nintendo_network="Usando Nintendo Network"
,.using_pretendo_network="Usando Pretendo Network" ,.using_pretendo_network="Usando SPFN"
,.multiplayer_port_display="Usando UDP port %hu para a jogatina multiplayer" ,.multiplayer_port_display="Usando UDP port %hu para a jogatina multiplayer"
,.module_not_found="Atualização do Pretendo falhou - use o Aroma Updater para corrigir (686-1001 Módulo faltando)" ,.module_not_found="Atualização do SPFN falhou - use o Aroma Updater para corrigir (686-1001 Módulo faltando)"
,.module_init_not_found="Atualização do Pretendo falhou - use o Aroma Updater para corrigir (686-1002 Módulo de início)" ,.module_init_not_found="Atualização do SPFN falhou - use o Aroma Updater para corrigir (686-1002 Módulo de início)"
,.setting_yes=""
,.setting_no=""
,.language_setting=""
,.language_name="Português"
,.system_language=""

View file

@ -1,13 +1,19 @@
.plugin_name="Inkay" .plugin_name="Inkay"
,.network_category="Выбор сети" ,.network_category="Выбор сети"
,.connect_to_network_setting="Подключиться к Pretendo Network" ,.connect_to_network_setting="Подключиться к SPFN"
,.show_startup_toast_setting=""
,.other_category="Другие настройки" ,.other_category="Другие настройки"
,.reset_wwp_setting="Сбросить Wara Wara Plaza" ,.reset_wwp_setting="Сбросить Wara Wara Plaza"
,.press_a_action="Нажмите A" ,.press_a_action="Нажмите A"
,.restart_to_apply_action="Перезагрузите для применения изменений" ,.restart_to_apply_action="Перезагрузите для применения изменений"
,.need_menu_action="Только из меню Wii U" ,.need_menu_action="Только из меню Wii U"
,.using_nintendo_network="Используется Nintendo Network" ,.using_nintendo_network="Используется Nintendo Network"
,.using_pretendo_network="Используется Pretendo Network" ,.using_pretendo_network="Используется SPFN"
,.multiplayer_port_display="Используем UDP-порт %hu для сетевой игры" ,.multiplayer_port_display="Используем UDP-порт %hu для сетевой игры"
,.module_not_found="Ошибка установки патча Pretendo - для восстановления, запустите Aroma Updater (686-1001 Модуль отсутствует)" ,.module_not_found="Ошибка установки патча SPFN - для восстановления, запустите Aroma Updater (686-1001 Модуль отсутствует)"
,.module_init_not_found="Ошибка установки патча Pretendo - для восстановления, запустите Aroma Updater (686-1002 Инициализация модуля)" ,.module_init_not_found="Ошибка установки патча SPFN - для восстановления, запустите Aroma Updater (686-1002 Инициализация модуля)"
,.setting_yes=""
,.setting_no=""
,.language_setting=""
,.language_name="Русский язык"
,.system_language=""

View file

@ -1,13 +1,18 @@
.plugin_name="Inkay" .plugin_name="Inkay"
,.network_category="选择网络" ,.network_category="选择网络"
,.connect_to_network_setting="连接到Pretendo network" ,.connect_to_network_setting="连接到SPFN"
,.other_category="其他设置" ,.other_category="其他设置"
,.reset_wwp_setting="重置Wara Wara Plaza" ,.reset_wwp_setting="重置Wara Wara Plaza"
,.press_a_action="请按 A" ,.press_a_action="请按 A"
,.restart_to_apply_action="重启以应用设置" ,.restart_to_apply_action="重启以应用设置"
,.need_menu_action="仅来自WiiU Menu" ,.need_menu_action="仅来自WiiU Menu"
,.using_nintendo_network="使用 Nintendo Network" ,.using_nintendo_network="使用 Nintendo Network"
,.using_pretendo_network="使用 Pretendo Network" ,.using_pretendo_network="使用 SPFN"
,.multiplayer_port_display="多人游戏使用 UDP 端口 %hu" ,.multiplayer_port_display="多人游戏使用 UDP 端口 %hu"
,.module_not_found="Pretendo 补丁失败 - 使用 Aroma Updater 修复686-1001 模块丢失)" ,.module_not_found="SPFN 补丁失败 - 使用 Aroma Updater 修复686-1001 模块丢失)"
,.module_init_not_found="Pretendo 补丁失败 - 使用 Aroma Updater 修复686-1002 模块初始化)" ,.module_init_not_found="SPFN 补丁失败 - 使用 Aroma Updater 修复686-1002 模块初始化)"
,.setting_yes=""
,.setting_no=""
,.language_setting=""
,.language_name="中文(简体)"
,.system_language=""

View file

@ -1,13 +1,20 @@
.plugin_name = "Inkay" .plugin_name="Inkay"
,.network_category = "選擇網路" ,.network_category="選擇網路"
,.connect_to_network_setting = "連接到Pretendo network" ,.connect_to_network_setting="連接到SPFN"
,.other_category = "其他設定" ,.show_startup_toast_setting=""
,.reset_wwp_setting = "重置Wara Wara Plaza" ,.other_category="其他設定"
,.press_a_action = "請按 A" ,.reset_wwp_setting="重置Wara Wara Plaza"
,.restart_to_apply_action = "重啓以套用設定" ,.press_a_action="請按 A"
,.need_menu_action = "僅來自WiiU Menu" ,.restart_to_apply_action="重啓以套用設定"
,.using_nintendo_network = "使用 Nintendo Network" ,.need_menu_action="僅來自WiiU Menu"
,.using_pretendo_network = "使用 Pretendo Network" ,.using_nintendo_network="使用 Nintendo Network"
,.multiplayer_port_display = "Using UDP port %hu for multiplayer" ,.using_pretendo_network="使用 SPFN"
,.module_not_found = "Pretendo patch failed - use Aroma Updater to repair (686-1001 Module missing)" ,.multiplayer_port_display="Using UDP port %hu for multiplayer"
,.module_init_not_found = "Pretendo patch failed - use Aroma Updater to repair (686-1002 Module init)" ,.module_not_found="SPFN patch failed - use Aroma Updater to repair (686-1001 Module missing)"
,.module_init_not_found="SPFN patch failed - use Aroma Updater to repair (686-1002 Module init)"
,.multiplayer_port_display="使用 UDP 端口 %hu 進行多人遊戲"
,.setting_yes=""
,.setting_no=""
,.language_setting=""
,.language_name="中文(繁體)"
,.system_language=""

View file

@ -39,16 +39,34 @@
#include "ca_pem.h" #include "ca_pem.h"
#define INKAY_VERSION "v3.0.0" #define INKAY_VERSION "v3.1.0"
/** /**
Mandatory plugin information. Mandatory plugin information.
If not set correctly, the loader will refuse to use the plugin. If not set correctly, the loader will refuse to use the plugin.
**/ **/
WUMS_MODULE_EXPORT_NAME("inkay"); WUMS_META(export_name, "inkay");
WUMS_MODULE_DESCRIPTION("Pretendo Network Patcher"); WUMS_META(wums, WUMS_VERSION);
WUMS_USE_WUT_MALLOC();
WUMS_USE_WUT_SOCKETS();
WUMS_USE_WUT_NEWLIB();
WUMS___INIT_WRAPPER();
WUMS___FINI_WRAPPER();
WUMS_META(buildtimestamp, __DATE__ " " __TIME__);
extern const char wums_meta_module_name[] WUMS_SECTION("meta");
const char wums_meta_module_name[] = "inkay";
extern const char wums_meta_info_dump[] WUMS_SECTION("meta");
const char wums_meta_info_dump[] = "(module: inkay;" \
"wums " WUMS_VERSION ";" \
"buildtime: " __DATE__ " " __TIME__ ")";
extern const char wums_meta_info_linking_order[] WUMS_SECTION("meta");
const char wums_meta_info_linking_order[] = "Loading module \"inkay\" failed.\n" \
"Function \"wut_get_thread_specific\" returned unexpected value.\n" \
"Please check linking order (expected \"-lwums -lwut\")";
WUMS_MODULE_DESCRIPTION("SPFN Network Patcher");
WUMS_MODULE_VERSION(INKAY_VERSION); WUMS_MODULE_VERSION(INKAY_VERSION);
WUMS_MODULE_AUTHOR("Pretendo contributors"); WUMS_MODULE_AUTHOR("Pretendo contributors and RusticMaple");
WUMS_MODULE_LICENSE("GPLv3"); WUMS_MODULE_LICENSE("GPLv3");
WUMS_DEPENDS_ON(homebrew_functionpatcher); WUMS_DEPENDS_ON(homebrew_functionpatcher);
@ -93,18 +111,18 @@ static bool is555(MCPSystemVersion version) {
return (version.major == 5) && (version.minor == 5) && (version.patch >= 5); return (version.major == 5) && (version.minor == 5) && (version.patch >= 5);
} }
static const char *get_nintendo_network_message() { static const char *get_nintendo_network_message(inkay_language language) {
// TL note: "Nintendo Network" is a proper noun - "Network" is part of the name // TL note: "Nintendo Network" is a proper noun - "Network" is part of the name
// TL note: "Using" instead of "Connected" is deliberate - we don't know if a successful connection exists, we are // TL note: "Using" instead of "Connected" is deliberate - we don't know if a successful connection exists, we are
// only specifying what we'll *attempt* to connect to // only specifying what we'll *attempt* to connect to
return get_config_strings(get_system_language()).using_nintendo_network.data(); return get_config_strings(language).using_nintendo_network.data();
} }
static const char *get_pretendo_message() { static const char *get_pretendo_message(inkay_language language) {
// TL note: "Pretendo Network" is also a proper noun - though "Pretendo" alone can refer to us as a project // TL note: "Pretendo Network" is also a proper noun - though "Pretendo" alone can refer to us as a project
// TL note: "Using" instead of "Connected" is deliberate - we don't know if a successful connection exists, we are // TL note: "Using" instead of "Connected" is deliberate - we don't know if a successful connection exists, we are
// only specifying what we'll *attempt* to connect to // only specifying what we'll *attempt* to connect to
return get_config_strings(get_system_language()).using_pretendo_network.data(); return get_config_strings(language).using_pretendo_network.data();
} }
static void Inkay_SetPluginRunning() { static void Inkay_SetPluginRunning() {
@ -122,10 +140,12 @@ static InkayStatus Inkay_GetStatus() {
} }
} }
static void Inkay_Initialize(bool apply_patches) { static void Inkay_Initialize(bool apply_patches, bool show_startup_toast, inkay_language language) {
if (Config::initialized) if (Config::initialized)
return; return;
Config::show_startup_toast = show_startup_toast;
if (Config::block_initialize) { if (Config::block_initialize) {
ShowNotification("Cannot load Inkay while the system is running. Please restart the console"); ShowNotification("Cannot load Inkay while the system is running. Please restart the console");
return; return;
@ -150,12 +170,16 @@ static void Inkay_Initialize(bool apply_patches) {
DEBUG_FUNCTION_LINE_VERBOSE("Pretendo URL and NoSSL patches applied successfully."); DEBUG_FUNCTION_LINE_VERBOSE("Pretendo URL and NoSSL patches applied successfully.");
ShowNotification(get_pretendo_message()); if (Config::show_startup_toast) {
ShowNotification(get_pretendo_message(language));
}
Config::initialized = true; Config::initialized = true;
} else { } else {
DEBUG_FUNCTION_LINE_VERBOSE("Pretendo URL and NoSSL patches skipped."); DEBUG_FUNCTION_LINE_VERBOSE("Pretendo URL and NoSSL patches skipped.");
ShowNotification(get_nintendo_network_message()); if(Config::show_startup_toast) {
ShowNotification(get_nintendo_network_message(language));
}
Config::initialized = true; Config::initialized = true;
return; return;
} }

View file

@ -46,7 +46,7 @@ constexpr struct olv_allowlist original_entry = {
constexpr struct olv_allowlist new_entry = { constexpr struct olv_allowlist new_entry = {
.scheme = "https", .scheme = "https",
.domain = "." NETWORK_BASEURL, .domain = ".spbr.net",
.path = "", .path = "",
.flags = {1, 1, 1, 1, 1}, .flags = {1, 1, 1, 1, 1},
}; };
@ -77,6 +77,7 @@ const replacement replacements[] = {
}; };
static std::optional<FSFileHandle> rootca_pem_handle{}; static std::optional<FSFileHandle> rootca_pem_handle{};
static std::optional<FSFileHandle> valid_tld_handle{};
std::vector<PatchedFunctionHandle> olv_patches; std::vector<PatchedFunctionHandle> olv_patches;
DECL_FUNCTION(int, FSOpenFile, FSClient *client, FSCmdBlock *block, char *path, const char *mode, uint32_t *handle, DECL_FUNCTION(int, FSOpenFile, FSClient *client, FSCmdBlock *block, char *path, const char *mode, uint32_t *handle,
@ -106,33 +107,74 @@ DECL_FUNCTION(int, FSOpenFile, FSClient *client, FSCmdBlock *block, char *path,
DEBUG_FUNCTION_LINE_VERBOSE("Inkay: Found Miiverse CA, replacing..."); DEBUG_FUNCTION_LINE_VERBOSE("Inkay: Found Miiverse CA, replacing...");
return ret; return ret;
} }
else if (strcmp("vol/content/browser/effective_tld_names.dat", path) == 0)
{
// we patch the TLD because .cafe isnt on the list
int ret = real_FSOpenFile(client, block, path, mode, handle, error);
valid_tld_handle = *handle;
DEBUG_FUNCTION_LINE_VERBOSE("Inkay: Found Miiverse TLD List, patching...");
return ret;
}
return real_FSOpenFile(client, block, path, mode, handle, error); return real_FSOpenFile(client, block, path, mode, handle, error);
} }
DECL_FUNCTION(FSStatus, FSReadFile, FSClient *client, FSCmdBlock *block, uint8_t *buffer, uint32_t size, uint32_t count, DECL_FUNCTION(FSStatus, FSReadFile, FSClient *client, FSCmdBlock *block, uint8_t *buffer, uint32_t size, uint32_t count,
FSFileHandle handle, uint32_t unk1, uint32_t flags) { FSFileHandle handle, uint32_t unk1, uint32_t flags)
if (size != 1) { {
DEBUG_FUNCTION_LINE("Inkay: Miiverse CA replacement failed!"); if (size != 1)
{
DEBUG_FUNCTION_LINE("Inkay: Miiverse CA/LTD replacement failed!");
} }
if (rootca_pem_handle && *rootca_pem_handle == handle) { if (rootca_pem_handle && *rootca_pem_handle == handle)
strlcpy((char *) buffer, (const char *) ca_pem, size * count); {
strlcpy((char *)buffer, (const char *)ca_pem, size * count);
//this can't be done above (in the FSOpenFile hook) since it's not loaded yet. // this can't be done above (in the FSOpenFile hook) since it's not loaded yet.
//the hardcoded offsets suck but they really are at Random Places In The Heap // the hardcoded offsets suck but they really are at Random Places In The Heap
replaceBulk(0x11000000, 0x02000000, replacements); return (FSStatus)count;
return (FSStatus) count; }
else if (valid_tld_handle && *valid_tld_handle == handle)
{
// we patch the tld "aero"...
FSStatus ret = real_FSReadFile(
client, block, buffer, size, count, handle, unk1, flags);
if (ret > 0)
{
uint32_t totalSize = size * count;
char *buf = (char *)buffer;
for (uint32_t i = 0; i + 4 <= totalSize; i++)
{
if (memcmp(&buf[i], "aero", 4) == 0)
{
memcpy(&buf[i], "cafe", 4);
DEBUG_FUNCTION_LINE_VERBOSE(
"Inkay: patched TLD aero -> cafe");
}
}
}
return ret;
} }
return real_FSReadFile(client, block, buffer, size, count, handle, unk1, flags); return real_FSReadFile(client, block, buffer, size, count, handle, unk1, flags);
} }
DECL_FUNCTION(FSStatus, FSCloseFile, FSClient *client, FSCmdBlock *block, FSFileHandle handle, FSErrorFlag errorMask) { DECL_FUNCTION(FSStatus, FSCloseFile, FSClient *client, FSCmdBlock *block, FSFileHandle handle, FSErrorFlag errorMask) {
if (handle == rootca_pem_handle) { if (handle == rootca_pem_handle) {
rootca_pem_handle.reset(); rootca_pem_handle.reset();
} }
if (handle == valid_tld_handle)
{
valid_tld_handle.reset();
}
return real_FSCloseFile(client, block, handle, errorMask); return real_FSCloseFile(client, block, handle, errorMask);
} }

View file

@ -18,9 +18,9 @@
#include "inkay_config.h" #include "inkay_config.h"
constexpr char original_url[] = "discovery.olv.nintendo.net/v1/endpoint"; constexpr char original_url[] = "discovery.olv.nintendo.net/v1/endpoint";
constexpr char new_url[] = "discovery.olv." NETWORK_BASEURL "/v1/endpoint"; constexpr char new_url[] = "discovery.olv.spbr.net/v1/endpoint";
_Static_assert(sizeof(original_url) > sizeof(new_url), _Static_assert(sizeof(original_url) >= sizeof(new_url),
"new_url too long! Must be less than 38chars."); "new_url too long! Must be less than 38chars.");
bool setup_olv_libs(); bool setup_olv_libs();

View file

@ -85,7 +85,6 @@ bool replace_unsigned(U *addr, U original_value, U new_value) {
); );
DCFlushRange(addr, sizeof(new_value)); DCFlushRange(addr, sizeof(new_value));
DEBUG_FUNCTION_LINE_VERBOSE("%08x is now %08x", inst, *inst);
return *addr == new_value; return *addr == new_value;
} }
template bool replace_unsigned<uint64_t>(uint64_t *, uint64_t, uint64_t); template bool replace_unsigned<uint64_t>(uint64_t *, uint64_t, uint64_t);