MCPcopy
hub / github.com/spicetify/cli / findOfflineBnkDeveloperFlagOffsets

Function findOfflineBnkDeveloperFlagOffsets

src/cmd/devtools.go:17–32  ·  view source on GitHub ↗
(content string)

Source from the content-addressed store, hash-verified

15const offlineBnkDeveloperMarker = "app-developer"
16
17func findOfflineBnkDeveloperFlagOffsets(content string) (int64, int64, error) {
18 firstLocation := strings.Index(content, offlineBnkDeveloperMarker)
19 if firstLocation == -1 {
20 return 0, 0, fmt.Errorf("cannot enable devtools safely: %q marker not found in offline.bnk", offlineBnkDeveloperMarker)
21 }
22
23 secondLocation := strings.LastIndex(content, offlineBnkDeveloperMarker)
24 if secondLocation == -1 {
25 return 0, 0, fmt.Errorf("cannot enable devtools safely: %q marker not found in offline.bnk", offlineBnkDeveloperMarker)
26 }
27
28 firstPatchLocation := int64(firstLocation + 14)
29 secondPatchLocation := int64(secondLocation + 15)
30
31 return firstPatchLocation, secondPatchLocation, nil
32}
33
34// EnableDevTools enables the developer tools in the Spotify client
35func EnableDevTools() {

Callers 1

EnableDevToolsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected