1
0
Fork 0
mirror of https://github.com/jugeeya/UltimateTrainingModpack.git synced 2024-11-24 02:44:17 +00:00

Fix compatibility with Arcropolis

This commit is contained in:
jugeeya 2022-11-11 16:07:48 -08:00
parent db8d961480
commit 196949d499
3 changed files with 30 additions and 12 deletions

View file

@ -2,7 +2,7 @@
// https://github.com/microsoft/vscode-dev-containers/tree/v0.140.1/containers/docker-from-docker
{
"name": "Cargo Skyline",
"image": "jugeeya/cargo-skyline:3.0.0-dkp-beta",
"image": "jugeeya/cargo-skyline:3.2.0",
"mounts": [
"source=ultimatetrainingmodpack-bashhistory,target=/commandhistory,type=volume"
],

View file

@ -10,7 +10,7 @@ on:
jobs:
clippy_pr:
runs-on: ubuntu-latest
container: jugeeya/cargo-skyline:3.0.0-dkp-beta
container: jugeeya/cargo-skyline:3.2.0
steps:
- uses: actions/checkout@v2
- name: Setup PATH
@ -36,17 +36,25 @@ jobs:
outputs:
changelog: ${{ steps.build_release.outputs.changelog }}
container:
image: jugeeya/cargo-skyline:3.0.0-dkp-beta
image: jugeeya/cargo-skyline:3.2.0
steps:
- uses: actions/checkout@v2
- name: Build release NRO
id: build_release
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
git log --pretty=format:%s `git tag --sort=-committerdate | head -1`...main | sed -z 's/\n/\n\n- /g' > changelog.txt
# Initial list marker
echo "changelog=- $(cat changelog.txt)" >> $GITHUB_OUTPUT
changelog="- $(git log --pretty=format:%s `git tag --sort=-committerdate | head -1`...main | sed -z 's/\n/\n\n- /g')"
# GH actions hate multiline strings. https://trstringer.com/github-actions-multiline-strings/
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
env:
HOME: /root
@ -64,7 +72,7 @@ jobs:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
container:
image: jugeeya/cargo-skyline:3.0.0-dkp-beta
image: jugeeya/cargo-skyline:3.2.0
steps:
- uses: actions/checkout@v2
- name: Build outside_training_mode NRO

View file

@ -1,7 +1,7 @@
use once_cell::sync::OnceCell;
use serde::{Deserialize, Serialize};
use skyline::libc::c_void;
use skyline::nn::{account, crypto, oe, time};
use skyline::nn::{account, oe, time};
use std::convert::TryInto;
use std::time::{SystemTime, UNIX_EPOCH};
@ -50,6 +50,16 @@ struct Sha256Hash {
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 {
pub fn new() -> Event {
let mut device_uuid = Uuid {
@ -74,7 +84,7 @@ impl Event {
account::GetLastOpenedUser(&mut user_uid);
let mut user_id_hash = Sha256Hash { hash: [0; 0x20] };
crypto::GenerateSha256Hash(
GenerateSha256Hash(
&mut user_id_hash as *mut _ as *mut c_void,
0x20 * 8,
user_uid.id.as_ptr() as *const c_void,
@ -93,7 +103,7 @@ impl Event {
.unwrap();
let mut device_id_hash = Sha256Hash { hash: [0; 0x20] };
crypto::GenerateSha256Hash(
GenerateSha256Hash(
&mut device_id_hash as *mut _ as *mut c_void,
0x20 * 8,
device_uuid.data.as_ptr() as *const c_void,
@ -121,7 +131,7 @@ impl Event {
.try_into()
.unwrap();
crypto::GenerateSha256Hash(
GenerateSha256Hash(
&mut session_id_hash as *mut _ as *mut c_void,
0x20 * 8,
session_id_bytes.as_ptr() as *const c_void,