Upgrading to API v2.0 series
Follow the compatibility notes when upgrading your mods to API v2.0 series
When upgrading your modification from the target of the later version of Nitrocid KS that declares itself to be from the API v2.0, you must make necessary changes to be able to use your mod in a Nitrocid KS version which you use to test your mod. These changes will be listed starting from 0.0.20 to the last version in this API revision.
The following changes were listed sequentially as development went on.
From 0.0.18 to 0.0.20
This version was released to make groundbreaking additions and improvements.
v0.0.20.x seriesUnified help system to support every shell
Public Sub TestShowHelp(Optional ByVal command As String = "")
Public Sub SFTPShowHelp(Optional ByVal command As String = "")
Public Sub RDebugShowHelp(ByVal command As String, ByVal DeviceStream As StreamWriter)
Public Sub RSSShowHelp(Optional ByVal command As String = "")
Public Sub IMAPShowHelp(Optional ByVal command As String = "")
Public Sub FTPShowHelp(Optional ByVal command As String = "")
Public Sub ZipShell_GetHelp(Optional ByVal Command As String = "")
Public Sub TextEdit_GetHelp(Optional ByVal Command As String = "")The help system used to provide functions for each shell all showing a help entry for a provided command. They were separated for each shell because they queried commands.
They're now unified to one help function. As a result, all above functions were removed.
Improved naming of injected commands
The kernel argument parser used to host these two variables; the first one was the argument commands input, and the second one was the argument command array. However, the argument parser was re-written, so they were replaced with an array.
The kernel arguments were later removed, leaving only the command-line arguments. We suggest you to cease using this function.
Prefixed the FTP shell variables with "Ftp"
These variables were used by the FTP client, each having their own use.
The
connectedvariable used to be an indicator of when the FTP client was connected or not.The
initializedvariable used to be an indicator of when the FTP client initialized its logging function and other things.The
currDirectvariable used to tell the FTP client where is the local directory.The
currentRemoteDirvariable used to tell the FTP client where is the remote directory.The
uservariable hosted the connected usernameThe private
passwordvariable hosted the password of the usernameThe private
strcmdvariable was used to tell the FTP client what is the command
Each of these variables were given the Ftp prefix.
Relocated Client(S)FTP to their Shell.vb files
Client(S)FTP to their Shell.vb filesThese variables were used to host the FTP and SFTP clients to perform operations related to the client. However, they're moved to their shell code.
Reworked on how to create notifications
The notification system was created to manage notifications. Each notification have their own class outlined in the second line, created by the NotifyCreate() function. Because of a rework, the function was made obsolete and the Notification class was moved to its own file.
Made getting kernel paths more secure
An array, paths, used to store all the kernel paths, but it was implemented insecurely, so we decided to replace it with the GetKernelPath() and GetOtherPath() functions.
Debug now uses the DebugLevel enumerator
DebugLevel enumeratorThe debugging functions used to take a debugging level using characters, but it has been changed to the DebugLevel enumerator to limit the characters which can be used.
Rewritten the command handler
These two functions were implemented separately for FTP and SFTP shells, because at the time of the development, the main shell command executor wasn't ready to support shells other than the main UESH shell.
These threads were used to handle shell execution.
The two command executors mentioned above were removed and the command threads were moved to ShellStartThreads as a result of recent improvements related to the command handler.
Moved platform detection methods to PlatformDetector
These functions were used to detect the platform configuration. For easier access, we've moved these methods to PlatformDetector.
Split ICustomSaver to separate codefile
ICustomSaver to separate codefileThis interface was made to support the custom screensavers. It has been split from the master class to the separate interface that grants easier access.
Renamed variables in public API
These variables were used for different purposes. They've been renamed to the following:
defSaverName->DefSaverNameCSvrdb->CustomSaversfinalSaver->FinalSaverScrnSvrdb->ScreensaverscolorTemplates->ColorTemplatessetRootPasswd->SetRootPasswordRootPasswd->RootPasswordmaintenance->MaintenanceargsOnBoot->ArgsOnBootclsOnLogin->ClearOnLoginshowMOTD->ShowMOTDsimHelp->SimHelpslotProbe->SlotProbeCornerTD->CornerTimeDateinstanceChecked->InstanceCheckedHName->HostNamecurrentLang->CurrentLanguagedbgWriter->DebugWriterdbgStackTraces->DebugStackTracesftpsite->FtpSiteftpexit->FtpExitdbgConns->DebugConnectionssftpsite->SFTPSitesftpexit->SFTPExitDRetries->DownloadRetriesURetries->UploadRetriesmodcmnds->ModCommands
Made some cleanups regarding MOTD parser
The first two stream variables were used by ReadMOTDFromFile and SetMOTD respectively. These variables were removed and the reader function was renamed to ReadMOTD.
Split GetConnectionInfo
GetConnectionInfoThis function used to host both the connection info constructor and the prompt for the SSH client. It has been split to two functions: GetConnectionInfo and PromptConnectionInfo to add the AuthMethods argument in the former function.
Changed how mail listing works
This function used to construct a string containing a list of messages according to the page number. It used StringBuilder to build such a string. However, this has proven to be unreliable, so we decided to change how it works by directly printing the list to the console.
Changed how reading contents API works
This function used to directly print the file contents to the console. As we were trying to refine the API, this function was changed to contain an array of strings containing file lines. This caused PrintContents to be made, printing the contents to the console using ReadContents.
Removed NotifyCreate()
NotifyCreate()This function was used to call the constructor of the Notification class and set the necessary variables to the new instance. It later was found out to be a syntactic sugar, so we removed it as the new constructor came.
Split the theme-related tools from ColorTools
ColorToolsThese theme-related functions were found at the ColorTools module, but they could have been separated from the main topic, so we decided to make an entirely new class dedicated to the theme tools.
As a result, colorTemplates was renamed to Themes and the theme overload for SetColors was renamed to SetColorsTheme.
Implemented help helpers for commands and arguments
The commands used to use the hard-coded extra help to provide additional information about the command usage. However, we needed to make this more extensible, so we decided to implement the help helpers. You need to change how you call the constructor to support the help helpers.
Enumerized the reasons for the three events
These events used to hold the reason string. Since it could be anything, we've decided to make an enumeration out of it based on the error type.
Split the custom screensaver code
The custom screensaver code were located alongside the screensaver management code. They're relocated to the new location based on the type:
CompileCustomandGenSaverfunctions were moved toCustomSaverCompilerThe remaining six functions were moved to
CustomSaverTools
Moved few variables regarding mods
These variables were used to manage your mods. However, the following changes occurred:
All mod definitions, like
ModDefs, were moved toHelpSystem.Scripts dictionary was moved to
ModManagerIScriptwas moved fromModParserto its individual file
Cleaned some flags up
These variables were accidentally exposed to the public API, so we decided to make them internally available so mods can't assign values to them.
Unified the overloads for writing functions
The W() function, their C and C16 siblings, and their sister functions (such as WriteSlowlyC(), etc.) were made to separate the overloads for color level support. However, they've been unified to one master function containing overloads for each color level.
Also, these functions had their one-letter functions changed to Write so that the one-letter function names were no longer confusing, though we had to choose that because the codebase was using Visual Basic that imported the Microsoft.VisualBasic.FileSystem module that contained the Write function. Their documentation are still available below:
These caused many problems to the point that we needed to edit many source files to try to bypass the FileSystem module.
Your mods might break if any of them uses the console writing functions from KS, so change all the W() instances to Write() and remove any "C" or "C16" suffixes.
When writing such functions, you'll discover that the arguments parsing is stricter than the previous, due to how we've implemented the message argument. Make explicit casts to get the same behavior as the previous versions.
Actually removed AliasType
AliasTypeThis enumeration used to host all the shell types, but it was later found out that ShellCommandType came earlier, and it was basically a carbon-copy of the enumeration, so we decided to remove it.
We advice you to cease using this function.
Reworked on the fetch kernel update API
This function used to return a list of kernel updates, but it was later found out that securing it with a class that holds the kernel update information was better, so we changed the return type of the function to KernelUpdate.
Removed the RGB class
This class used to hold the red, green, and blue variables, but it was later found out that the Color class provides the same functionality, so we decided to remove the class.
Increased security of the "scripts" variable
This variable used to store the mod information for each loaded mod. It was found that mods can access this variable and perform illegal operations, so we decided to internalize it.
[G|S]etConfig* functions and subs are now obsolete
[G|S]etConfig* functions and subs are now obsoleteThese functions were exclusively used by the settings applications to set and get the configuration values. They were derivatives of the already existing SetValue, GetValue, and GetPropertyValueInVariable functions with slight changes, so we removed the two above functions to avoid code duplicates.
Made IShell and shell stacks to handle shells
IShell and shell stacks to handle shellsAs part of the shell rewrite, we decided to make IShell and shell stacks to handle the shells. This caused us to remove all InitializeShell() functions shown above to reduce confusion.
Cleaned up GetLine() so strcommand is first
GetLine() so strcommand is firstGetLine() was used to parse the given command input. However, it needed cleanup because ArgsMode was only used for one purpose, and it felt so unnecessary that it shouldn't have been implemented in the first place, so we decided to remove it.
Renamed ShellCommandType to ShellType
ShellCommandType to ShellTypeThis enumeration was used to indicate the shell type to perform the operation related to shell. The enumeration was used for shell purposes other than the commands, so we decided to rename it to ShellType for easier writing.
Moved all the GetLine() functions for all shells to the master GetLine()
GetLine() functions for all shells to the master GetLine()All the GetLine() functions were moved to the master GetLine as it has witnessed functional and cosmetic improvements. It now supports different shells.
Moved GetTerminalEmulator() to ConsoleExtensions
GetTerminalEmulator() to ConsoleExtensionsThis function was used to check the sanity of the terminal emulator for Linux systems. It was later found out that it could have been relocated to ConsoleExtensions for easier calling.
Split the exceptions to separate codefiles
These exceptions used to be hosted on the Exceptions masterclass, but they were separated for easier access.
Renamed new line field to NewLine from vbNewLine
NewLine from vbNewLinevbNewLine sounded like it came from Visual Basic 6.0 (not .NET), a COM-based Windows-only language which we'll never support, and because of the below namespace changes that causes Microsoft.VisualBasic namespace to break things related to vbNewLine, we decided to change it to just NewLine.
Namespaced the entire codebase
To further organize the codebase, we decided to namespace each one of them based on the folders in the source code. This way, we'd have the following namespaces:
KS.ArgumentsKS.Arguments.ArgumentBaseKS.Arguments.CommandLineArgumentsKS.Arguments.KernelArgumentsKS.Arguments.PreBootCommandLineArgumentsKS.ConsoleBaseKS.ConsoleBase.ThemesKS.ConsoleBase.Themes.StudioKS.FilesKS.HardwareKS.KernelKS.Kernel.ExceptionsKS.LanguagesKS.LoginKS.ManPagesKS.MiscKS.Misc.BeautifiersKS.Misc.CalendarKS.Misc.Calendar.EventsKS.Misc.Calendar.RemindersKS.Misc.ConfigurationKS.Misc.EncryptionKS.Misc.ExecutionKS.Misc.ForecastKS.Misc.GamesKS.Misc.JsonShellKS.Misc.JsonShell.CommandsKS.Misc.NotifiersKS.Misc.PlatformKS.Misc.ProbersKS.Misc.ReflectionKS.Misc.ScreensaverKS.Misc.Screensaver.CustomizedKS.Misc.Screensaver.DisplaysKS.Misc.SplashKS.Misc.Splash.SplashesKS.Misc.TextEditKS.Misc.TextEdit.CommandsKS.Misc.ThreadingKS.Misc.TimersKS.Misc.WritersKS.Misc.Writers.ConsoleWritersKS.Misc.Writers.DebugWritersKS.Misc.Writers.FancyWritersKS.Misc.Writers.FancyWriters.ToolsKS.Misc.Writers.MiscWritersKS.Misc.ZipFileKS.Misc.ZipFile.CommandsKS.ModificationsKS.NetworkKS.Network.FTPKS.Network.FTP.CommandsKS.Network.FTP.FilesystemKS.Network.FTP.TransferKS.Network.HTTPKS.Network.HTTP.CommandsKS.Network.MailKS.Network.Mail.CommandsKS.Network.Mail.DirectoryKS.Network.Mail.PGPKS.Network.Mail.TransferKS.Network.RemoteDebugKS.Network.RemoteDebug.CommandsKS.Network.RemoteDebug.InterfaceKS.Network.RPCKS.Network.RSSKS.Network.RSS.CommandsKS.Network.RSS.InstanceKS.Network.SFTPKS.Network.SFTP.CommandsKS.Network.SFTP.FilesystemKS.Network.SFTP.TransferKS.Network.SSHKS.ScriptingKS.Scripting.InteractionKS.ShellKS.Shell.CommandsKS.Shell.ShellBaseKS.Shell.ShellsKS.TestShellKS.TestShell.CommandsKS.TimeDate
Removed built-in string evaluators
The built-in string evaluators were used for the calculator functionality in the kernel, but it was later found out that it was too slow and insecure. We decided to remove these evaluators as a result.
We advice you to cease using this function.
From 0.0.20 to 0.0.21
This version was a minor update to 0.0.20.0.
v0.0.21.x seriesConsolidated the obsolete functions
These obsolete functions were used by the settings app to do the following:
FindSetting(String, Boolean)was used to return the found settings, but the boolean variable indicates if the app is going to use the screensaver settings metadata.SetConfigValueField(String, Object)was used to be a wrapper to theSetValue(String, Object)functionGetConfigValueField(String)was used to be a wrapper to theGetValue(String)functionGetConfigPropertyValueInVariableField(String, String)was used to be a wrapper to theGetPropertyValueInVariable(String, String)function
They're removed as a result of the migration of these functions.
From 0.0.21 to 0.0.22
This version was a great update to the API v2.0 series, because it added Android support to KS!
v0.0.22.x seriesSeparated properties code to PropertyManager
PropertyManagerThese functions were used to get the property values and properties themselves. However, it was found that they're located on FieldManager and we felt that it was a bit misleading, so we decided to move them to their own dedicated class, PropertyManager.
Events and reminders format
Events and reminders file formats have been changed from binary file to XML files as BinarySerializer was being deprecated because of it being vulnerable to attacks as describes in the below documentation link:
Deprecation of IScript.PerformCmd()
IScript.PerformCmd()As we implemented the fully-fledged CommandBase.Execute() function which does the same thing as IScript.PerformCmd(), we've deprecated the function in the interface to take advantage of the CommandBase.Execute() routine.
Removed ReadLineLong()
ReadLineLong()This function was implemented to take advantage of the long input support in the built-in .NET console reader. As ReadLine.Reboot was used, this function has been removed.
From 0.0.22 to 0.0.23
This version was the last version from the API v2.0 series.
v0.0.23.x seriesDeprecation of ICustomSaver
ICustomSaverAs we've implemented BaseScreensaver to better handle screensavers, we decided to deprecate ICustomSaver in favor of the new screensaver model. This would merge all kernel threads of individual screensavers to one master screensaver thread.
Last updated