<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>BananaHackers blog Reader</title>
    <link>https://blog.bananahackers.net</link>
    <description>Read the latest posts from BananaHackers blog.</description>
    <pubDate>Sun, 10 May 2026 13:06:52 +0200</pubDate>
    <item>
      <title>Saying goodbye to KaiOS and to chooj</title>
      <link>https://blog.bananahackers.net/farooqkz/saying-goodbye-to-kaios-and-to-chooj</link>
      <description>&lt;![CDATA[If you are following KaiOS and BananaHackers, you probably have noticed that not much is happening. I have written a post about state of KaiOS in 2023. Back then, there was still pinpricks of hope in me. Now it&#39;s all gone.&#xA;&#xA;Smart feature phone was a very good idea. And so was KaiOS. But they didn&#39;t well play the game. So they lost. I&#39;m not gonna go through the reasons why it failed. However, I sure have technical criticisms from user and developer point of view. I do wish it succeeded. But not all wishes would be granted.&#xA;&#xA;KaiOS is dead in the global market. However, it has still has some presence in the US and some parts of Africa. WhatsApp withdrawing from KaiOS makes the situation even worse for them. It seems they are slowly sinking in the water. Maybe water is already over their head.&#xA;&#xA;If KaiOS had a global presence, a Matrix client like chooj had the potential to make a major influence for KaiOS. As you could use beeper&#39;s software to connect to various Messaging platforms all from Matrix. This means you could have WhatsApp, Telegram, and tons of other IMs right in your KaiOS device. It could be a game changer.&#xA;&#xA;I imported a Nokia 2780 Flip. Affe Null made contributions to make it hackable. But my main motivation for writing apps for KaiOS, is the fact that it was my daily driver. That I was the first user of the apps. Now without global devices, I don&#39;t have a KaiOS phone as a daily driver. So no motivation to write KaiOS apps.&#xA;&#xA;Another problem with newer KaiOS devices is that you can&#39;t simply enable debugging on them and sideload apps, to then use them as development devices. That was another major problem for us. However, enthusiasm made us find ways to hack the devices, find hidden codes, root them and finally write apps. Now there is no device to hack, anymore.&#xA;&#xA;I&#39;m afraid when there is no KaiOS, there is also no Matrix client for KaiOS. So I&#39;m archiving the chooj repositories today. And I won&#39;t renew the domain any longer. If anyone would like to continue chooj, I would be happy to help them and to tell them about internals of the app. You don&#39;t know how much do I hate to let chooj go. I humbly thank people who donated, people who tested and people who encouraged me.&#xA;&#xA;You might be interested in my other &#34;wares&#34;. In that case, here are some links to various places I have presence:&#xA;&#xA; My English blog&#xA; My Persian blog&#xA; Mastodon&#xA; Codeberg&#xA; Github]]&gt;</description>
      <content:encoded><![CDATA[<p>If you are following KaiOS and BananaHackers, you probably have noticed that not much is happening. I have written <a href="https://blog.bananahackers.net/farooqkz/on-the-state-of-kaios-and-bananahackers-community-as-of-summer-of-2023" rel="nofollow">a post</a> about state of KaiOS in 2023. Back then, there was still pinpricks of hope in me. Now it&#39;s all gone.</p>

<p>Smart feature phone was a very good idea. And so was KaiOS. But they didn&#39;t well play the game. So they lost. I&#39;m not gonna go through the reasons why it failed. However, I sure have technical criticisms from user and developer point of view. I do wish it succeeded. But not all wishes would be granted.</p>

<p>KaiOS is dead in the global market. However, it has still has some presence in the US and some parts of Africa. WhatsApp withdrawing from KaiOS makes the situation even worse for them. It seems they are slowly sinking in the water. Maybe water is already over their head.</p>

<p>If KaiOS had a global presence, a Matrix client like chooj had the potential to make a major influence for KaiOS. As you could use beeper&#39;s software to connect to various Messaging platforms all from Matrix. This means you could have WhatsApp, Telegram, and tons of other IMs right in your KaiOS device. It could be a game changer.</p>

<p>I imported a Nokia 2780 Flip. Affe Null made <a href="https://blog.bananahackers.net/farooqkz/you-can-sideload-on-nokia-2780-flip-thanks-to-affe-null" rel="nofollow">contributions</a> to make it hackable. But my main motivation for writing apps for KaiOS, is the fact that it was my daily driver. That I was the first user of the apps. Now without global devices, I don&#39;t have a KaiOS phone as a daily driver. So no motivation to write KaiOS apps.</p>

<p>Another problem with newer KaiOS devices is that you can&#39;t simply enable debugging on them and sideload apps, to then use them as development devices. That was another major problem for us. However, enthusiasm made us find ways to hack the devices, find hidden codes, root them and finally write apps. Now there is no device to hack, anymore.</p>

<p>I&#39;m afraid when there is no KaiOS, there is also no Matrix client for KaiOS. So I&#39;m archiving the chooj repositories today. And I won&#39;t renew the domain any longer. If anyone would like to continue chooj, I would be happy to help them and to tell them about internals of the app. You don&#39;t know how much do I hate to let chooj go. I humbly thank people who donated, people who tested and people who encouraged me.</p>

<p>You might be interested in my other “wares”. In that case, here are some links to various places I have presence:</p>
<ul><li><a href="https://far.chickenkiller.com" rel="nofollow">My English blog</a></li>
<li><a href="https://blogfa.farooqkz.com" rel="nofollow">My Persian blog</a></li>
<li><a href="https://cr8r.gg/@farooqkz" rel="nofollow">Mastodon</a></li>
<li><a href="https://codeberg.org/farooqkz" rel="nofollow">Codeberg</a></li>
<li><a href="https://github.com/farooqkz" rel="nofollow">Github</a></li></ul>
]]></content:encoded>
      <author>farooqkz</author>
      <guid>https://blog.bananahackers.net/read/a/bqhbhg2yvd</guid>
      <pubDate>Sun, 03 Aug 2025 09:54:02 +0200</pubDate>
    </item>
    <item>
      <title>The BananaHackers wiki now works on KaiOS!</title>
      <link>https://blog.bananahackers.net/farooqkz/the-bananahackers-wiki-now-works-on-kaios</link>
      <description>&lt;![CDATA[TL;DR; Thanks to one of brilliant community members, Cyan, our wiki now renders on KaiOS and is usable there. This is possible by integrating a custom Javascript and the script does not run if the browser is not a KaiOS browser.&#xA;&#xA;Why it was not working on KaiOS browser?&#xA;&#xA;The currently widespread version of KaiOS, version 2.x, is based on an ancient version of Gecko. Gecko is the browser engine used by Firefox and the version KaiOS uses, doesn&#39;t support newer technologies and standards.&#xA;&#xA;The wiki software we use, wiki.js, uses the new technologies to render the content. Thus, it doesn&#39;t render on KaiOS 2.x which is using an ancient browser engine. However, this is not a problem on KaiOS 3.x which is based on the modern engine. But unfortunately, this new version of KaiOS is not widespread globally, yet. And most users have got devices which run the older version.&#xA;&#xA;What has changed now?&#xA;&#xA;Cyan has written a script which we&#39;ve integrated with our wiki using the custom HTML feature. This script first checks if the target browser is a KaiOS one. If it isn&#39;t, it won&#39;t do anything. But if it is KaiOS, it&#39;ll try to render the content of the wiki pages so that visitors from KaiOS can see the content.&#xA;&#xA;Does it affect efficiency and performance of the wiki?&#xA;&#xA;Yes. But the affected performance is very trivial. The script is less than 10 KiBs minified. And if the browser is not KaiOS, only a simple check is extra there.&#xA;&#xA;It is not perfect, yet.&#xA;&#xA;Cyan has done great job. I am very grateful. However, it might be that in some cases, like edge cases, the script won&#39;t work and render things properly. Feel free to contact Cyan to improve the script. He is available on our community chatrooms accessible from Matrix and Discord.]]&gt;</description>
      <content:encoded><![CDATA[<p>TL;DR; Thanks to one of brilliant community members, <a href="https://github.com/cyan-2048/" rel="nofollow">Cyan</a>, <a href="https://wiki.bananahackers.net" rel="nofollow">our wiki</a> now renders on KaiOS and is usable there. This is possible by integrating <a href="https://gist.github.com/cyan-2048/e3af95a89130320346cd34dbd73cc84a" rel="nofollow">a custom Javascript</a> and the script does not run if the browser is not a KaiOS browser.</p>

<h2 id="why-it-was-not-working-on-kaios-browser" id="why-it-was-not-working-on-kaios-browser">Why it was not working on KaiOS browser?</h2>

<p>The currently widespread version of KaiOS, version 2.x, is based on an ancient version of Gecko. Gecko is the browser engine used by Firefox and the version KaiOS uses, doesn&#39;t support newer technologies and standards.</p>

<p>The wiki software we use, <a href="https://js.wiki" rel="nofollow">wiki.js</a>, uses the new technologies to render the content. Thus, it doesn&#39;t render on KaiOS 2.x which is using an ancient browser engine. However, this is not a problem on KaiOS 3.x which is based on the modern engine. But unfortunately, this new version of KaiOS is not widespread globally, yet. And most users have got devices which run the older version.</p>

<h2 id="what-has-changed-now" id="what-has-changed-now">What has changed now?</h2>

<p>Cyan has written a script which we&#39;ve integrated with our wiki using the custom HTML feature. This script first checks if the target browser is a KaiOS one. If it isn&#39;t, it won&#39;t do anything. But if it is KaiOS, it&#39;ll try to render the content of the wiki pages so that visitors from KaiOS can see the content.</p>

<h2 id="does-it-affect-efficiency-and-performance-of-the-wiki" id="does-it-affect-efficiency-and-performance-of-the-wiki">Does it affect efficiency and performance of the wiki?</h2>

<p>Yes. But the affected performance is very trivial. The script is less than 10 KiBs minified. And if the browser is not KaiOS, only a simple check is extra there.</p>

<h2 id="it-is-not-perfect-yet" id="it-is-not-perfect-yet">It is not perfect, yet.</h2>

<p>Cyan has done great job. I am very grateful. However, it might be that in some cases, like edge cases, the script won&#39;t work and render things properly. Feel free to contact Cyan to improve the script. He is available on our community chatrooms accessible from <a href="https://matrix.to/#/%23bananahackers:mozilla.org" rel="nofollow">Matrix</a> and <a href="https://discord.gg/rQ93zEu" rel="nofollow">Discord</a>.</p>
]]></content:encoded>
      <author>farooqkz</author>
      <guid>https://blog.bananahackers.net/read/a/fhz5iwt14t</guid>
      <pubDate>Tue, 19 Sep 2023 13:01:35 +0200</pubDate>
    </item>
    <item>
      <title>You can sideload on Nokia 2780 Flip thanks to Affe Null</title>
      <link>https://blog.bananahackers.net/farooqkz/you-can-sideload-on-nokia-2780-flip-thanks-to-affe-null</link>
      <description>&lt;![CDATA[Affe Null card&#xA;&#xA;#linux #kaios #bananahackers #bananahacker #pmOS #nokia2780 #hack #kaios3 #firefoxos&#xA;&#xA;It has been a while since 2780 is out. Most BananaHackers have been waiting a long time to get their hand on a KaiOS 3.x device and Nokia 2780 is the first one released which is not carrier-locked. Many other community members, like Luxferre seem to prefer waiting till a global 3.x device gets released. This 3.x flip phone is not global but because it&#39;s not carrier locked, one could import them from third party stores like Amazon.&#xA;&#xA;I haven&#39;t got my hand on a 2780, yet. But according to Affe, no code worked on Nokia 2780 Flip to enable debugging like other Nokia models such as the BananaPhone. And using W2D does not enable ADB. It&#39;s very unfortunate. But like most other hackers in the world, Affe was not willing to give up till he gets what he wanted and now we have the weeknd Toolbox created by him.&#xA;&#xA;!--more--&#xA;&#xA;This toolbox enables users to modify the internal storage of 2780. This let&#39;s us side-load third-party apps outside KaiStore as well as modifying the pre-installed System and obviously, the stock apps among them.&#xA;&#xA;Remember that debugging is not yet possible on 2780. And side-loading the apps is not done through the debugging protocol of B2G like the other phones. Thus, this phone is not suitable for app development purposes, yet. Unless, of course, you are willing to do some device hacks to make it so.&#xA;&#xA;If you want to learn more about 2780 and the technical story behind the hack, you can read the wiki page dedicated to this phone on BananaHackers wiki.]]&gt;</description>
      <content:encoded><![CDATA[<p><img src="https://farooqkz.de1.hashbang.sh/storage/download?name=affe.png" alt="Affe Null card"></p>

<p>#linux #kaios #bananahackers #bananahacker #pmOS #nokia2780 #hack #kaios3 #firefoxos</p>

<p>It has been a while since 2780 is out. Most BananaHackers have been waiting a long time to get their hand on a KaiOS 3.x device and Nokia 2780 is the first one released which is not carrier-locked. Many other community members, like <a href="https://gitlab.com/suborg" rel="nofollow">Luxferre</a> seem to prefer waiting till a global 3.x device gets released. This 3.x flip phone is not global but because it&#39;s not carrier locked, one could import them from third party stores like Amazon.</p>

<p>I haven&#39;t got my hand on a 2780, yet. But according to Affe, no code worked on Nokia 2780 Flip to enable debugging like other Nokia models such as <a href="https://wiki.bananahackers.net/en/devices/nokia-8110-4g" rel="nofollow">the BananaPhone</a>. And using <a href="https://w2d.bananahackers.net" rel="nofollow">W2D</a> does not enable ADB. It&#39;s very unfortunate. But like most other hackers in the world, Affe was not willing to give up till he gets what he wanted and now we have the <a href="https://git.abscue.de/affe_null/weeknd-toolbox/" rel="nofollow">weeknd Toolbox</a> created by him.</p>



<p>This toolbox enables users to modify the internal storage of 2780. This let&#39;s us side-load third-party apps <em>outside KaiStore</em> as well as modifying the pre-installed System and obviously, the stock apps among them.</p>

<p><strong>Remember that debugging is not yet possible on 2780. And side-loading the apps is not done through the debugging protocol of B2G like the other phones. Thus, this phone is not suitable for app development purposes, yet. Unless, of course, you are willing to do some device hacks to make it so.</strong></p>

<p>If you want to learn more about 2780 and the technical story behind the hack, you can read <a href="https://wiki.bananahackers.net/en/devices/nokia-2780-flip" rel="nofollow">the wiki page dedicated to this phone on BananaHackers wiki</a>.</p>
]]></content:encoded>
      <author>farooqkz</author>
      <guid>https://blog.bananahackers.net/read/a/apsp6wc0pd</guid>
      <pubDate>Fri, 19 May 2023 11:57:22 +0200</pubDate>
    </item>
    <item>
      <title>On the state of KaiOS and BananaHackers community as of summer of 2023</title>
      <link>https://blog.bananahackers.net/farooqkz/on-the-state-of-kaios-and-bananahackers-community-as-of-summer-of-2023</link>
      <description>&lt;![CDATA[#kaios #bananahackers #hacker #hacking #featurephonedevelopment #featurephone #notandroid&#xA;&#xA;A few years ago, Luxferre founded the BananaHackers community to hack KaiOS, the web based mobile OS, and to develop for this platform. I joined this community after I got my BananaPhone. The famous 8110 which has a yellow colour and is curved. I remember I was exactly looking for the yellow version of the phone and it was very exciting.&#xA;&#xA;I remember when I wanted to get my 8110 back in 2017, there were just around 100 apps in KaiStore or maybe even less. The community was young and so was KaiOS. I think my first app for KaiOS was VM-IRC which the VM part was standing for Very Minimalistic. Later when I joined the community chatrooms which back then were hosted on r/KaiOS Discord guild. I found the community welcoming and very active. We had Uncle Ivan(or Ivan Alex HC) among us who was not a developer but had spirit of a tinkerer. You might know his Youtube channel. We also had many other members which you can find a list, hopefully complete, in the credits page of our wiki.&#xA;&#xA;!--more--&#xA;&#xA;I was honored to become a trusted member of the community and later a council member. The council is the heart of the community and we have very old members there who are still active. We also had many members there who are no longer around, unfortunately.&#xA;&#xA;In 2018, the partnership of KaiOS and Mozilla was announced to bring modern and performant web for KaiOS. Almost everyone of us were waiting for KaiOS 3.0 which was based on the new Gecko rather the ancient one used in Firefox 48. There are so many advantages in this upgrade. Including but not limited to support of WebAssembly, newer WebGL, much better performance in rendering and new web APIs. We were looking forward to the new KaiOS and hoping it to be still debug-enabled and available worldwide.&#xA;&#xA;But now, in 2023, this mobile Operating System seems to be on the verge of death. Not only KaiOS 3.0 is out but also KaiOS 3.1 is also out. But there is no device which is available worldwide. Only few carrier-locked devices for North America. Nevertheless, there is Nokia 2780 Flip which is not carrier locked. And one can buy from online shops like Amazon almost anywhere in the world. But first, this phone will cost one around 140 bucks to get into their hand. Second and more important, this device is not debug enabled and thus it cannot be used for app development purposes in a convenient way.&#xA;&#xA;Many &#34;council&#34; members have lost interest in developing for KaiOS. Many have not and believe this OS will live on and cover a minority of the market. Both opinions seem reasonable and we&#39;ll have to wait to see what will happen.&#xA;&#xA;I&#39;ve already considered an alternative mobile OS. I have two main requirements: First and most important, I must be able to easily hack the OS and write apps for it. Unfortunately, not Android nor iOS are not my answer. Developing an Android app requires you to have huge resources on your PC. And its ecosystem is hard to hack. Compiling Android itself takes ages and a regular PC. iOS on the other hand is even worse. To develop for iOS you need a MacBook and a developer licence from Apple. The second requirement is that I don&#39;t want my phone to be only a display which is boring and the outside view of most smartphones these days.&#xA;&#xA;I haven&#39;t decided, yet. But postmarketOS looks very promising. There is already good support of hardware features in 8000 4G) and 2720 Flip). There is a possibility to port the new Gecko to pmOS to bring the new KaiOS to the older phones. However, this is not easy, simple nor trivial.&#xA;&#xA;One of members, mostly known as Affe Null, had developed their own ecosystem for KaiOS phones, mainly 8110 at that time. He had ported Debian to 8110 and also developed many apps for it including a graphical shell. Later, he moved to pmOS which seems a reasonable move.]]&gt;</description>
      <content:encoded><![CDATA[<p>#kaios #bananahackers #hacker #hacking #featurephonedevelopment #featurephone #notandroid</p>

<p>A few years ago, <a href="http://gitlab.com/suborg" rel="nofollow">Luxferre</a> founded the BananaHackers community to hack KaiOS, the web based mobile OS, and to develop for this platform. I joined this community after I got my BananaPhone. The famous 8110 which has a yellow colour and is curved. I remember I was exactly looking for the yellow version of the phone and it was very exciting.</p>

<p>I remember when I wanted to get my 8110 back in 2017, there were just around 100 apps in KaiStore or maybe even less. The community was young and so was KaiOS. I think my first app for KaiOS was <a href="https://notabug.org/bananaphone/VM-IRC" rel="nofollow">VM-IRC</a> which the VM part was standing for Very Minimalistic. Later when I joined the community chatrooms which back then were hosted on <code>r/KaiOS</code> Discord guild. I found the community welcoming and very active. We had Uncle Ivan(or Ivan Alex HC) among us who was not a developer but had spirit of a tinkerer. You might know <a href="https://www.youtube.com/@BananaHackers" rel="nofollow">his Youtube channel</a>. We also had many other members which you can find a list, hopefully complete, in the credits page of <a href="https://wiki.bananahackers.net/en/Credits" rel="nofollow">our wiki</a>.</p>



<p>I was honored to become a trusted member of the community and later a council member. The council is the heart of the community and we have very old members there who are still active. We also had many members there who are no longer around, unfortunately.</p>

<p>In 2018, the partnership of KaiOS and Mozilla was announced to bring modern and performant web for KaiOS. Almost everyone of us were waiting for KaiOS 3.0 which was based on the new Gecko rather the ancient one used in Firefox 48. There are so many advantages in this upgrade. Including but not limited to support of WebAssembly, newer WebGL, much better performance in rendering and new web APIs. We were looking forward to the new KaiOS and hoping it to be still debug-enabled and available worldwide.</p>

<p>But now, in 2023, this mobile Operating System seems to be on the verge of death. Not only KaiOS 3.0 is out but also KaiOS 3.1 is also out. But there is no device which is available worldwide. Only few carrier-locked devices for North America. Nevertheless, there is <a href="https://wiki.bananahackers.net/en/devices/nokia-2780-flip" rel="nofollow">Nokia 2780 Flip</a> which is not carrier locked. And one can buy from online shops like Amazon almost anywhere in the world. But first, this phone will cost one around 140 bucks to get into their hand. Second and more important, this device is not debug enabled and thus it cannot be used for app development purposes in a convenient way.</p>

<p>Many “council” members have lost interest in developing for KaiOS. Many have not and believe this OS will live on and cover a minority of the market. Both opinions seem reasonable and we&#39;ll have to wait to see what will happen.</p>

<p>I&#39;ve already considered an alternative mobile OS. I have two main requirements: First and most important, I must be able to easily hack the OS and write apps for it. Unfortunately, not Android nor iOS are not my answer. Developing an Android app requires you to have huge resources on your PC. And its ecosystem is hard to hack. Compiling Android itself takes ages and a regular PC. iOS on the other hand is even worse. To develop for iOS you need a MacBook and a developer licence from Apple. The second requirement is that I don&#39;t want my phone to be only a display which is boring and the outside view of most smartphones these days.</p>

<p>I haven&#39;t decided, yet. But <a href="https://postmarketos.org" rel="nofollow">postmarketOS</a> looks very promising. There is already good support of hardware features in <a href="https://wiki.postmarketos.org/wiki/Nokia_8000_4G_(nokia-sparkler)" rel="nofollow">8000 4G</a> and <a href="https://wiki.postmarketos.org/wiki/Nokia_2720_Flip_(nokia-beatles)" rel="nofollow">2720 Flip</a>. There is a possibility to port <a href="https://github.com/kaiostech/gecko-b2g" rel="nofollow">the new Gecko</a> to pmOS to bring the new KaiOS to the older phones. However, this is not easy, simple nor trivial.</p>

<p>One of members, mostly known as Affe Null, had developed their own ecosystem for KaiOS phones, mainly 8110 at that time. He had ported Debian to 8110 and also developed many apps for it including a <a href="https://git.abscue.de/obp/bananui/bananui" rel="nofollow">graphical shell</a>. Later, he moved to pmOS which seems a reasonable move.</p>
]]></content:encoded>
      <author>farooqkz</author>
      <guid>https://blog.bananahackers.net/read/a/rcf6jedyg3</guid>
      <pubDate>Fri, 21 Apr 2023 20:38:33 +0200</pubDate>
    </item>
    <item>
      <title>chooj is back into the game!</title>
      <link>https://blog.bananahackers.net/farooqkz/chooj-is-back-into-the-game</link>
      <description>&lt;![CDATA[#chooj #matrix #matrixorg #chat #chatapp #chatclient #foss #kaios&#xA;&#xA;After a long period of no progress, I&#39;ve got time to work on chooj, the Matrix client for KaiOS, again! The progress is slow and constant funding is needed so that project will reach stable status within a reasonable period.&#xA;&#xA;!--more--&#xA;&#xA;What&#39;s new?&#xA;&#xA;From user point of view&#xA;&#xA;Because many security flaws were found in one of dependency libraries of chooj, matrix-js-sdk, I had to tell everyone to stop using chooj. The most important change is that with upgrade of this dependency, chooj is usable again.&#xA;&#xA;There are many small features which have been added. Most importantly, there is a much better and more friendly login progress, you can save pictures to gallery,  log out from chooj(In past the only option was uninstalling chooj and logging out from another client), and join rooms by entering room&#39;s alias(name) or id . Many bugs have been fixed and probably many new ones have been introduced. Finally, I&#39;ve added partial support for checking presence of your contacts. Please check if this feature works with your homeserver. For my homeserver, all contacts show as offline(gray badge next to the user avatar).&#xA;&#xA;From developer point of view&#xA;&#xA;All dependencies have been upgraded to latest versions. This include Inferno, the JS SDK, localforage and many others.&#xA;&#xA;I&#39;ve also switched from webpack to parceljs. The app was initially created with Create Inferno App which used webpack. But during upgrading dependencies(which also required upgrading node), I&#39;ve found webpack has too much overhead with its configuration. While when targeting KaiOS, zero configuration truly doesn&#39;t exist, parcel requires way less effort for this. Also parcel uses Rust which makes building much faster.&#xA;&#xA;There are working development and production builds. But more work must be done. For instance, when targeting Firefox 48, parcel tries to build a bundle which is good for both the ancient FF48 and newer browsers. FF48 doesn&#39;t support Javascript modules while modern browsers support. So parcel builds both module and nomodule Javascripts which make the bundle size twice. You can see this issue in parcel&#39;s repo for tracking the progress of it.&#xA;&#xA;Regarding the UI library, chooj was using AdrianMachado&#39;s KaiUI which is both ancient and intended to be a React UI library. React on KaiOS is really a terrible idea because of its efficiency. chooj, however, was using just styling stuff from the KaiUI. But the dependencies which were supposed to be used in a React project, was also installed with yarn install.&#xA;&#xA;As a long term solution, we need to fork this KaiUI and maintain it ourselves because Adrian is no longer working on it. For now I&#39;ve forked it to KaiUIv2 where all React stuff have been removed and now that is dependency of chooj. The styling stuff, however, is untouched. Many works must be done. I invite users of this KaiUI to help me with maintaining KaiUIv2.&#xA;&#xA;Future plans&#xA;&#xA;I plan to keep the look and feel of chooj as is till I release the first version(which will be 0.0.0). The 0.0.0 release will have very basic functionalities of a chat app including basic chatting, joining rooms both through public directories and by name, inviting users to DM, managing invites, experimental push notification support and perhaps voice call or end to end encryption support.&#xA;&#xA;After that, huge changes must be made. You can see a proposed UI design in this issue. And so many internal changes like separating the KaiUI Inferno components from chooj should also be done.&#xA;&#xA;KaiOS 3.x support&#xA;&#xA;There is no KaiOS 3.x support at the time of writing this post simply because there is no KaiOS 3.x global device which is also debug enabled. Many phones have been released which are US-only. There is Nokia 2780 which is US-only but not carrier locked. But community member who have bought this device are spending their time on finding a way to enable debug mode on this device.&#xA;&#xA;Funding and help needed&#xA;&#xA;Constant funding is needed for the project in the long term:&#xA;&#xA; Push gateway server is required for receiving push notifications. The server software should be written in Rust(or possibly Go if someone else wanted to take the job) which relays the notifications from user&#39;s homeserver to user&#39;s device. The server cost will vary depending on the number of users of chooj. If the number of users are big enough, we could have more than one server for different regions.&#xA;&#xA; Funding is also needed for development of chooj and its push gateway software. While I try to not abandon chooj, but I need an income for my life.&#xA;&#xA; chooj must be tested on different KaiOS versions and phones with different hardware features. For instance, the video call feature will require a phone with a front/selfie camera. While it is possible that I do this part of development remotely(e.g. tell someone else to test), it will be very painful and slow.&#xA;&#xA;To help with funding, I&#39;ve put a Bitcoin Cash(not Bitcoin) address in the project&#39;s README. If you are not already familiar with cryptocurrency stuff, you can buy from Paypal or an exchange like which I&#39;ve mentioned in the link above. And then sending to my address.&#xA;&#xA;There are many other stuff which money will not solve like testing. There is no machine which I can feed it money and after that it will tell me bugs of this project. Also I am a developer and not a UI/UX designer. So help and feedback from the community is necessary just like funding.]]&gt;</description>
      <content:encoded><![CDATA[<p>#chooj #matrix #matrixorg #chat #chatapp #chatclient #foss #kaios</p>

<p>After a long period of no progress, I&#39;ve got time to work on <a href="https://github.com/farooqkz/chooj" rel="nofollow">chooj, the Matrix client for KaiOS</a>, again! The progress is slow and constant funding is needed so that project will reach stable status within a reasonable period.</p>



<h3 id="what-s-new" id="what-s-new">What&#39;s new?</h3>

<h4 id="from-user-point-of-view" id="from-user-point-of-view">From user point of view</h4>

<p>Because many security flaws were found in one of dependency libraries of chooj, <code>matrix-js-sdk</code>, I had to tell everyone to stop using chooj. The most important change is that with upgrade of this dependency, chooj is usable again.</p>

<p>There are many small features which have been added. Most importantly, there is a much better and more friendly login progress, you can save pictures to gallery,  log out from chooj(In past the only option was uninstalling chooj and logging out from another client), and join rooms by entering room&#39;s alias(name) or id . Many bugs have been fixed and probably many new ones have been introduced. Finally, I&#39;ve added partial support for checking presence of your contacts. Please check if this feature works with your homeserver. For my homeserver, all contacts show as offline(gray badge next to the user avatar).</p>

<h4 id="from-developer-point-of-view" id="from-developer-point-of-view">From developer point of view</h4>

<p>All dependencies have been upgraded to latest versions. This include <a href="https://infernojs.org/" rel="nofollow">Inferno</a>, <a href="https://github.com/matrix-org/matrix-js-sdk" rel="nofollow">the JS SDK</a>, <a href="https://localforage.github.io/localForage" rel="nofollow">localforage</a> and many others.</p>

<p>I&#39;ve also switched from <a href="https://webpack.js.org" rel="nofollow">webpack</a> to <a href="https://parceljs.org" rel="nofollow">parceljs</a>. The app was initially created with <a href="https://github.com/infernojs/create-inferno-app" rel="nofollow">Create Inferno App</a> which used webpack. But during upgrading dependencies(which also required upgrading node), I&#39;ve found webpack has too much overhead with its configuration. While when targeting KaiOS, zero configuration truly doesn&#39;t exist, parcel requires way less effort for this. Also parcel uses <a href="https://rust-lang.org/" rel="nofollow">Rust</a> which makes building much faster.</p>

<p>There are working development and production builds. But more work must be done. For instance, when targeting Firefox 48, parcel tries to build a bundle which is good for both the ancient FF48 and newer browsers. FF48 doesn&#39;t support Javascript modules while modern browsers support. So parcel builds both module and nomodule Javascripts which make the bundle size twice. You can see <a href="https://github.com/parcel-bundler/parcel/issues/8783" rel="nofollow">this issue in parcel&#39;s repo</a> for tracking the progress of it.</p>

<p>Regarding the UI library, chooj was using <a href="https://github.com/AdrianMachado/KaiUI" rel="nofollow">AdrianMachado&#39;s KaiUI</a> which is both ancient and intended to be a React UI library. React on KaiOS is really a terrible idea because of its efficiency. chooj, however, was using just styling stuff from the KaiUI. But the dependencies which were supposed to be used in a React project, was also installed with <code>yarn install</code>.</p>

<p>As a long term solution, we need to fork this KaiUI and maintain it ourselves because Adrian is no longer working on it. For now I&#39;ve forked it to <a href="https://github.com/farooqkz/KaiUIv2" rel="nofollow">KaiUIv2</a> where all React stuff have been removed and now that is dependency of chooj. The styling stuff, however, is untouched. Many works must be done. I invite users of this KaiUI to help me with <a href="https://github.com/farooqkz/KaiUIv2/issues" rel="nofollow">maintaining KaiUIv2</a>.</p>

<h3 id="future-plans" id="future-plans">Future plans</h3>

<p>I plan to keep the look and feel of chooj as is till I release the first version(which will be <code>0.0.0</code>). The <code>0.0.0</code> release will have very basic functionalities of a chat app including basic chatting, joining rooms both through public directories and by name, inviting users to DM, managing invites, experimental push notification support and perhaps voice call or end to end encryption support.</p>

<p>After that, huge changes must be made. You can see a proposed UI design in <a href="https://github.com/farooqkz/chooj/issues/51" rel="nofollow">this issue</a>. And so many internal changes like <a href="https://github.com/farooqkz/chooj/issues/62" rel="nofollow">separating the KaiUI Inferno components from chooj</a> should also be done.</p>

<h3 id="kaios-3-x-support" id="kaios-3-x-support">KaiOS 3.x support</h3>

<p>There is no KaiOS 3.x support at the time of writing this post simply because there is no KaiOS 3.x global device which is also debug enabled. Many phones have been released which are US-only. There is <a href="https://wiki.bananahackers.net/en/devices/nokia-2780-flip" rel="nofollow">Nokia 2780</a> which is US-only but not carrier locked. But community member who have bought this device are spending their time on finding a way to enable debug mode on this device.</p>

<h3 id="funding-and-help-needed" id="funding-and-help-needed">Funding and help needed</h3>

<p>Constant funding is needed for the project in the long term:</p>
<ul><li><p>Push gateway server is required for receiving push notifications. The server software should be written in Rust(or possibly Go if someone else wanted to take the job) which relays the notifications from user&#39;s homeserver to user&#39;s device. The server cost will vary depending on the number of users of chooj. If the number of users are big enough, we could have more than one server for different regions.</p></li>

<li><p>Funding is also needed for development of chooj and its push gateway software. While I try to not abandon chooj, but I need an income for my life.</p></li>

<li><p>chooj must be tested on different KaiOS versions and phones with different hardware features. For instance, the video call feature will require a phone with a front/selfie camera. While it is possible that I do this part of development remotely(e.g. tell someone else to test), it will be very painful and slow.</p></li></ul>

<p>To help with funding, I&#39;ve put a Bitcoin Cash(<strong>not Bitcoin</strong>) address in <a href="https://github.com/farooqkz/chooj#donations" rel="nofollow">the project&#39;s README</a>. If you are not already familiar with cryptocurrency stuff, you can buy from Paypal or an exchange like which I&#39;ve mentioned in the link above. And then sending to my address.</p>

<p>There are many other stuff which money will not solve like testing. There is no machine which I can feed it money and after that it will tell me bugs of this project. Also I am a developer and not a UI/UX designer. So help and feedback from the community is necessary just like funding.</p>
]]></content:encoded>
      <author>farooqkz</author>
      <guid>https://blog.bananahackers.net/read/a/j5kt4h7gc1</guid>
      <pubDate>Sun, 12 Feb 2023 17:14:46 +0100</pubDate>
    </item>
    <item>
      <title>Writing on BananaHackers blog</title>
      <link>https://blog.bananahackers.net/root/writing-on-bananahackers-blog</link>
      <description>&lt;![CDATA[If anyone wants to write on this blog, email Farooq with a sample Kai post of their own and he&#39;ll reply with an invitation link as soon as possible.&#xA;&#xA;Here&#39;s the email address:&#xA;&#xA;fkz [at] riseup [dot] neeeeet&#xA;&#xA;Note that it is riseup.net not neeeeet but robots don&#39;t know this :))]]&gt;</description>
      <content:encoded><![CDATA[<p>If anyone wants to write on this blog, email Farooq with a sample Kai post of their own and he&#39;ll reply with an invitation link as soon as possible.</p>

<p>Here&#39;s the email address:</p>

<p><code>fkz [at] riseup [dot] neeeeet</code></p>

<p><strong>Note that it is riseup.net not neeeeet but robots don&#39;t know this :))</strong></p>
]]></content:encoded>
      <author>root</author>
      <guid>https://blog.bananahackers.net/read/a/ebza85grt1</guid>
      <pubDate>Sun, 15 Aug 2021 09:57:27 +0200</pubDate>
    </item>
    <item>
      <title>delta.map - an application to aid in hiking</title>
      <link>https://blog.bananahackers.net/lollodev5123/delta-map-an-application-to-aid-in-hiking</link>
      <description>&lt;![CDATA[delta.map - an application to aid in hiking&#xA;coolappbanner&#xA;Hits&#xA;License&#xA;Checks&#xA;CommitActivity&#xA;Starts&#xA;&#xA;Hello everyone! Im new here to this blog, and in my first post, we&#39;ll talk about an application I have been adapting to my needs and made open source some time ago, delta.map...&#xA;&#xA;How I started off&#xA;&#xA;I started off forking o.map, I was full of ideas at the moment, unfortunately, some days later I had to go in vacation and left my computer at home, but wait! I built it later at my location so I could continue development! I had made lots and lots of updates, automatically fetch location, weather, accuracy, and wait, I had an idea that was supported by a friend, iGameEveryDay06, I suggested that I should edit the app to fit the style of KaiOS, it seemed pretty easy, but then I realized everything was written in react, which needs to be compiled, minified, it&#39;s pretty annoying. One day, when I was hopeless, Cyan linked to me a GitHub Repo containing native code for KaiUI, it looked beautiful, it was still difficult to implement, but then I realized I could easily add the item class to make the items selectable, once I implemented it enough, it seemed like it would be more difficult to revert back to the old modified o.map style.&#xA;&#xA;What i am currently working on &#xA;&#xA;Im currently working on adding .kml file support, fix a SoftKey bug and maybe improve the code as it is currently a mess + all of the random fixes I do which makes it 100% optimizable if some javascript god happens to run across my repo and make a giant pull request :)&#xA;&#xA;Help me&#xA;&#xA;If you want to support us (me and perry share bits of our code so o.map and delta.map will be always updated), the Repo is here: https://github.com/Delta-Applications/delta.map&#xA;&#xA;Some screenshots&#xA;&#xA;screen.png)&#xA;screen.png)&#xA;screen.png)&#xA;screen.png)&#xA;screen.png)&#xA;5cb.png)]]&gt;</description>
      <content:encoded><![CDATA[<h3 id="delta-map-an-application-to-aid-in-hiking" id="delta-map-an-application-to-aid-in-hiking"><strong>delta.map – an application to aid in hiking</strong></h3>

<p><img src="https://user-images.githubusercontent.com/26120324/125851468-53672dea-c3ce-41df-b0ba-8a755d72f6f3.png" alt="coolappbanner">
<a href="https://hits.seeyoufarm.com" rel="nofollow"><img src="https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Fgjbae1212%2Fhit-counter&amp;count_bg=%23144FDC&amp;title_bg=%23333131&amp;icon=&amp;icon_color=%23E7E7E7&amp;title=Visits&amp;edge_flat=false" alt="Hits"></a>
<img src="https://img.shields.io/github/license/Delta-applications/delta.map" alt="License">
<img src="https://img.shields.io/github/checks-status/Delta-applications/delta.map/main" alt="Checks">
<img src="https://img.shields.io/github/commit-activity/w/Delta-applications/delta.map" alt="CommitActivity">
<img src="https://img.shields.io/github/stars/Delta-Applications/delta.map" alt="Starts"></p>

<p>Hello everyone! Im new here to this blog, and in my first post, we&#39;ll talk about an application I have been adapting to my needs and made open source some time ago, delta.map...</p>

<h1 id="how-i-started-off" id="how-i-started-off">How I started off</h1>

<p>I started off forking o.map, I was full of ideas at the moment, unfortunately, some days later I had to go in vacation and left my computer at home, but wait! I built it later at my location so I could continue development! I had made lots and lots of updates, automatically fetch location, weather, accuracy, and wait, I had an idea that was supported by a friend, iGameEveryDay06, I suggested that I should edit the app to fit the style of KaiOS, it seemed pretty easy, but then I realized everything was written in react, which needs to be compiled, minified, it&#39;s pretty annoying. One day, when I was hopeless, Cyan linked to me a GitHub Repo containing native code for KaiUI, it looked beautiful, it was still difficult to implement, but then I realized I could easily add the item class to make the items selectable, once I implemented it enough, it seemed like it would be more difficult to revert back to the old modified o.map style.</p>

<h1 id="what-i-am-currently-working-on" id="what-i-am-currently-working-on">What i am currently working on</h1>

<p>Im currently working on adding .kml file support, fix a SoftKey bug and maybe improve the code as it is currently a mess + all of the random fixes I do which makes it 100% optimizable if some javascript god happens to run across my repo and make a giant pull request :)</p>

<h1 id="help-me" id="help-me">Help me</h1>

<p>If you want to support us (me and perry share bits of our code so o.map and delta.map will be always updated), the Repo is here: <a href="https://github.com/Delta-Applications/delta.map" rel="nofollow">https://github.com/Delta-Applications/delta.map</a></p>

<h1 id="some-screenshots" id="some-screenshots">Some screenshots</h1>

<p><img src="https://github.com/Delta-Applications/delta.map/raw/main/screenshots/screenshot%20(1).png" alt="screen">
<img src="https://github.com/Delta-Applications/delta.map/raw/main/screenshots/screenshot%20(2).png" alt="screen">
<img src="https://github.com/Delta-Applications/delta.map/raw/main/screenshots/screenshot%20(3).png" alt="screen">
<img src="https://github.com/Delta-Applications/delta.map/raw/main/screenshots/screenshot%20(4).png" alt="screen">
<img src="https://github.com/Delta-Applications/delta.map/raw/main/screenshots/screenshot%20(5).png" alt="screen">
5cb.png)</p>
]]></content:encoded>
      <author>LolloDev5123</author>
      <guid>https://blog.bananahackers.net/read/a/97igxi6ib6</guid>
      <pubDate>Tue, 27 Jul 2021 15:49:35 +0200</pubDate>
    </item>
    <item>
      <title>More about the API daemon - remote services, wavoip and telemetry</title>
      <link>https://blog.bananahackers.net/affe-null/more-about-the-api-daemon-remote-services-wavoip-and-telemetry</link>
      <description>&lt;![CDATA[In the last post I wrote about the #ApiDaemon. In this post, I will show that it is possible to add &#34;add-on&#34; services to the daemon, and also explain what else the daemon does.&#xA;&#xA;Remote services&#xA;Remote services are like plugins for the API daemon. Unlike normal services, they don&#39;t have rust libraries that are compiled into the api-daemon binary, but instead run as a separate &#34;child&#34; daemon. When needed, the API daemon starts the child daemon with the environment variables LDLIBRARYPATH set to the remote service&#39;s path and IPCFD set to a file descriptor number that is used for IPC between the API daemon and the child daemon.&#xA;&#xA;General structure&#xA;Remote service daemons are located in subdirectories of /data/local/service/api-daemon. The subdirectories are named after the service. Each subdirectory should contain at least a daemon binary but can also have a validbuildprops.txt file. Remote services also need a JS library in the httproot. For example, the wavoip2 service contains the following files:&#xA;&#xA;/data/local/service/api-daemon/remote/wavoip2/daemon&#xA;/data/local/service/api-daemon/remote/wavoip2/libc++shared.so&#xA;/data/local/service/api-daemon/remote/wavoip2/libwavoip.so&#xA;/data/local/service/api-daemon/remote/wavoip2/validbuildprops.txt&#xA;/data/local/service/api-daemon/httproot/api/v1/wavoip2/service.js.gz&#xA;&#xA;The validbuildprops.txt file contains a whitelist of values of ro.build.cver. If the file exists, the service is only considered valid if ro.build.cver matches one of the lines and SELinux is in enforcing mode.&#xA;wavoip2 is even more strict: Even if the daemon does start, it still checks for SELinux enforcing and ro.build.cver values. Because of this, WhatsApp calls don&#39;t work on rooted or soft-rootable devices. However, you can spoof SELinux enforcing with the following commands:&#xA;&#xA;echo -n 1   /data/local/tmp/enforce&#xA;mount -o bind /data/local/tmp/enforce /sys/fs/selinux/enforce&#xA;&#xA;And if you then run setprop ro.build.cver QC890531049SEC1, wavoip will start successfully.&#xA;&#xA;I haven&#39;t figured out the IPC protocol yet, but looking at the API daemon&#39;s source code will probably help: https://github.com/kaiostech/api-daemon&#xA;&#xA;KaiAds&#xA;&#xA;The API daemon also serves the #KaiAds SDK for privileged apps. This is probably used because of CSP restrictions that apply only to privileged and certified apps. Newer versions of the SDK provide a &#34;SDK loader&#34; that decides whether to load the real SDK from kaiads.com or http://127.0.0.1:8081/sdk/ads.&#xA;&#xA;Telemetry&#xA;&#xA;Another thing which the daemon does is telemetry. I first noticed this when I tried enabling SELinux enforcing to get wavoip working. After running setenforce 1, my phone suddenly became very slow, and when I looked into logcat, there were a bunch of lines saying that the telemetry process couldn&#39;t read from /proc/kmsg!!! Later I found out that this process belongs to the API daemon. This means that the API daemon reads the kernel log messages for telemetry purposes.&#xA;&#xA;Also, I found the following lines in the daemon&#39;s configuration file:&#xA;&#xA;[telemetry]&#xA;enabled = true&#xA;sendappopenedevents = true&#xA;tokenuri = &#34;https://api.kaiostech.com/v3.0/applications&#34;&#xA;metricsuri = &#34;https://api.kaiostech.com/v3.0/apps/metrics&#34;&#xA;&#xA;so the daemon also sends &#34;app opened&#34; events to KaiOS.&#xA;&#xA;All of this can be disabled by setting enabled to false. But KaiOS also&#xA;provides development versions of the API daemon that have enabled set to false by default: https://packages.stage.kaiostech.com/base\_23/api-daemon-1.4.26.zip. I will write about the packages.*.kaiostech.com domains in the next post.&#xA;]]&gt;</description>
      <content:encoded><![CDATA[<p>In the last post I wrote about the #ApiDaemon. In this post, I will show that it is possible to add “add-on” services to the daemon, and also explain what else the daemon does.</p>

<h2 id="remote-services" id="remote-services">Remote services</h2>

<p>Remote services are like plugins for the API daemon. Unlike normal services, they don&#39;t have rust libraries that are compiled into the <code>api-daemon</code> binary, but instead run as a separate “child” daemon. When needed, the API daemon starts the child daemon with the environment variables <code>LD_LIBRARY_PATH</code> set to the remote service&#39;s path and <code>IPC_FD</code> set to a file descriptor number that is used for IPC between the API daemon and the child daemon.</p>

<h3 id="general-structure" id="general-structure">General structure</h3>

<p>Remote service daemons are located in subdirectories of <code>/data/local/service/api-daemon</code>. The subdirectories are named after the service. Each subdirectory should contain at least a <code>daemon</code> binary but can also have a <code>valid_build_props.txt</code> file. Remote services also need a JS library in the <code>http_root</code>. For example, the <code>wavoip2</code> service contains the following files:</p>

<pre><code>/data/local/service/api-daemon/remote/wavoip2/daemon
/data/local/service/api-daemon/remote/wavoip2/libc++_shared.so
/data/local/service/api-daemon/remote/wavoip2/libwa_voip.so
/data/local/service/api-daemon/remote/wavoip2/valid_build_props.txt
/data/local/service/api-daemon/http_root/api/v1/wavoip2/service.js.gz
</code></pre>

<p>The <code>valid_build_props.txt</code> file contains a whitelist of values of <code>ro.build.cver</code>. If the file exists, the service is only considered valid if <code>ro.build.cver</code> matches one of the lines <strong>and SELinux is in enforcing mode</strong>.
<code>wavoip2</code> is even more strict: Even if the daemon does start, it still checks for SELinux enforcing and <code>ro.build.cver</code> values. Because of this, WhatsApp calls don&#39;t work on rooted or soft-rootable devices. However, you can spoof SELinux enforcing with the following commands:</p>

<pre><code>echo -n 1 &gt; /data/local/tmp/enforce
mount -o bind /data/local/tmp/enforce /sys/fs/selinux/enforce
</code></pre>

<p>And if you then run <code>setprop ro.build.cver QC_8905_3_10_49_SEC_1</code>, wavoip will start successfully.</p>

<p>I haven&#39;t figured out the IPC protocol yet, but looking at the API daemon&#39;s source code will probably help: <a href="https://github.com/kaiostech/api-daemon" rel="nofollow">https://github.com/kaiostech/api-daemon</a></p>

<h2 id="kaiads" id="kaiads">KaiAds</h2>

<p>The API daemon also serves the #KaiAds SDK for privileged apps. This is probably used because of CSP restrictions that apply only to privileged and certified apps. Newer versions of the SDK provide a “SDK loader” that decides whether to load the real SDK from kaiads.com or <a href="http://127.0.0.1:8081/sdk/ads" rel="nofollow">http://127.0.0.1:8081/sdk/ads</a>.</p>

<h2 id="telemetry" id="telemetry">Telemetry</h2>

<p>Another thing which the daemon does is telemetry. I first noticed this when I tried enabling SELinux enforcing to get wavoip working. After running <code>setenforce 1</code>, my phone suddenly became very slow, and when I looked into logcat, there were a bunch of lines saying that the <strong>telemetry process couldn&#39;t read from /proc/kmsg!!!</strong> Later I found out that this process belongs to the API daemon. This means that the API daemon reads the kernel log messages for telemetry purposes.</p>

<p>Also, I found the following lines in the daemon&#39;s configuration file:</p>

<pre><code>[telemetry]
enabled = true
send_app_opened_events = true
token_uri = &#34;https://api.kaiostech.com/v3.0/applications&#34;
metrics_uri = &#34;https://api.kaiostech.com/v3.0/apps/metrics&#34;
</code></pre>

<p>so the daemon also sends “app opened” events to KaiOS.</p>

<p>All of this can be disabled by setting <code>enabled</code> to <code>false</code>. But KaiOS also
provides development versions of the API daemon that have <code>enabled</code> set to <code>false</code> by default: <a href="https://packages.stage.kaiostech.com/base_23/api-daemon-1.4.26.zip" rel="nofollow">https://packages.stage.kaiostech.com/base_23/api-daemon-1.4.26.zip</a>. I will write about the <code>packages.*.kaiostech.com</code> domains in the next post.</p>
]]></content:encoded>
      <author>affe-null</author>
      <guid>https://blog.bananahackers.net/read/a/qzl11vsv78</guid>
      <pubDate>Sat, 15 May 2021 15:07:34 +0200</pubDate>
    </item>
    <item>
      <title>KaiOS APIs</title>
      <link>https://blog.bananahackers.net/affe-null/kaios-apis</link>
      <description>&lt;![CDATA[You might have already heard that #WhatsApp uses some undocumented APIs that are built into the #KaiOS system. These APIs are powered by the api-daemon, a daemon which lies at a lower level than Gecko. In this post, I will explain what I have found out about this daemon.&#xA;&#xA;The api-daemon is written in #Rust, and provides several &#34;services&#34;. Each service has two parts, the JS client and the Rust library. The Rust library is linked into the api-daemon executable. The JS clients are accessible via HTTP at http://127.0.0.1:8081/api/v1/service/script.js and expose APIs in a libservice variable. A pre-installed version of the daemon is available in /system/kaios, but it is copied to /data/local/service to allow updates without modifying the system partition.&#xA;&#xA;Using the APIs&#xA;&#xA;To demonstrate the usage, let&#39;s create a simple app called &#34;Daemon Test&#34;. We will use the telephony service. Although it is meant to be used to get and set the call state, it seems that real calls have no effect on the reported state. However, the state might reflect ongoing WhatsApp and other VoIP calls.&#xA;&#xA;To use the APIs on KaiOS 2.5, we need the external-api permission:&#xA;&#xA;manifest.webapp&#xA;{&#xA;  &#34;name&#34;: &#34;Daemon Test&#34;,&#xA;  &#34;launchpath&#34;: &#34;/index.html&#34;,&#xA;  &#34;description&#34;: &#34;An app to demonstrate api-daemon functionality&#34;,&#xA;  &#34;type&#34;: &#34;privileged&#34;,&#xA;  &#34;permissions&#34;: {&#xA;    &#34;external-api&#34;: {}&#xA;  }&#xA;}&#xA;&#xA;index.html&#xA;!DOCTYPE html&#xA;html&#xA;  body&#xA;    div id=&#34;callstate&#34;Loading.../div&#xA;    script src=&#34;http://127.0.0.1:8081/api/v1/shared/core.js&#34;/script&#xA;    script src=&#34;http://127.0.0.1:8081/api/v1/shared/session.js&#34;/script&#xA;    script src=&#34;http://127.0.0.1:8081/api/v1/telephony/service.js&#34;/script&#xA;    script src=&#34;daemon-test.js&#34;/script&#xA;  /body&#xA;/html&#xA;&#xA;We can now use these APIs as described in https://developer.stage.kaiostech.com/docs/sfp-3.0/09.migration-from-2.5/next-new-apis/daemon-api/telephony/daemon-api-telephony/, except that we will need to replace localhost with localhost:8081. Note that the documentation is for KaiOS 3.0, but on 2.5 only the telephony, libsignal (for WhatsApp) and tcpsocket services are available. You can also look at the api-daemon source code, which is also only for KaiOS 3.0.&#xA;&#xA;First, we need to set up a sess variable that stores the api-daemon session:&#xA;var sess = new libsession.Session();&#xA;Then, we write some handlers that get called when the session connects/disconnects:&#xA;function onsessionconnected(){&#xA;  libtelephony.TelephonyService.get(sess).then(function(service){&#xA;    / handle session connect /&#xA;  });&#xA;}&#xA;function onsessiondisconnected(){&#xA;  / handle session disconnect /&#xA;}&#xA;&#xA;And after that we try connecting.&#xA;sess.open(&#39;websocket&#39;, &#39;localhost:8081&#39;, &#39;secrettoken&#39;,&#xA;  {onsessionconnected, onsessiondisconnected}, true);&#xA;&#xA;Here is the final code:&#xA;daemon-test.js&#xA;window.onerror = function(e){&#xA;  // Error handling&#xA;  alert(e);&#xA;}&#xA;&#xA;var sess = new libsession.Session();&#xA;var elstate = document.getElementById(&#39;callstate&#39;);&#xA;var toggleCallState = null;&#xA;&#xA;function callStateChangeCallback(state){&#xA;  elstate.textContent = state;&#xA;}&#xA;&#xA;// Set up session callbacks&#xA;var onsessionconnected = function(){&#xA;  alert(&#39;Session connected&#39;);&#xA;  // Get an instance of the telephony manager&#xA;  libtelephony.TelephonyService.get(sess).then(function(manager){&#xA;    alert(&#39;Got Telephony manager&#39;);&#xA;    try {&#xA;      // Show the call state&#xA;      manager.callState.then(function(state){&#xA;        elstate.textContent = &#39;Call state: &#39; + state;&#xA;      });&#xA;&#xA;      // Show it again if it changes&#xA;      manager.addEventListener(manager.CALLSTATECHANGEEVENT, function(state){&#xA;          elstate.textContent = &#39;Call state: &#39; + state;&#xA;      });&#xA;&#xA;      toggleCallState = function(){&#xA;        // Get the call state&#xA;        manager.callState.then(function(state){&#xA;          // Set the call state&#xA;          manager.callState = state ? 0 : 1;&#xA;          alert(state ? &#39;Idle&#39; : &#39;Calling&#39;);&#xA;        });&#xA;      }&#xA;    } catch(e) {&#xA;      alert(e);&#xA;    }&#xA;  }).catch(function(e){&#xA;    alert(&#39;Failed to get Telephony manager: &#39; + JSON.stringify(e));&#xA;    toggleCallState = null;&#xA;  });&#xA;}&#xA;var onsessiondisconnected = function(){&#xA;  alert(&#39;Disconnected&#39;);&#xA;  toggleCallState = null;&#xA;}&#xA;&#xA;// Initialize the api-daemon session&#xA;sess.open(&#39;websocket&#39;, &#39;localhost:8081&#39;, &#39;secrettoken&#39;,&#xA;  {onsessionconnected, onsessiondisconnected}, true);&#xA;&#xA;window.addEventListener(&#39;keydown&#39;, function(e){&#xA;  if(e.key == &#39;Call&#39;){&#xA;    // Toggle the state if &#39;Call&#39; is pressed and the session is ready&#xA;    if(typeof toggleCallState === &#39;function&#39;) toggleCallState();&#xA;  }&#xA;});&#xA;&#xA;There is a lot more to this. I will also make a wiki page, and some more posts about things such as the updater-daemon and remote services.&#xA;&#xA;More tags: #ApiDaemon]]&gt;</description>
      <content:encoded><![CDATA[<p>You might have already heard that #WhatsApp uses some undocumented APIs that are built into the #KaiOS system. These APIs are powered by the <code>api-daemon</code>, a daemon which lies at a lower level than Gecko. In this post, I will explain what I have found out about this daemon.</p>

<p>The api-daemon is written in #Rust, and provides several “services”. Each service has two parts, the JS client and the Rust library. The Rust library is linked into the api-daemon executable. The JS clients are accessible via HTTP at <code>http://127.0.0.1:8081/api/v1/&lt;service&gt;/&lt;script&gt;.js</code> and expose APIs in a <code>lib_&lt;service&gt;</code> variable. A pre-installed version of the daemon is available in <code>/system/kaios</code>, but it is copied to <code>/data/local/service</code> to allow updates without modifying the system partition.</p>

<h2 id="using-the-apis" id="using-the-apis">Using the APIs</h2>

<p>To demonstrate the usage, let&#39;s create a simple app called “Daemon Test”. We will use the <code>telephony</code> service. Although it is meant to be used to get and set the call state, it seems that real calls have no effect on the reported state. However, the state might reflect ongoing WhatsApp and other VoIP calls.</p>

<p>To use the APIs on KaiOS 2.5, we need the <code>external-api</code> permission:</p>

<p><code>manifest.webapp</code></p>

<pre><code class="language-json">{
  &#34;name&#34;: &#34;Daemon Test&#34;,
  &#34;launch_path&#34;: &#34;/index.html&#34;,
  &#34;description&#34;: &#34;An app to demonstrate api-daemon functionality&#34;,
  &#34;type&#34;: &#34;privileged&#34;,
  &#34;permissions&#34;: {
    &#34;external-api&#34;: {}
  }
}
</code></pre>

<p><code>index.html</code></p>

<pre><code class="language-html">&lt;!DOCTYPE html&gt;
&lt;html&gt;
  &lt;body&gt;
    &lt;div id=&#34;callstate&#34;&gt;Loading...&lt;/div&gt;
    &lt;script src=&#34;http://127.0.0.1:8081/api/v1/shared/core.js&#34;&gt;&lt;/script&gt;
    &lt;script src=&#34;http://127.0.0.1:8081/api/v1/shared/session.js&#34;&gt;&lt;/script&gt;
    &lt;script src=&#34;http://127.0.0.1:8081/api/v1/telephony/service.js&#34;&gt;&lt;/script&gt;
    &lt;script src=&#34;daemon-test.js&#34;&gt;&lt;/script&gt;
  &lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>We can now use these APIs as described in <a href="https://developer.stage.kaiostech.com/docs/sfp-3.0/09.migration-from-2.5/next-new-apis/daemon-api/telephony/daemon-api-telephony/" rel="nofollow">https://developer.stage.kaiostech.com/docs/sfp-3.0/09.migration-from-2.5/next-new-apis/daemon-api/telephony/daemon-api-telephony/</a>, except that we will need to replace <code>localhost</code> with <code>localhost:8081</code>. Note that the documentation is for KaiOS 3.0, but on 2.5 only the <code>telephony</code>, <code>libsignal</code> (for WhatsApp) and <code>tcpsocket</code> services are available. You can also look at the api-daemon <a href="https://github.com/kaiostech/api-daemon" rel="nofollow">source code</a>, which is also only for KaiOS 3.0.</p>

<h4 id="first-we-need-to-set-up-a-sess-variable-that-stores-the-api-daemon-session" id="first-we-need-to-set-up-a-sess-variable-that-stores-the-api-daemon-session">First, we need to set up a <code>sess</code> variable that stores the api-daemon session:</h4>

<pre><code class="language-javascript">var sess = new lib_session.Session();
</code></pre>

<h4 id="then-we-write-some-handlers-that-get-called-when-the-session-connects-disconnects" id="then-we-write-some-handlers-that-get-called-when-the-session-connects-disconnects">Then, we write some handlers that get called when the session connects/disconnects:</h4>

<pre><code class="language-javascript">function onsessionconnected(){
  lib_telephony.TelephonyService.get(sess).then(function(service){
    /* handle session connect */
  });
}
function onsessiondisconnected(){
  /* handle session disconnect */
}
</code></pre>

<h4 id="and-after-that-we-try-connecting" id="and-after-that-we-try-connecting">And after that we try connecting.</h4>

<pre><code class="language-javascript">sess.open(&#39;websocket&#39;, &#39;localhost:8081&#39;, &#39;secrettoken&#39;,
  {onsessionconnected, onsessiondisconnected}, true);
</code></pre>

<h4 id="here-is-the-final-code" id="here-is-the-final-code">Here is the final code:</h4>

<p><code>daemon-test.js</code></p>

<pre><code class="language-javascript">window.onerror = function(e){
  // Error handling
  alert(e);
}

var sess = new lib_session.Session();
var el_state = document.getElementById(&#39;callstate&#39;);
var toggleCallState = null;

function callStateChangeCallback(state){
  el_state.textContent = state;
}

// Set up session callbacks
var onsessionconnected = function(){
  alert(&#39;Session connected&#39;);
  // Get an instance of the telephony manager
  lib_telephony.TelephonyService.get(sess).then(function(manager){
    alert(&#39;Got Telephony manager&#39;);
    try {
      // Show the call state
      manager.callState.then(function(state){
        el_state.textContent = &#39;Call state: &#39; + state;
      });

      // Show it again if it changes
      manager.addEventListener(manager.CALLSTATE_CHANGE_EVENT, function(state){
          el_state.textContent = &#39;Call state: &#39; + state;
      });

      toggleCallState = function(){
        // Get the call state
        manager.callState.then(function(state){
          // Set the call state
          manager.callState = state ? 0 : 1;
          alert(state ? &#39;Idle&#39; : &#39;Calling&#39;);
        });
      }
    } catch(e) {
      alert(e);
    }
  }).catch(function(e){
    alert(&#39;Failed to get Telephony manager: &#39; + JSON.stringify(e));
    toggleCallState = null;
  });
}
var onsessiondisconnected = function(){
  alert(&#39;Disconnected&#39;);
  toggleCallState = null;
}

// Initialize the api-daemon session
sess.open(&#39;websocket&#39;, &#39;localhost:8081&#39;, &#39;secrettoken&#39;,
  {onsessionconnected, onsessiondisconnected}, true);

window.addEventListener(&#39;keydown&#39;, function(e){
  if(e.key == &#39;Call&#39;){
    // Toggle the state if &#39;Call&#39; is pressed and the session is ready
    if(typeof toggleCallState === &#39;function&#39;) toggleCallState();
  }
});
</code></pre>

<p>There is a lot more to this. I will also make a wiki page, and some more posts about things such as the <code>updater-daemon</code> and remote services.</p>

<p>More tags: #ApiDaemon</p>
]]></content:encoded>
      <author>affe-null</author>
      <guid>https://blog.bananahackers.net/read/a/8dm3uanfnv</guid>
      <pubDate>Sat, 08 May 2021 10:20:26 +0200</pubDate>
    </item>
  </channel>
</rss>