KnShim is a library that can be added to Smash Hit which provides more advanced features for mods. Notably, this includes a custom registry and database as well as cheats which are helpful while developing your mod.
Made by Knot126
Shatter OSS comes with a built-in installer for KnShim. Open the APK you want to install KnShim to in APK Editor Studio, then go to Shatter → Tools → Install KnShim and select the path to the APK you want to install KnShim to.
Do note that there are a few known problems with the shim as of release 12:
It won't work on some Android emulators or x86-based devices which don't emulate ARM apps properly
It is (very rarely) falsely detected as a virus by some anti-viruses
The registry provides a way of storing values between scripts, and works very similarly to mgGet and mgSet. Unlike them, it supports custom properties, which provides a lot of flexibility to your mod:
knRegSet("playerName", "mule")
knRegSet("points", 0) -- Note: Numbers will be converted to strings
-- ... later on ...
mgSetText(nameText, "Hello, " .. knRegGet("playerName") .. "!")
mgSetText(pointsText, "You have " .. knRegGet("points") .. " points.")
The database is essentially the same as the registry, except that values are saved between restarts of Smash Hit, making it more useful for storing things like player high scores.
KnShim makes it easier to add debug cheats to your mod. You can use knSetNoclip to disable loosing balls when crashing, and use knSetBalls and knSetStreak to add more balls cheats or force the player's death.
knSetNoclip(true) -- enables noclip
knSetBalls(69) -- set the number of balls the player has
knSetStreak(37) -- set to four-ball multiball and 3 crystals away from five-ball multiball
KnShim adds a few different ways of making HTTP requests to Smash Hit mods. The simplest are just wrappers for functions built-in to the game, and these are knDownloadFile and knHttpPost.
knDownloadFile will download a file to internal storage
knDownloadFile("http://myserver.com/custom.zip", "custom.zip")
knHttpPost will POST data to a server
knHttpPost("http://myserver.com/leaderboard/submitScore", "highscore=" .. knRegGet("highscore"))
Note that these functions are blocking, and will freeze the game while attempting the request.
The full documentation for KnShim can be accessed on Miraheze: