This repository has been archived by the owner on Nov 17, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 601c809
Showing
12 changed files
with
110 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"manifest_version": 2, | ||
"name": "Rclone decrypter", | ||
"description": "This extension allows the user to decrypt filenames encrypted by Rclone.", | ||
"version": "1.0", | ||
|
||
"browser_action": { | ||
"default_icon": { | ||
"16": "/images/icons/16x16.png", | ||
"19": "/images/icons/19x19.png", | ||
"24": "/images/icons/24x24.png", | ||
"32": "/images/icons/32x32.png", | ||
"38": "/images/icons/38x38.png" | ||
} | ||
}, | ||
"options_page": "/src/options.html", | ||
"content_scripts": [ | ||
{ | ||
"matches": ["https://drive.google.com/drive/*"], | ||
"js": ["/lib/rclone-js/rclone.js", "/src/apps/gdrive.js"] | ||
} | ||
], | ||
"icons": { | ||
"16": "/images/icons/16x16.png", | ||
"48": "/images/icons/48x48.png", | ||
"128": "/images/icons/128x128.png" | ||
}, | ||
"permissions": [ | ||
"storage" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
chrome.storage.sync.get(['password', 'salt'], passwords => { | ||
|
||
const decryptor = rclone.Rclone(passwords).then(o => o.Path.decryptName) | ||
|
||
const decryptElement = (el) => | ||
decryptor.then(decrypt => { | ||
el.innerText = decrypt(el.innerText) | ||
el.classList.add('rclone-decrypted') | ||
}) | ||
|
||
const FILE_NAMES = 'span[data-is-doc-name="true"]:not(.rclone-decrypted)' | ||
const PARENT_FOLDERS = '[data-target="folder"]:not(.rclone-decrypted)' | ||
const CURRENT_FOLDER = '[guidedhelpid="folder_path_button"] > div > div:not(.rclone-decrypted)' | ||
|
||
const decryptAllFileAndFolderNames = () => document.querySelectorAll([FILE_NAMES, PARENT_FOLDERS, CURRENT_FOLDER].join(', ')).forEach(decryptElement) | ||
|
||
const btn = document.createElement('button') | ||
btn.classList.add('rclone-decrypt') | ||
btn.innerText = 'Rclone Decrypt' | ||
btn.addEventListener('click', decryptAllFileAndFolderNames) | ||
|
||
document.querySelector('[aria-label="New"]').insertAdjacentElement('afterend', btn) | ||
|
||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Rclone Decrypter</title> | ||
<link rel="stylesheet" href="/lib/material-design-lite/material.light_blue-blue.min.css" /> | ||
<style> | ||
body { margin: 0 20px; } | ||
.mdl-textfield { width: 500px; } | ||
</style> | ||
</head> | ||
<body> | ||
<h1>Rclone file name decryptor</h1> | ||
<h3>Enter passwords from <code>rclone.conf</code> to decrypt</h2> | ||
<form> | ||
<div> | ||
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label"> | ||
<input class="mdl-textfield__input" id="password"> | ||
<label class="mdl-textfield__label" for="password">Password 1</label> | ||
</div> | ||
<div> | ||
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label"> | ||
<input class="mdl-textfield__input" id="salt"> | ||
<label class="mdl-textfield__label" for="salt">Password 2 (Salt)</label> | ||
</div> | ||
</div> | ||
<div class="submit"> | ||
<button class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--accent">Save</button> | ||
</div> | ||
</form> | ||
<script src="/lib/material-design-lite/material.min.js"></script> | ||
<script src="/options.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
document.addEventListener('DOMContentLoaded', () => { | ||
restoreOptions() | ||
|
||
document.querySelector('form').addEventListener('submit', evt => { | ||
evt.preventDefault() | ||
saveOptions(collectOptions(evt.target)) | ||
}) | ||
}) | ||
|
||
const collectOptions = form => ({ | ||
password: form.elements.password.value, | ||
salt: form.elements.salt.value | ||
}) | ||
|
||
const saveOptions = options => chrome.storage.sync.set(options) | ||
|
||
const restoreOptions = () => chrome.storage.sync.get(['password', 'salt'], | ||
({ password, salt }) => { | ||
document.querySelector('#password').parentNode.MaterialTextfield.change(password) | ||
document.querySelector('#salt').parentNode.MaterialTextfield.change(salt) | ||
} | ||
) |