| 15 | const offlineBnkDeveloperMarker = "app-developer" |
| 16 | |
| 17 | func 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 |
| 35 | func EnableDevTools() { |