Skip to content

Commit

Permalink
Update scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-r-elp committed Jul 6, 2024
1 parent 3526381 commit 6c5f1f5
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 11 deletions.
25 changes: 23 additions & 2 deletions copy.ps1
Original file line number Diff line number Diff line change
@@ -1,10 +1,31 @@
Param (
[Parameter(Mandatory=$false, HelpMessage="Switch to create a clean compilation")][Alias("rebuild")][Switch]$clean,
[Parameter(Mandatory=$false, HelpMessage="Switch to build and copy only")][Alias("copyOnly")][Switch]$NoStart
[Parameter(Mandatory=$false, HelpMessage="Switch to build and copy only")][Alias("copyOnly")][Switch]$NoStart,
[Parameter(Mandatory=$false)]
[Switch] $useDebug
)
& $PSScriptRoot/build.ps1 -debugbuild -clean:$clean
if ($?) {
adb push build/libMultiplayerCore.so /sdcard/Android/data/com.beatgames.beatsaber/files/mods/libMultiplayerCore.so

qpm qmod manifest
$modJson = Get-Content "./mod.json" -Raw | ConvertFrom-Json

foreach ($fileName in $modJson.modFiles) {
if ($useDebug -eq $true) {
& adb push build/debug/$fileName /sdcard/ModData/com.beatgames.beatsaber/Modloader/early_mods/$fileName
} else {
& adb push build/$fileName /sdcard/ModData/com.beatgames.beatsaber/Modloader/early_mods/$fileName
}
}

foreach ($fileName in $modJson.lateModFiles) {
if ($useDebug -eq $true) {
& adb push build/debug/$fileName /sdcard/ModData/com.beatgames.beatsaber/Modloader/mods/$fileName
} else {
& adb push build/$fileName /sdcard/ModData/com.beatgames.beatsaber/Modloader/mods/$fileName
}
}

if ($? -and -not $NoStart) {
adb shell am force-stop com.beatgames.beatsaber
adb shell am start com.beatgames.beatsaber/com.unity3d.player.UnityPlayerActivity
Expand Down
32 changes: 23 additions & 9 deletions ndk-stack.ps1
Original file line number Diff line number Diff line change
@@ -1,15 +1,29 @@
$NDKPath = $env:NdkPath
# if ($NDKPath -eq "") {
$NDKPath = Get-Content $PSScriptRoot/ndkpath.txt
# }
Param(
[Parameter(Mandatory=$false)]
[String] $logName = "RecentCrash.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") {
$NDKPath = Get-Content ./ndkpath.txt
} else {
$NDKPath = $ENV:ANDROID_NDK_HOME
}

$stackScript = "$NDKPath/ndk-stack"
if (-not ($PSVersionTable.PSEdition -eq "Core")) {
$stackScript += ".cmd"
}

if ($args.Count -eq 0) {
Get-Content ./log.txt | & $stackScript -sym ./build/ > log_unstripped.log
} else {
Get-Content $args[0] | & $stackScript -sym ./build/ > "$($args[0])_unstripped.txt"
}
Get-Content $logName | & $stackScript -sym ./build/debug/ > "$($logName)_processed.log"

0 comments on commit 6c5f1f5

Please sign in to comment.