-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix OneSaber crash with customjsondata
- Loading branch information
1 parent
363de39
commit f324211
Showing
10 changed files
with
180 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
param($p1, $p2) | ||
|
||
if ($p1 -and $p2) | ||
{ | ||
& C:\android-ndk-r26b\toolchains\llvm\prebuilt\windows-x86_64\bin\llvm-addr2line.exe -e .\build\debug\$p1 $p2 | ||
} | ||
else | ||
{ | ||
echo give at least 1 argument | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,19 @@ | ||
Param( | ||
[Parameter(Mandatory=$false)] | ||
[String] $logName = "log.log", | ||
|
||
[Parameter(Mandatory=$false)] | ||
[Switch] $help | ||
) | ||
|
||
if ($help -eq $true) { | ||
Write-Output "`"NDK-Stack`" - Processes a tombstone using the debug .so to find file locations" | ||
Write-Output "`n-- Arguments --`n" | ||
|
||
Write-Output "LogName `t`t The file name of the tombstone to process" | ||
|
||
exit | ||
} | ||
|
||
if (Test-Path "./ndkpath.txt") { | ||
if (Test-Path "./ndkpath.txt") | ||
{ | ||
$NDKPath = Get-Content ./ndkpath.txt | ||
} else { | ||
$NDKPath = $ENV:ANDROID_NDK_HOME | ||
} | ||
|
||
|
||
|
||
$stackScript = "$NDKPath/ndk-stack" | ||
if (-not ($PSVersionTable.PSEdition -eq "Core")) { | ||
$stackScript += ".cmd" | ||
} | ||
|
||
Get-Content $logName | & $stackScript -sym ./build/debug/ > "$($logName)_processed.log" | ||
if ($args.Count -eq 0) { | ||
Get-Content ./log.txt | & $stackScript -sym ./build/debug/ > log_unstripped.log | ||
} else { | ||
Get-Content $args[0] | & $stackScript -sym ./build/debug/ > "$($args[0])_unstripped.txt" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
Param( | ||
[Parameter(Mandatory=$false)] | ||
[String] $fileName = "RecentCrash.log", | ||
|
||
[Parameter(Mandatory=$false)] | ||
[Switch] $analyze, | ||
|
||
[Parameter(Mandatory=$false)] | ||
[Switch] $help | ||
) | ||
|
||
if ($help -eq $true) { | ||
Write-Output "`"Pull-Tombstone`" - Finds and pulls the most recent tombstone from your quest, optionally analyzing it with ndk-stack" | ||
Write-Output "`n-- Arguments --`n" | ||
|
||
Write-Output "-FileName `t The name for the output file, defaulting to RecentCrash.log" | ||
Write-Output "-Analyze `t Runs ndk-stack on the file after pulling" | ||
|
||
exit | ||
} | ||
|
||
$global:currentDate = get-date | ||
$global:recentDate = $Null | ||
$global:recentTombstone = $Null | ||
|
||
for ($i = 0; $i -lt 3; $i++) { | ||
$stats = & adb shell stat /sdcard/Android/data/com.beatgames.beatsaber/files/tombstone_0$i | ||
$date = (Select-String -Input $stats -Pattern "(?<=Modify: )\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}(?=.\d{9})").Matches.Value | ||
if([string]::IsNullOrEmpty($date)) { | ||
Write-Output "Failed to pull tombstone, exiting..." | ||
exit 1; | ||
} | ||
$dateObj = [datetime]::ParseExact($date, "yyyy-MM-dd HH:mm:ss", $Null) | ||
$difference = [math]::Round(($currentDate - $dateObj).TotalMinutes) | ||
if ($difference -eq 1) { | ||
Write-Output "Found tombstone_0$i $difference minute ago" | ||
} else { | ||
Write-Output "Found tombstone_0$i $difference minutes ago" | ||
} | ||
if (-not $recentDate -or $recentDate -lt $dateObj) { | ||
$recentDate = $dateObj | ||
$recentTombstone = $i | ||
} | ||
} | ||
|
||
Write-Output "Latest tombstone was tombstone_0$recentTombstone" | ||
|
||
& adb pull /sdcard/Android/data/com.beatgames.beatsaber/files/tombstone_0$recentTombstone $fileName | ||
|
||
if ($analyze) { | ||
& $PSScriptRoot/ndk-stack.ps1 $fileName | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
$mod = "./mod.json" | ||
|
||
if (-not (Test-Path -Path $mod)) { | ||
if (Test-Path -Path ".\mod.template.json") { | ||
& qpm qmod build | ||
if ($LASTEXITCODE -ne 0) { | ||
exit $LASTEXITCODE | ||
} | ||
} | ||
else { | ||
Write-Output "Error: mod.json and mod.template.json were not present" | ||
exit 1 | ||
} | ||
} | ||
|
||
Write-Output "Creating qmod from mod.json" | ||
|
||
$psVersion = $PSVersionTable.PSVersion.Major | ||
if ($psVersion -ge 6) { | ||
$schemaUrl = "https://raw.githubusercontent.com/Lauriethefish/QuestPatcher.QMod/main/QuestPatcher.QMod/Resources/qmod.schema.json" | ||
Invoke-WebRequest $schemaUrl -OutFile ./mod.schema.json | ||
|
||
$schema = "./mod.schema.json" | ||
$modJsonRaw = Get-Content $mod -Raw | ||
$modSchemaRaw = Get-Content $schema -Raw | ||
|
||
Remove-Item $schema | ||
|
||
Write-Output "Validating mod.json..." | ||
if (-not ($modJsonRaw | Test-Json -Schema $modSchemaRaw)) { | ||
Write-Output "Error: mod.json is not valid" | ||
exit 1 | ||
} | ||
} | ||
else { | ||
Write-Output "Could not validate mod.json with schema: powershell version was too low (< 6)" | ||
} | ||
exit |