Giter Site home page Giter Site logo

nost's Introduction

Nokia Service Tool (or No Service Tool)

This is a small hobby project that aims to make the service tool for HMD-Nokia phones, called "OST LA" more useable and user-friendly.

Changes include:

  • Moved the logs folder to the same folder as the application, as opposed to somewhere on the system
  • Includes the neccessary patches to remove the login prompt at the start.
  • The installation options should show relatively reliable now, for me they never show with stock OST
  • Added support for different types of firmware packages, see below for a detailed explanation

NOST is based on an unmodified OST LA 6.0.4. Instead of patching and replacing its executable NOST wraps it with a custom launcher, which allows it to patch the relative methods at runtime.

Custom firmware packages

For some time people who wanted to reflash their phone had to download a firmware bundle, extract and edit it to be able to use it with OST LA 6.0.4, since the newer versions had unpatchable issues that prevented using them. Repacking the images in a format OST expects wasn't possible either since that enabled some sort of signature algorithm on the modified images and caused the flashing to fail.

NOST solves this problem by allowing the use of a different packaging format. Those binaries still need to be extracted but it is done transparently in the background without the user having to download any other tools. The formats that can be used in images are .zip and .qlz

.zip firmwares

.zip firmware files are simply archives of the (edited) files that would normally be extracted from an .nb0 file. This means, if you extract a .nb0 with the extractor found on XDA, the contents of the *_unpacked folder it creates should be the contents of your .zip.

.qlz firmwares

.qlz files are based on QuickLZ compression, which gives them a small size but also a low decompression time. The tool to generate them is called exdupe.

Generating these images is pretty straigtforward. Assuming you are on windows, download the exdupe tool from the link above (or take it from the NOST Tools folder) and copy it into the folder that contains the unpacked .nb0.

- exdupe.exe
- <nb0 name>_unpacked/
    - <nb0 name>.mlf
    - ....

Open a commandline in that folder, and run the following command:

exdupe.exe <name of the folder to compress> <name of the firmware file>.qlz

You should already see how fast it compresses the firmware folder now. As a reference: Compressing the latest Nokia 8 firmware (about 4GB) takes maybe 30 seconds and yields a 2GB file.

Future ideas

So far this project was powered by pure annoyance about the lack of a standard service tool for Nokia Phones, and the requirement for using outdated versions, patched executables, and patched firmware images. I have some more ideas that I would like to implement, like for example a small check that tells you if your bootloader is unlocked to critical, or other small convenience stuff. Larger features are also possible, but harder since everything has to be written as a patch.

License

OST LA 6.0.4 is copyrighted by the respective authors. It is not modified permanently.

The custom NOST code is licensed under the GNU General Public License.

Icon by Freepik © Flaticon

nost's People

Contributors

hikaricalyx avatar stolld avatar titokhan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

nost's Issues

NOST fails to launch on Win11 with NullReferenceException

Today I haved unlocked my Nokia 8 and try to move into the realm of custom roms for it. I found the threads on XDA about loading T-Virus using the NOST. After installing the NOST tool on my windows 11 PC, I get an error message on start-up. If I select continue, the GUI is initialized partly, but the captions in the form and of the buttons are not resolved. Also the statuses displayed are 'ONLINE_STATUS_UNKNOWN' and 'XXX_STATUS_NO_PHONE'.

The full error log:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at MainForms.Form1.DisableOptions()
at MainForms.Form1.Form1_Load(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at MainForms.Form1.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.9157 (WinRelRS6.050727-9100)
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll

NOST
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Program%20Files%20(x86)/NOST/OST/NOST.exe

OnlineUpdateTool
Assembly Version: 6.0.4.0
Win32 Version: 6.0.4
CodeBase: file:///C:/Program%20Files%20(x86)/NOST/OST/OnlineUpdateTool.EXE

System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.9157 (WinRelRS6.050727-9100)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.9157 (WinRelRS6.050727-9100)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll

System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.9157 (WinRelRS6.050727-9100)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

0Harmony
Assembly Version: 1.2.0.1
Win32 Version: 1.2.0.1
CodeBase: file:///C:/Program%20Files%20(x86)/NOST/OST/0Harmony.DLL

System.Core
Assembly Version: 3.5.0.0
Win32 Version: 3.5.30729.9151 built by: WinRelRS6
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Core/3.5.0.0__b77a5c561934e089/System.Core.dll

YamlDotNet
Assembly Version: 5.0.0.0
Win32 Version: 5.2.1.0
CodeBase: file:///C:/Program%20Files%20(x86)/NOST/OST/YamlDotNet.DLL

HarmonySharedState
Assembly Version: 0.0.0.0
Win32 Version: 1.2.0.1
CodeBase: file:///C:/Program%20Files%20(x86)/NOST/OST/0Harmony.dll

System.Web.Services
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.9157 (WinRelRS6.050727-9100)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Web.Services/2.0.0.0__b03f5f7f11d50a3a/System.Web.Services.dll

System.Security
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.9157 (WinRelRS6.050727-9100)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Security/2.0.0.0__b03f5f7f11d50a3a/System.Security.dll

Accessibility
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.9157 (WinRelRS6.050727-9100)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll

System.Configuration
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.9157 (WinRelRS6.050727-9100)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll

System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.9157 (WinRelRS6.050727-9100)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll

System.Web
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.9160 (WinRelRS6.050727-9100)
CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Web/2.0.0.0__b03f5f7f11d50a3a/System.Web.dll

System.Data.SqlXml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.9157 (WinRelRS6.050727-9100)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Data.SqlXml/2.0.0.0__b77a5c561934e089/System.Data.SqlXml.dll

MRG.Controls.UI
Assembly Version: 1.0.4854.21889
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Program%20Files%20(x86)/NOST/OST/MRG.Controls.UI.DLL

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

Issues when data paths contain "space"

Symptoms (tested with NOST 0.4 and 0.5): Upon selecting the image to flash the path to the image field in the tool remains blank and the "Next" button remains disabled. A command prompt windows opens and closes quickly (presumably the command to extract the .qlz file)

Cause: the data path leading to the temporary folder contains a "space". In my particular case the user directory contains 2 words separated by a space (e.g. C:\Users\XXX YYY\AppData\Local\Temp\tmpZZZZ)

Confirmation: Created another user on the same PC, where the new username contained only one word, the application worked as expected without any errors, thus confirming the above.

Log entries (notes: edited out the exact path since it contains my first and last name /// unrelated note: as can be seen on the 2nd log entry the error log point to your exact path to the .cs files, including your name and names of your project files which might cause a privacy concern on your end):

PC #1 :
[14:58:50::814][02484] [ADB]: [Recv] OKAY
[14:58:55::940][02484] [ERROR DESCRIPTION]: Catch exception - Could not find a part of the path 'C:\Users\XXXX XXXXc\AppData\Local\Temp\tmp1B4'. (Form1.btnSelectedFw_Click)
[14:58:55::950][02484] [ERROR DESCRIPTION]: at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.Directory.InternalGetFileDirectoryNames( String path, String userPathOriginal, String searchPattern, Boolean includeFiles, Boolean includeDirs, SearchOption searchOption)
at System.IO.Directory.GetFiles(String path, String searchPattern, SearchOption searchOption)
at System.IO.Directory.GetFiles(String path, String searchPattern)
at NOST.Patches.LoadFwImagePatch.Prefix(String& fwPath, Int64& __result)
at LoadFwImage_Patch1(Object fwPath, String product, Product& )
at PageControl.FwPageSelected.SelectProduct(String initPath, Product& product)
at MainForms.Form1.JudgeProduct(String imagePath, TextBox textBox)
at MainForms.Form1.btnSelectedFw_Click(Object sender, EventArgs e)

PC #2:
[15:58:33::671][13660] [ERROR DESCRIPTION]: at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.Directory.InternalGetFileDirectoryNames( String path, String userPathOriginal, String searchPattern, Boolean includeFiles, Boolean includeDirs, SearchOption searchOption)
at System.IO.Directory.GetFiles(String path, String searchPattern, SearchOption searchOption)
at System.IO.Directory.GetFiles(String path, String searchPattern)
at NOST.Patches.LoadFwImagePatch.Prefix(String& fwPath, Int64& __result) in C:\Users\dorian\Downloads\NOST-master\src\NOST\Patches\LoadFwImagePatch.cs:line 68
at LoadFwImage_Patch1(Object fwPath, String product, Product& )
at PageControl.FwPageSelected.SelectProduct(String initPath, Product& product)
at MainForms.Form1.JudgeProduct(String imagePath, TextBox textBox)
at MainForms.Form1.btnSelectedFw_Click(Object sender, EventArgs e)
[15:58:56::820][13660] [ERROR DESCRIPTION]: Catch exception - Could not find a part of the path 'C:\Users\XXXXX XXXXX\AppData\Local\Temp\tmp7AF'. (Form1.btnSelectedFw_Click)
[15:58:56::835][13660] [ERROR DESCRIPTION]: at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.Directory.InternalGetFileDirectoryNames( String path, String userPathOriginal, String searchPattern, Boolean includeFiles, Boolean includeDirs, SearchOption searchOption)
at System.IO.Directory.GetFiles(String path, String searchPattern, SearchOption searchOption)
at System.IO.Directory.GetFiles(String path, String searchPattern)
at NOST.Patches.LoadFwImagePatch.Prefix(String& fwPath, Int64& __result) in C:\Users\dorian\Downloads\NOST-master\src\NOST\Patches\LoadFwImagePatch.cs:line 68
at LoadFwImage_Patch1(Object fwPath, String product, Product& )
at PageControl.FwPageSelected.SelectProduct(String initPath, Product& product)
at MainForms.Form1.JudgeProduct(String imagePath, TextBox textBox)
at MainForms.Form1.btnSelectedFw_Click(Object sender, EventArgs e)

Note: Already reported the issue in the XDA thread but wanted to post here as well to raise awareness of the issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.