VioletNote
Copyright 2024, Yoshiaki Watanabe
This is a notepad application having the encryption function. This treats plain text without decorations and saves it as a file. When changing setting, it displays the result of Markdown syntax. It can create and send the encrypted note including images.
This software is distributed with no guarantee. Even if damage/disadvantage relating to this software occurs, we do not take responsibility.
This software uses the following library distributed under Mozilla Public License 1.1 (https://www.mozilla.org/en-US/MPL/1.1/)
This software uses the following library distributed under the Apache License, Version 2.0 (https://www.apache.org/licenses/LICENSE-2.0)
This software uses the following library distributed under GNU General Public License v2.0 (https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)
This software collects no personal data of users.
This software uses services identifying the user. The service policies are described in the service sites (Google Play Services, AdMob).
This software does not include special processing that needs permission request at runtime.
The application is started by touching the application icon. It is finished by touching the back key. At start, following main screen is displayed.
This is the screen displayed at first.
It displays the file list of the 'app-specific storage'.
The list is blank just after the installation.
Addition of a new file is performed by touching the icon in the lower right corner.
When touching a file, the viewer is shown.
When long-touching a file, the filer is shown.
When touching [Shared Storage ⇒] at the screen top,
the 'shared storage' is shown by using SAF (Storage Access Framework).
(The SAF can be used without storage access priviledge, but provides the basic standard UI only).
The icon
is the sort function.
The icon
is the more menu.
Menu in Main Screen | |
---|---|
Sort | Select the display order of file list |
New | Open a new file |
Settings | Show Settings |
Filer | Show Filer |
Trash Can | Show Trash Can |
Help | Show this Web page |
Version | Show the application version |
Remove Ads | Remove the advertisement |
Data files are stored in the app-specific storage or the shared storage.
The app-specific storage cannot access from outside and after uninstallration. If you want to access data files from other applications or after uninstallation, save data to the shared storage or export data files in Filer.
The files in the shared storage can be accessed from outside and can be held after uninstallation. But filer functions (e.g., delete, copy, make folder,...) for the shared storage is not implemented in this application. Use other applications such as 'Files by Google'.
This screen is shown when a file is touched in the main screen.
The text is un-editable in the viewer.
The icon is the editor.
The icon
is the text search.
When cipher text file is selected, the password input is requested.
The password is not requested during the specified time after entered once.
When the text is long-touched, a menu is shown. The menu items "Adjust Range", "Scripts", and "Transliterate" are added ("Transliterate" is from Android 10) at range selection.
The item "Adjust Range" shows buttons for adjusting text selection range. The above row includes close button, information, button to go to carriage return, button to exchange the range edges, and mode toggle (Stretch/Move). The below row includes buttons of cursor movement.
The item "Scripts" shows the dialog for script processing of the selected text. When selecting a script from the list, the processing result is shown in the "Result" field. The "Copy" button copys the result to the system clipboard. For more details, refer the section "About Script".
The item "Transliterate" shows the dialog for transliterating characters in the text selection range. When selecting "Conversion Type" (e.g., "Katakana-Latin") from the list, conversion result is shown in the "Result" field. The "Copy" button copys the result to the system clipboard.
Menu in Viewer | |
---|---|
Editor | Show editor |
Search | Execute text search. Can be enabled the regular expression search and case sensitive search from ![]() |
This screen is shown when the icon is touched in the lower right corner of the main screen
or when the icon
is touched in the viewer.
The text is editable in the editor.
The icon
is undo.
The icon
is redo.
The icon
is the more menu.
If cipher text file is selected at saving a new file, password setting is requested. The password is not requested during the specified time after entered once. The password is independent for each file. If the password is lost, the file cannot be opened forever.
When the text is long-touched, a menu is shown. The added menu items are similar to the Viewer, Though the "Paste" button is added to the "Transliterete" dialog.
Menu in Editor | |
---|---|
Undo | Cancel the previous editor action |
Redo | Cancel the previous undo action |
Search and Replace | Execute text search and replace. Can be enabled the regular expression search and case sensitive search from ![]() |
Embed Image | Embed the selected image (shown if the markup syntax is Markdown) |
Close without Save | Close the editor without the saving action. The modified text is discarded. |
Save and Close | Save the editing text and close the editor. |
SaveAs and Close | Save the editing text with a new name, and close the editor. |
Change Password and Close | Change password, save and close (displayed in cipher text). |
This screen is shown when long-touching a file, or when the [Filer] is selected
from the more menu of the main screen.
The icon
is the sort function.
The icon
is the more menu.
The filer can execute functions about files in the app-specific storage such as copy, delete, rename,
share, make-folder, export, import, backup and restore.
This [share] means the sending function.
Also the text data sent from other application can be recieved by this application.
This does not include filer functions for the shared storage. Use other application such as 'Files by Google'.
Buttons in Filer | |
---|---|
Copy | Copy selected files |
Rename | Rename a selected file |
Delete | Delete selected files. The deleted files are held in the trash can |
Share | Send selected files by using the Share function |
Others | Show other filer commands. |
- Create Folder | Create sub-folder under the displayed folder |
- Export | Copy files selected from the file list to the shared storage |
- Import | Copy files selected from the shared storage to the app-specific storage |
- Backup | Put all files together and create an archive file in the shared storage |
- Restore | Expand the archive file to the app-specific storageF (warning: existing files are over-written) |
- Reload Scripts | Reload sample scripts to the scripts folder ".scripts". |
Menu in Filer | |
---|---|
Sort | Select the display order of file list |
Select All | Check all files in the file list |
Deselect All | Clear checking of all files in the file list |
This screen is shown when the [Trash Can] is selected
from the more menu of the main screen.
The list of deleted files in the app-specific storage is shown.
The icon
is the sort function.
The icon
is the more menu.
Files in the trash are deleted automatically after a specified period.
The deleted files can be put back to tne original folder by touching [Restore] button.
The name of the trashed file is like [.trash1234567890_note.txt].
The number [1234567890] is the timestamp of deletion, and the following text [note.txt] is the original file name.
Buttons in Trash Can | |
---|---|
Restore | Restore selected files to the original folder |
Delete Forever | Delete selected files completely |
Menu in Trash Can | |
---|---|
Sort | Select the display order of the file list |
Select All | Check all files in the file list |
Deselect All | Clear checking of all files in the file list |
This screen is shown when the [Settings] is selected
from the more menu of the main screen.
This screen set various settings of this application.
The icon
is the more menu.
Setting Items | |
---|---|
Default File Type | Default file type when creating a new file. |
Password Re-request Time (Sec) | Password is not requested in this period. |
Password at Return | If On, the password is re-requested when the application is returned from back-ground to fore-ground. |
Viewer Text Size | The text display size in the viewer. |
Editor Text Size | The text display size in the editor. |
Word Wrap in Viewer | If On, the overflowed text in the viewer is shown on the next line. |
Word Wrap in Editor | If On, the overflowed text in the editor is shown on the next line. |
Show File Details | If On, update-time and file-size ara shown in the file list. |
Trash Retention Period (Days) | The trash is deleted automatically after this period. |
Color Theme | The screen color. In [System Default], it depends on the Dark/Light mode setting of the system. |
Markup Syntax | Markup syntax interpreted in the viewer. Default is None. |
Embedded Image Size | When embedding an image, it is shrunk to fit the height and the width in this size. |
IMG Tag Options at Embedding Image | IMG tag option string used at embedding an image. |
CharSet of .txt | The CharSet of [.txt] file. Default is UTF-8. |
Is Detect CharSet of .txt | If On, detect the CharSet automatically at reading [.txt] file (at writing, above CharSet is used). |
CharSet of .chi | The CharSet of [.chi] file. Default is UTF-8 |
Is Detect CharSet of .chi | If On, detect the CharSet automatically at reading [.chi] file (at writing, above CharSet is used). |
Show Scripts Folder | If On, show the folder of Script files ".scripts" in the Filer. |
Menu in Settings | |
---|---|
Reset Settings | Reset application settings to initial values. |
Following is the Java source code to encrypt and decrypt [.vlnt] file.
public String encrypt(String key, byte[] source) throws Exception { String iv = RandomStringUtils.randomAlphanumeric(16); // Initial_value byte[] keyDigest = MessageDigest.getInstance("MD5").digest(key.getBytes()); SecretKeySpec sksSpec = new SecretKeySpec(keyDigest, "AES"); IvParameterSpec ivSpec = new IvParameterSpec(iv.getBytes()); javax.crypto.Cipher cipher = javax.crypto.Cipher.getInstance("AES/CBC/PKCS7Padding"); cipher.init(javax.crypto.Cipher.ENCRYPT_MODE, sksSpec, ivSpec); String encodedStr = new String(Base64.encodeBase64(cipher.doFinal(source))); // return Encode_version(4btyes) + Initial_value(16bytes) + Base64_encoded_str return "VN01" + iv + encodedStr; } public String decrypt(String key, byte[] source) throws Exception { // source : Encode_version(4bytes) + Initial_value(16bytes) + Base64_encoded_content String version = new String(source, 0, 4); if(!version.equals("VN01")) { throw new UnsupportedEncodingException("Unsupported VioletNote encoding."); } byte[] iv = Arrays.copyOfRange(source, 4, 20); // Initial_value byte[] content = Arrays.copyOfRange(source, 20, source.length); byte[] keyDigest = MessageDigest.getInstance("MD5").digest(key.getBytes()); SecretKeySpec sksSpec = new SecretKeySpec(keyDigest, "AES"); IvParameterSpec ivSpec = new IvParameterSpec(iv); javax.crypto.Cipher cipher = javax.crypto.Cipher.getInstance("AES/CBC/PKCS7Padding"); cipher.init(javax.crypto.Cipher.DECRYPT_MODE, sksSpec, ivSpec); return new String(cipher.doFinal((Base64.decodeBase64(content)))); }
The [.vlnt] file performs Base64 encoding after AES encryption. Thus it includes printable 64 characters only. When the file is not modified and the extension is only changed from [.vlnt] to [.txt], the encoded text can be treated in many applications.
By using Android application [Clipboard From/To](Ver.1.17.5 or later), the clear text can be obtained by the following process.
For [.chi] file, please search Web sites describing about Tombo/Kumagusu.
In default, this application treats the plain text without decorations. If you need eye-catching markers, use the Emoji.
If more various text expressions are necessary, select Markdown or HTML in [Menu > Settings > Markup Syntax]. The viewer displays the result of the syntax interpretation. For the implementation of Markdown syntax, the library Markwon (includes core, ext-tables, ext-strikethrough, ext-tasklist, image and html) is used. For the implementation of HTML syntax, Html.fromHtml in Android API is used. Please refer to the each site for details.
The image is described as the URL-link or MIME-embedding, and it can be displayed in the Markdown mode only. Coloring of the text and back-ground can be displayed in the HTML mode only.
For MIME-embedding, the item [Embed Image] is added to the option menu of the editor, when Markdown mode is selected. The item [Embed Image] inserts following string to the cursor position.
<img alt="?" width="25%" src="__embN__"/>Do not modify the string [src="__embN__"]. The editor creates MIME-images at the start and holds them in the application memory with the key [__embN__] (cleared at the end). The number N is the serial number in the note. But [alt="?" width="25%"] can be modified freely (Default string exists as a settings item). For example, if you change 25% to 100%, the image is shown in the full screen width.
The URL-link image is described directly as follows.

or
<img alt="sample" width="25%" src="https://foo.bar.com/xxx.jpg">
When touching a image in the viewer, the image viewer is started. It supports zooming image and saving image.
This application can be switched to the regular expression search from the option in the search bar.
In the regular expression search, longest match is executed
(Eg., when the search text is "a.*c" and the content text "bcabcabcab", the search matchs to "abcabc").
And groups can be described in the replace string
(Eg., when the search text is "a(.)(.)b" and the replace text is "p$2$1q", the content text "axyb" is replaced to "pyxq").
The help screen does not support the regular expression search.
The regular expression search is implemented by using Pattern/Matcher of java.util.regex package. Please use the regular expressions interpretable by the package.
Scripts are described with JavaScript, and stored in the ".script" folder of the application specific storage. To view the script folder, enable "Show Scripts Folder" in the Settings.
The script is selected form the menu shown by long-touching the text. At start up, the selected text is set to the JavaScript variable "selectedText". At the end, the value of the JavaScript variable "resultText" is set to the "Result" field of the dialog. For example, the following script gets the text converted to uppercase of the selected text.
resultText = selectedText.toUpperCase();
The script is available only for the text processing. No device control function exists. The Rhino is used for JavaScript processing.
Please send questions and bug reports to the following mail address.
watanaby00@yahoo.co.jp
Following web page has been prepared. It includes this HELP. Use it for browsing in PC.
https://violetnote-5ff6d.web.app/en/