Nokia 6300 4G (nokia-leo) | |
---|---|
Released | 13 November 2020 |
Model | TA-1286, TA-1287, TA-1291, TA-1294, TA-1307, TA-1324 |
Specifications | |
SoC | Qualcomm MSM8909 Snapdragon 210 (4 x 1.1GHz Cortex-A7) |
RAM | 512MB LPDDR2/3 |
GPU | Adreno 304 |
Storage | 4GB eMMC 4.5 (+ up to 32GB microSDHC card) |
Network | 2G GSM, 3G UMTS, 4G LTE Cat4 150/50Mbps + EU (except East Ukraine, Azerbaijan, Georgia), APAC: band 1, 3, 5, 7, 8, 20 + MENA, CN, Nigeria, Tanzania: band 1, 3, 5, 7, 8, 20, 28, 38, 39, 40, 41 + US: band 2, 4, 5, 12, 17, 66, 71 + LATAM: band 2, 3, 4, 5, 7, 28 + ROW: band 1, 3, 5, 7, 8, 20, 38, 40 VoLTE & VoWiFi support Single or Dual SIM (Nano-SIM, dual-standby) |
Screen | 320 x 240 @ 167 PPI 2.4 inches QVGA TFT LCD, 16M colors |
Bluetooth | 4.0, A2DP, LE |
Wi-Fi | 802.11b/g/n, 2.4GHz, Hotspot |
Peripherals | GPS & GLONASS |
Cameras | Rear: VGA, LED flash |
Dimensions (HWD) | 131.4 * 53 * 13.7 (mm) 5.17 * 2.09 * 0.54 (in) |
Weight | 107.4 g (3.70 oz) |
Ports | - microUSB charging & USB 2.0 data transferring port - 3.5mm headphone jack |
Battery | Removable Li-Ion 1500mAh (BL-4XL), 5W wired charging (up to 25 days of 4G standby advertised) |
KaiOS info | |
Version | KaiOS 2.5.4 |
WA VoIP | Supported |
Build no. | 10.00.17.01, 12.00.17.01, 20.00.17.01, 30.00.17.01 |
Table of Contents
A lot of fake KaiOS phones, like the Nokia 8110 4G, 2720 Flip and 6300 4G are sold at many tech shops and online platforms for amazingly cheap prices; these are not the real ones, and if you were to buy them you wouldn’t be able to get a refund.
Some signs that can indicate a fake KaiOS phone are:
Remember, only buy from trusted, reputable sources, even if they charge more. That extra bit of price usually guarantees that you’re getting a real device.
“Buying Western-customized products will always give you the best quality possible” is unwise when it comes to consumer electronics, including mobile phones, and the 6300 4G is no exception. When buying the TA-1324 variant of this phone, you should expect:
Don’t buy the US variant of 6300 4G unless you know what you’re doing. Seek the availability of the phone in the closest place or nearby countries to where you are.
ssp.kaiads.com
in your Wi-Fi routers’ blacklist or the system’s hosts
file. Be aware that this might prevent you from installing apps from KaiStore like WhatsApp.callrecording.mode
and set it to either on
(press D-Pad Left to record), auto
or off
.
keyboard.gaiamobile.org
. BananaHackers’ guide on fixing the keypad speed may helpsms.gaiamobile.org
and clock.gaiamobile.org
from /system/b2g/webapps
, extract, edit the audio files and repackage the apps, then push them back under /data/local/webapps
and edit the basePath
in /data/local/webapps/webapps.json
to reflect the change (see BananaHackers’ guide for instructions)launcher.gaiamobile.org
.Tip: You can save these codes as contacts for quick dialing later. When the phone suggests a saved code, you’ll have to press Call to activate the code’s function.
*#*#33284#*#*
: Toggle debugging mode, allowing the phone to be accessed with ADB and DevTools. A bug icon will appear in the status bar letting you know debugging mode is on. This can also be turned on under Settings, Device, Developer, Debugger, ADB and DevTools.*#06#
: Display the hidden International Mobile Equipment Identity numbers or IMEI(s) to uniquely identify a specific cell phone on GSM networks. Do not show them to anyone else: they’re crucial for calling functions on the phone.*#0606#
(TA-1324 only): Display the Mobile Equipment Identifier numbers or MEID(s) to uniquely identify a specific cell phone on CDMA networks. On international variants the MEIDs would be all zeroes, and thus this secret code doesn’t apply.*#0000#
: Display device information, such as firmware version, build date, model number, variant and CUID.*#33#
(call): Check the Call barring service status from carrier for blocking or whitelisting calls, whether incoming or outgoing, domestic or international. Requires a 4-digit passcode to use. To toggle, go to Settings, Network & Connectivity, Calling, Call barring.*#43#
(call): Check the Call waiting service status from carrier. To toggle, go to Settings, Network & Connectivity, Calling, Call waiting.*#*#372733#*#*
: Open KaiOS MMI Test, an internal tool to test hardware performance of a KaiOS device through an automatic routine or manually by hand, including LCD backlight, T9 keyboard, camera, LED flash, RTC, speaker, microphone, vibrator, 3.5mm audio jack, SIM trays, Wi-Fi, Bluetooth, NFC, microSD and microUSB slots etc.
Most of these codes requires userdebug
or eng
versions to work.
*#07#
: Check the ro.sar.enabled
property, if enabled check the current SAR level and display SAR-related health and safety information.*#1219#
: Clear all userspace customizations, presumably for store display.*#091#
(on)/*#092#
(off): Toggle auto-answering on incoming call. This can be turned on via Device Settings interface in WebIDE.*#2886#
: Should also open KaiOS MMI Test interface.*#8378269#
/*#*#2637643#*#*
: Open Testbox engineering menu with predecessor Firefox OS design, usually used by OEMs to test various hardware of the phone. This menu can be manually opened using Luxferre’s CrossTweak.###2324#
: Open a menu, allowing to toggle Qualcomm diagnostic mode for fixing null/invalid IMEI or baseband via QPST.*#*#212018#*#*
: Toggle privileged access (including rooted ADB shell) to the phone.*#7223#
: Display internal firmware build and boot image versions.*#*#0574#*#*
: Open LogManager utility which allows you to fully enable ADB and DevTools on Spreadtrum devices.*#573564#
: Open T2M Log (jrdlog), a brief LogManager interface.*#1314#
: Switch the auto.send.crash.sms
property, whose purpose is still unknown.adb reboot recovery
when connected to a computer. Allows you to factory reset the device by wiping /data and /cache, view boot and kernel logs, and install patches from adb sideload
interface or SD card.fastboot
interface.adb reboot edl
when connected to a computer. Boots into a black screen, allows you to read and write partitions in low-level with proprietary Qualcomm tools. Remove the battery to exit.Qualcomm Emergency Download mode, commonly known as EDL mode, is a special engineering interface implemented on devices with Qualcomm chipsets. It lets you do special operations on the phone that only the device manufacturer can do, such as unlocking the bootloader, read and write firmwares on the phone’s filesystem or recover from being a dead paperweight. Unlike bootloader or Fastboot mode, system files needed by the EDL mode resides on a separate ‘primary bootloader’ that aren’t affected by software modifications.
Aleph Security has a deep-dive blog post into exploiting the nature of EDL mode on Qualcomm-chipset devices that you can read here.
Booting into this mode, the phone’s screen will briefly show the ‘enabled by KaiOS’ logo, then turn almost black as if it’s off, but in fact it’s still listening to commands over Qualcomm’s proprietary protocol called Sahara (or Firehose on newer devices). With a suitable digitally-signed programmer in MBN/ELF file format and some instruction-bundled tools, the most popular one being QFIL (Qualcomm Flash Image Loader), one can send commands from a computer to the phone over USB.
You can also force reboot the phone by holding the top Power button and the # key at any time.
EDL programmer for the international version of this phone (not TA-1324) can be found on BananaHackers’ EDL archive site with hardware ID 0x009600e100420029 (a copy is available here). The US version of this phone has been signed with a different PK_HASH and needs a different firehose loader which we currently don’t have in archive.
As discovered by atipls on Discord, on the mainboard of the 6300 4G, there are 3 UART testing points: RX, TX and GND just above the SIM2 slot. Shorting TX and GND takes you to Fastboot and Linux terminal interface.
BananaHackers’ definitions put this phone and most other KaiOS 2.5.4 devices in the first category, which means that you can install and debug apps from outside sources, but with a few caveats: apps with ‘forbidden’ permissions, such as embed-apps
, embed-widgets
and engmode-extension
cannot be sideloaded, and you cannot debug apps that came with the device using WebIDE’s Developer Tools (you can, however, see the system’s global warnings and errors with adb logcat
).
For detailed instructions, see Sideloading and debugging/WebIDE.
Do note that OmniSD, one of the methods used for on-device sideloading, and many Gerda-related apps requires the navigator.mozApps.mgmt.import
API that has been removed from KaiOS 2.5.2.2, and therefore no longer work on this phone. However, the Privileged factory reset feature that could be used on KaiOS 2.5.2 and older can now be activated after permanent rooting to gain privileged userspace session (see Next steps).
To remove unwanted apps from the phone, you can use this fork of Luxferre’s AppBuster which lets you disable any apps you don’t need and enable them again if you want.
On KaiOS 2.5.4 devices, such as the 6300 4G and 8000 4G, ADB and WebIDE can be used to install most third-party apps. However, apps with special ‘forbidden’ permissions are not allowed, including most BananaHackers apps with engmode-extension
like Wallace Toolbox, which can be used to gain exclusive access of the phone. You also cannot make changes to the system. On the 2720 Flip and 800 Tough with KaiOS 2.5.2.2, with HMD/Nokia Mobile changing their release branches from dev-keys
to release-keys
, the situation is even worse as you cannot sideload at all.
This is because in order for WhatsApp’s VoIP feature to work on these KaiOS versions, a security module called SELinux is now set to be Enforced
which checks and reverts system modifications on boot. To get total read-write access to the devices, you’ll now have to permanently root them by setting SELinux to Permissive
mode.
The guide below is based on the main guide from BananaHackers website, but has been rewritten to make it easier to follow. The process will take somewhat considerable 30 minutes to an hour, so do this when you have enough time.
[!IMPORTANT] DISCLAIMER: This process will void your phone’s warranty, disable its ability to receive WhatsApp calls and over-the-air updates, but you can undo this if you save a copy of the original boot partition. However, you might also brick your phone if you make a mistake in the process, so proceed at your own risk and with caution! I won’t be responsible for any damages done to your phone by following these.
Remember, you don’t have to root your phone to do things that usually need root access e.g. you can use this fork of Luxferre’s AppBuster to disable apps from the launcher instead of deleting them with Wallace Toolbox. You can also install CrossTweak, a Wallace Toolbox alternative also made by Luxferre that does not need
engmode-extension
and therefore can be easily installed on KaiOS 2.5.4 devices.
andybalholm’s EDL cannot be used on 8000 4G and 6300 4G due to some structural changes within the GPT partition table, which will result in an error AttributeError: 'gpt' object has no attribute 'partentries'. Did you mean: 'num_part_entries'?
. Do note that the command structures used between bkerler’s and andybalholm’s are different, which we’ll mention below.
We’ll be using open-sourced Python scripts from GitHub for the sake of cross-platform usage (and my obsession of open-source tools), instead of QFIL which is proprietary and only supports Windows.
pip
installed for the EDL tools to work (Windows: both are packaged on Python’s official website)libusb-win32
driver@cyan-2048 confirmed to me that Zadig 2.5 bundled within the EDL package doesn’t work, so DO NOT USE that. I’ve also specifically chosen version 2.7 as it works best throughout my testing, and the latest 2.8 version of Zadig tool also has troubles detecting the phone’s EDL driver.
libusb
and configure the environment for EDL tools (setup guide with Homebrew can be found below)If you’re on Linux, Python and ADB can be quickly set up by installing with your built-in package manager. We won’t be covering this here, as each Linux distro has its own way of installing from package manager.
wsl --install
)For the sake of simplicity, the guide assumes you’ve moved the Gerda Recovery image and the MBN loader file into the root of EDL tools folder, which you should do for convenience. If you’d like to have those in other folders, change the directory path accordingly.
This portion of the guide was taken from Development/EDL tools on BananaHackers Wiki so that you don’t have to switch tabs. Kudos to Cyan for the guides!
sudo apt-get install python pip3
sudo -H pip3 install pyusb pyserial capstone keystone-engine docopt
*#*#33284#*#*
, connect it to your computer and type adb reboot edl
in a command-line window.*
and #
at the same time while inserting the USB cable to the phone.In both cases, the phone’s screen should blink with a ‘enabled by KaiOS’ logo then become blank. This is normal behaviour letting you know you’re in EDL mode and you can proceed.
Additionally, if you have issue with device access:
/etc/modprobe.d/blacklist.conf
in a text editor and append blacklist qcserial
.51-edl.rules
and 50-android.rules
in the root of extracted EDL tools folder to /etc/udev/rules.d
.Follow the instructions to install Homebrew on its homepage. Basically just open Terminal and copy the long streak of code shown on the page, and type your password when prompted.
brew install python android-platform-tools libusb && pip3 install pyusb pyserial capstone keystone-engine docopt
*#*#33284#*#*
, connect it to your computer and type adb reboot edl
in a command-line window.*
and #
at the same time while inserting the USB cable to the phone.In both cases, the phone’s screen should blink with a ‘enabled by KaiOS’ logo then become blank. This is normal behaviour letting you know you’re in EDL mode and you can proceed.
Head over to Python’s official download page for Windows and download the correct installer for your architecture, or download the latest version of Python from Microsoft Store. If you’re downloading from Microsoft Store, skip to step 4.
Proceed with installing Python as usual. If you choose to customize your installation, include pip
. Don’t forget to tick the box next to “Add Python to PATH” to add Python as a global environment variable, otherwise you’ll have a hard time using Python to run scripts later on.
python
or python3
within Command Prompt/Windows Terminal will run the Microsoft Store version of Python. To override this default into running the locally installed version, head over to Settings, Apps, Apps & features, App execution aliases and toggle off both App Installer (python.exe) and App Installer (python3.exe).
pip3 install pyusb pyserial capstone keystone-engine docopt
Qualcomm_Diag_QD_Loader_2016_driver.exe
with administrator rights. Proceed with installation and leave everything as default, restart the computer if it prompts you to do so.*#*#33284#*#*
, connect it to your computer and type adb reboot edl
in a command-line window.*
and #
at the same time while inserting the USB cable to the phone.In both cases, the phone’s screen should blink with a ‘enabled by KaiOS’ logo then become blank. This is normal behaviour letting you know you’re in EDL mode and you can proceed.
QHSUSB__BULK
(your device in EDL mode) in the main dropdown menu. In the target driver box—to which the green arrow is pointing—click the up/down arrows until you see libusb-win32
and then click Replace Driver.
If driver configuration takes too much time and Zadig aborts the process, kill Zadig with Task Manager, exit and re-enter EDL mode on the phone, then try to install again.
Beware: due to the firehose loader being malfunctioned, the EDL tool only accepts one command each session, after which you’ll have to disconnect the phone and restart the phone in EDL mode. If you try to throw a second command, it’ll result in a
bytearray index out of range
error.
Turn on the phone in EDL mode.
python edl.py w recovery recovery-8110.img --loader=8k.mbn
If the progress bar stops at 99% (and not earlier) and you get error 'usb.core.USBError: [Errno None] b'libusb0-dll:err [_usb_reap_async] timeout error\n'
or usb.core.USBError: [Errno 60] Command timed out
, this is false. Don’t mind the error and proceed with the next step.
When finished, disconnect the phone from your computer and exit EDL mode by removing and re-inserting the battery.
*
to turn on the phone in recovery mode. Connect the phone to your computer again.[!WARNING] Be careful not to boot into system at this point! As stated above, while SELinux is still in
Enforced
mode, it’ll try to revert all system modifications on startup, in this case, the custom recovery image we’ve just flashed will be overwritten by the stock one. If you accidentally start into normal mode (with the usual Nokia chime), you’ll have to start over from step 1.
Don’t worry if this boots into a white screen: this is because the display driver for the Nokia 8110 4G included in the recovery image are not compatible with the display of 8000 4G/6300 4G.
Check if ADB can recognise the phone by typing adb devices
into the command-line.
platform-tools
folder (if needed) and pull the boot image from the phone with ADB by typing:
adb pull /dev/block/bootdevice/by-name/boot boot.img
You should now see /dev/block/bootdevice/by-name/boot: 1 file pulled, 0 skipped.
and have a copy of the boot partition with the size of 32.0MB (32,768KB). Fetched boot image will be saved to the current directory.
adb reboot
into the command-line, or remove and re-insert the battery. Our custom Gerda Recovery partition will now be overwritten by the default one.You can disconnect the phone from your computer for now.
Unlike the 6300 4G and 8000 4G, our phones’ EDL loader properly works with both reading and writing, so the steps are more straightforward.
*#*#33284#*#*
, connect it to your computer and type adb reboot edl
in a command-line window.In both cases, the phone’s screen should blink with a ‘Powered by KaiOS’ logo then become blank. This is normal behaviour letting you know you’re in EDL mode and you can proceed.
python edl.py -r boot boot.img -loader 2720.mbn
python edl.py -r boot boot.img -loader 800t.mbn
python edl.py -reset -loader 2720.mbn
python edl.py -reset -loader 800t.mbn
You can disconnect the phone from your computer for now.
[!WARNING] Copy and keep the original boot partition somewhere safe in case you need to restore to the original state for over-the-air updates or re-enabling WhatsApp calls.
8k-boot-patcher
git clone https://gitlab.com/suborg/8k-boot-patcher.git && cd 8k-boot-patcher && docker build -t 8kbootpatcher .
boot.img
file we’ve just pulled from our phone to the desktop and do not change its name. Type this into the command-line to run the modifying process:
docker run --rm -it -v ~/Desktop:/image 8kbootpatcher
That’s it! On your desktop there will be two new image files, the modified boot.img
and the original boot-orig.img
. You can now head to part 4.
unpackimg boot.img
. This will split the image file and unpack the ramdisk to their subdirectories.[!WARNING] Be sure to edit the files correctly, else the phone won’t boot!
ramdisk/default.prop
using Notepad++ and change:
ro.secure=1
-> ro.secure=0
security.perf_harden=1
-> security.perf_harden=0
ro.debuggable=0
-> ro.debuggable=1
ramdisk/init.qcom.early_boot.sh
in Notepad++ and add setenforce 0
as a new line at the end of the file.split_img/boot.img-cmdline
in Notepad++. Without adding a new line, scroll to the end of the first line and append androidboot.selinux=permissive enforcing=0
.ramdisk/init.rc
(NOT ramdisk/init
) and delete line 393 setprop selinux.reload_policy 1
or mark a comment as shown. This will ultimately prevent SELinux from overwriting the policy changes we made above.ramdisk/init.rc
file, after line 420, make a new line and add:
write /sys/module/lowmemorykiller/parameters/enable_lmk 0
Indent the new line to match up with other lines as shown.
repackimg
to package our modified boot partition.If you happen to encounter an error during the signing process, that’s likely because the process uses java
to power the boot-signer.jar
sequence and you don’t have it installed. The image will still be packaged and ready for flashing, but if you’re a perfectionist, you can install JRE and try again.
If the newly packaged image is barely over 1/3 the size of the original image, it’s a normal behaviour and you can proceed.
Turn on your phone in EDL mode and connect it to your computer.
boot.img
, unsigned-new.img
or image-new.img
to the EDL tools folder and open a command-line window within it. From here type either of these commands depending on which image file you have:
python edl.py w boot boot.img --loader=8k.mbn
python edl.py w boot unsigned-new.img --loader=8k.mbn
python edl.py w boot image-new.img --loader=8k.mbn
For Nokia 2720 Flip and Nokia 800 Tough with andybalholm’s EDL:
python edl.py -w boot boot.img -loader 2720.mbn
python edl.py -w boot boot.img -loader 800t.mbn
Again, if the progress bar stops at 99% and you get a timeout error, this is because the phone doesn’t send any indicator information back to the EDL tool when in fact the image has been successfully written. Don’t mind the error and go on with the next step.
python edl.py reset
. And we’re done!If you still have the original boot partition and wish to revert all the messes and damages, connect the phone to your computer in EDL mode, move the image file to the EDL tools folder, open a command-line window within it and type these one-line at a time:
python edl.py w boot boot.img --loader=8k.mbn
python edl.py reset
devTools.apps.forbiddenPermissions
, clear its value, then either restart the phone or hold the top Power button and choose Memory Cleaner > Deep Clean Memory to restart B2G.echo -n 1 > /data/enforce
mount -o bind /data/enforce /sys/fs/selinux/enforce
HMD Global/Nokia Mobile has published the device’s source code for its Linux 4.9 kernel, B2G and certain third-party libraries used in this phone, which can be downloaded directly from here.
Note that the source code released does not contain proprietary parts from other parties like Qualcomm.