mirror of
https://github.com/jugeeya/UltimateTrainingModpack.git
synced 2024-11-20 00:46:34 +00:00
Fix compatibility with Arcropolis
This commit is contained in:
parent
db8d961480
commit
196949d499
3 changed files with 30 additions and 12 deletions
2
.devcontainer/devcontainer.json
vendored
2
.devcontainer/devcontainer.json
vendored
|
@ -2,7 +2,7 @@
|
||||||
// https://github.com/microsoft/vscode-dev-containers/tree/v0.140.1/containers/docker-from-docker
|
// https://github.com/microsoft/vscode-dev-containers/tree/v0.140.1/containers/docker-from-docker
|
||||||
{
|
{
|
||||||
"name": "Cargo Skyline",
|
"name": "Cargo Skyline",
|
||||||
"image": "jugeeya/cargo-skyline:3.0.0-dkp-beta",
|
"image": "jugeeya/cargo-skyline:3.2.0",
|
||||||
"mounts": [
|
"mounts": [
|
||||||
"source=ultimatetrainingmodpack-bashhistory,target=/commandhistory,type=volume"
|
"source=ultimatetrainingmodpack-bashhistory,target=/commandhistory,type=volume"
|
||||||
],
|
],
|
||||||
|
|
22
.github/workflows/rust.yml
vendored
22
.github/workflows/rust.yml
vendored
|
@ -10,7 +10,7 @@ on:
|
||||||
jobs:
|
jobs:
|
||||||
clippy_pr:
|
clippy_pr:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: jugeeya/cargo-skyline:3.0.0-dkp-beta
|
container: jugeeya/cargo-skyline:3.2.0
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Setup PATH
|
- name: Setup PATH
|
||||||
|
@ -36,17 +36,25 @@ jobs:
|
||||||
outputs:
|
outputs:
|
||||||
changelog: ${{ steps.build_release.outputs.changelog }}
|
changelog: ${{ steps.build_release.outputs.changelog }}
|
||||||
container:
|
container:
|
||||||
image: jugeeya/cargo-skyline:3.0.0-dkp-beta
|
image: jugeeya/cargo-skyline:3.2.0
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Build release NRO
|
- name: Build release NRO
|
||||||
id: build_release
|
id: build_release
|
||||||
run: |
|
run: |
|
||||||
# Grab changelog
|
# Grab changelog for beta description later
|
||||||
# Grab latest tag, grab log vs. main, replace newlines with two newlines and a list marker
|
# Grab latest tag, grab log vs. main, replace newlines with two newlines and a list marker
|
||||||
git log --pretty=format:%s `git tag --sort=-committerdate | head -1`...main | sed -z 's/\n/\n\n- /g' > changelog.txt
|
changelog="- $(git log --pretty=format:%s `git tag --sort=-committerdate | head -1`...main | sed -z 's/\n/\n\n- /g')"
|
||||||
# Initial list marker
|
# GH actions hate multiline strings. https://trstringer.com/github-actions-multiline-strings/
|
||||||
echo "changelog=- $(cat changelog.txt)" >> $GITHUB_OUTPUT
|
changelog="${changelog//'%'/'%25'}"
|
||||||
|
changelog="${changelog//$'\n'/'%0A'}"
|
||||||
|
changelog="${changelog//$'\r'/'%0D'}"
|
||||||
|
echo "changelog<<EOF" >> $GITHUB_ENV
|
||||||
|
echo "$changelog" >> $GITHUB_ENV
|
||||||
|
echo "EOF" >> $GITHUB_ENV
|
||||||
|
echo "::set-output name=changelog::$changelog"
|
||||||
|
|
||||||
|
# Actually build plugin
|
||||||
PATH=$PATH:/root/.cargo/bin:/opt/devkitpro/devkitA64/bin /root/.cargo/bin/cargo-skyline skyline build --release
|
PATH=$PATH:/root/.cargo/bin:/opt/devkitpro/devkitA64/bin /root/.cargo/bin/cargo-skyline skyline build --release
|
||||||
env:
|
env:
|
||||||
HOME: /root
|
HOME: /root
|
||||||
|
@ -64,7 +72,7 @@ jobs:
|
||||||
if: github.ref == 'refs/heads/main'
|
if: github.ref == 'refs/heads/main'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: jugeeya/cargo-skyline:3.0.0-dkp-beta
|
image: jugeeya/cargo-skyline:3.2.0
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Build outside_training_mode NRO
|
- name: Build outside_training_mode NRO
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use once_cell::sync::OnceCell;
|
use once_cell::sync::OnceCell;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use skyline::libc::c_void;
|
use skyline::libc::c_void;
|
||||||
use skyline::nn::{account, crypto, oe, time};
|
use skyline::nn::{account, oe, time};
|
||||||
use std::convert::TryInto;
|
use std::convert::TryInto;
|
||||||
use std::time::{SystemTime, UNIX_EPOCH};
|
use std::time::{SystemTime, UNIX_EPOCH};
|
||||||
|
|
||||||
|
@ -50,6 +50,16 @@ struct Sha256Hash {
|
||||||
hash: [u8; 0x20],
|
hash: [u8; 0x20],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
#[link_name = "\u{1}_ZN2nn6crypto18GenerateSha256HashEPvmPKvm"]
|
||||||
|
pub fn GenerateSha256Hash(
|
||||||
|
arg1: *mut c_void,
|
||||||
|
arg2: u64,
|
||||||
|
arg3: *const c_void,
|
||||||
|
arg4: u64,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
impl Event {
|
impl Event {
|
||||||
pub fn new() -> Event {
|
pub fn new() -> Event {
|
||||||
let mut device_uuid = Uuid {
|
let mut device_uuid = Uuid {
|
||||||
|
@ -74,7 +84,7 @@ impl Event {
|
||||||
account::GetLastOpenedUser(&mut user_uid);
|
account::GetLastOpenedUser(&mut user_uid);
|
||||||
|
|
||||||
let mut user_id_hash = Sha256Hash { hash: [0; 0x20] };
|
let mut user_id_hash = Sha256Hash { hash: [0; 0x20] };
|
||||||
crypto::GenerateSha256Hash(
|
GenerateSha256Hash(
|
||||||
&mut user_id_hash as *mut _ as *mut c_void,
|
&mut user_id_hash as *mut _ as *mut c_void,
|
||||||
0x20 * 8,
|
0x20 * 8,
|
||||||
user_uid.id.as_ptr() as *const c_void,
|
user_uid.id.as_ptr() as *const c_void,
|
||||||
|
@ -93,7 +103,7 @@ impl Event {
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let mut device_id_hash = Sha256Hash { hash: [0; 0x20] };
|
let mut device_id_hash = Sha256Hash { hash: [0; 0x20] };
|
||||||
crypto::GenerateSha256Hash(
|
GenerateSha256Hash(
|
||||||
&mut device_id_hash as *mut _ as *mut c_void,
|
&mut device_id_hash as *mut _ as *mut c_void,
|
||||||
0x20 * 8,
|
0x20 * 8,
|
||||||
device_uuid.data.as_ptr() as *const c_void,
|
device_uuid.data.as_ptr() as *const c_void,
|
||||||
|
@ -121,7 +131,7 @@ impl Event {
|
||||||
.try_into()
|
.try_into()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
crypto::GenerateSha256Hash(
|
GenerateSha256Hash(
|
||||||
&mut session_id_hash as *mut _ as *mut c_void,
|
&mut session_id_hash as *mut _ as *mut c_void,
|
||||||
0x20 * 8,
|
0x20 * 8,
|
||||||
session_id_bytes.as_ptr() as *const c_void,
|
session_id_bytes.as_ptr() as *const c_void,
|
||||||
|
|
Loading…
Reference in a new issue