mirror of
https://github.com/safing/portbase
synced 2026-04-28 20:00:33 +00:00
Add android specific debug info
This commit is contained in:
parent
0d13bca496
commit
5a9e76403d
5 changed files with 75 additions and 39 deletions
29
utils/debug/debug_android.go
Normal file
29
utils/debug/debug_android.go
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
package debug
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/safing/portmaster-android/go/app_interface"
|
||||
)
|
||||
|
||||
// AddPlatformInfo adds OS and platform information.
|
||||
func (di *Info) AddPlatformInfo(_ context.Context) {
|
||||
// Get information from the system.
|
||||
info, err := app_interface.GetPlatformInfo()
|
||||
if err != nil {
|
||||
di.AddSection(
|
||||
"Platform Information",
|
||||
NoFlags,
|
||||
fmt.Sprintf("Failed to get: %s", err),
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
// Add section.
|
||||
di.AddSection(
|
||||
fmt.Sprintf("Platform: Android %s", info.VersionCode),
|
||||
UseCodeSection|AddContentLineBreaks,
|
||||
fmt.Sprintf("SDK: %d %s", info.SDK, info.Incremental),
|
||||
fmt.Sprintf("Device: %s %s (%s)", info.Manufacturer, info.Brand, info.Board))
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue