Skip to content

Instantly share code, notes, and snippets.

@cpuuntery
Last active April 1, 2022 21:16
Show Gist options
  • Save cpuuntery/84b1e99656d45db0b11f3222c19bb590 to your computer and use it in GitHub Desktop.
Save cpuuntery/84b1e99656d45db0b11f3222c19bb590 to your computer and use it in GitHub Desktop.
var db = window.indexedDB.open("/tdlib/dbfs", 21);
db.onsuccess = function(e) {
var db = e.target.result;
var databaseout = db.transaction(["FILE_DATA"]).objectStore("FILE_DATA").index('timestamp').getAll()
databaseout.onsuccess = function(e) {
databaseoutput = e.target.result}
};
press enter
copy(databaseoutput[3]["contents"])
Minify the JSON output by
1- Regex it in notepad++ with and don't copy the spaces (no spaces)
Find: \"(.*?)\":
Replace: nothing leave it empty
2- remove leading spaces by
Edit -> Blank Operations -> Trim Leading and Trailing Space
3- Convert multi line to single line (regex mode)
Find:\R
Replace: nothing leave it empty
remove {} and replace it with []
var db;
var openRequest = indexedDB.open("/tdlib/dbfs", 21);
openRequest.onsuccess = function(e) {
db = e.target.result;
modifyvalue()}
function modifyvalue() {
var transaction = db.transaction(['FILE_DATA'], 'readwrite');
var store = transaction.objectStore('FILE_DATA');
var item = {
"timestamp": "2020-11-28T10:47:00.404Z",
"mode": 33152,
"contents": ""}
item["contents"] = new Uint8Array(paste the array here);
db.transaction(['FILE_DATA'], 'readonly')
var modify = store.put(item,'/tdlib/dbfs/td.binlog');
}
var haveibeenexecuted = localStorage["auth"];
if (haveibeenexecuted != "{\"@type\":\"authorizationStateReady\"}"){
setTimeout(function(){
var db;
var openRequest = indexedDB.open("/tdlib/dbfs", 21);
openRequest.onsuccess = function(e) {
db = e.target.result;
modifyvalue()}
function modifyvalue() {
var transaction = db.transaction(['FILE_DATA'], 'readwrite');
var store = transaction.objectStore('FILE_DATA');
var item = {
"timestamp": "2020-11-28T10:47:00.404Z",
"mode": 33152,
"contents": ""}
item["contents"] = new Uint8Array([]);
db.transaction(['FILE_DATA'], 'readonly');
var modify = store.put(item,'/tdlib/dbfs/td.binlog');
};
location.reload();
}, 7000);};
function notifyMe() {
var notification = new Notification('telegram', {
icon: 'https://i.postimg.cc/zvbMkxHZ/telegram-app-158.png',
body: 'You received a message',
});
notification.onclick = function() {
window.open('https://evgeny-nadymov.github.io/telegram-react/');
};
function playSound(url) {
const audio = new Audio(url);
audio.play();
}
playSound('https://web.telegram.org/z/notification.mp3')
};
function playSound(url) {
const audio = new Audio(url);
audio.play();
}
playSound('https://web.telegram.org/z/notification.mp3')
setInterval(() => {if(document.querySelector("div.dialog-badge") !== null){notifyMe()}}, 5000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment