[User Guide] Plugin overview and examples

Post Reply
MCADevelopment
Posts: 28
Joined: Tue Sep 18, 2018 6:23 am

[User Guide] Plugin overview and examples

Post by MCADevelopment » Wed Oct 24, 2018 10:25 am

The MCA Pro's plugin framework is designed to import your code as input/output module in encode/decode Morse code flow.

For an example, the result of decoding Morse code is always printed on screen by MCA. With decode-output plugin, you can parse the result and get password, or link to a web site, etc.
For an example, you can encrypt the plain text with encode-input plugin before convert it to Morse code. Then, the cyphered text can be decoded back to plain text in decode-output plugin.
For an example, you can send Morse code by your device which is controlled by encode-output plugin. Or you can receive Morse code from your device which is controlled by decode-input plugin, then use MCA to decode it.

The folders to place plugins
\Music\MorseCodeAgent\Plugin\EncodeInput: for encode-input plugins
\Music\MorseCodeAgent\Plugin\EncodeOutput: for encode-output plugins
\Music\MorseCodeAgent\Plugin\DecodeInput: for decode-input plugins
\Music\MorseCodeAgent\Plugin\DecodeOutput: for decode-input plugins

*When any plugin is added or removed, remove the MCA Pro from recent Apps button and restart it. Otherwise the plugin may no be updated due to the cache.


To create your own plugin, you need:
1. Android Studio
2. PluginIF.jar (the attached file of this post)

How to write a MCA plugin, pleaser refer: https://morsecodeagent.com/viewtopic.php?f=6&t=541


Here is the pseudo code of encode flow:

encode-input.stop();
encode-output.stop();
encode-input.start();
encode-output.start();

boolean bAppend = false;

do {
inputStr = encode-input.getInputString();
morseCode = MCAPro.encodeToMorseCode(inputStr);
encode-output.handleOutput(morseCode, bAppend);

bAppend = encode-input.hasMoreInput();
} while (bAppend);




Here is the pseudo code of decode flow:

Input thread:

decode-input.start();
inputBuf = new short[bufSize];

do {
inputSize = decode-input.getInput(inputBuf, bufSize);
if (inputSize != bufSize) {
for (i = inputSize; i < bufSize; i++) {
inputBuf = 0;
}
}

MCAPro.decode(inputBuf);

bHasMoreData = decode-input.hasMoreInput();
} while (bHasMoreData);




Output thread:

decode-output.start();
boolean bAppend = false;

while (!bStopGetting) {
resultStr = MCAPro.getResult();
if resultStr != null) {
decode-output(resultStr, bAppend);
}
};





.
You do not have the required permissions to view the files attached to this post.

MCADevelopment
Posts: 28
Joined: Tue Sep 18, 2018 6:23 am

Re: [User Guide] Plugin overview and examples

Post by MCADevelopment » Wed Oct 24, 2018 11:00 am

Encode-Output plugin example - PrintTextOnScreen

This is the simplest plugin example.
What this plugin do is just printing the encoded Morse code string on screen.

printtextonscreen.apk must be put into \Music\MorseCodeAgent\Plugin\EncodeOutput
PrintTextOnScreen.7z is the source code.
You do not have the required permissions to view the files attached to this post.

MCADevelopment
Posts: 28
Joined: Tue Sep 18, 2018 6:23 am

Re: [User Guide] Plugin overview and examples

Post by MCADevelopment » Wed Oct 24, 2018 11:04 am

Encode-Input plugin example - TextInputWithSimpleEncrypt

This plugin encrypts text before convert it to Morse code.
This plugin must works with the plugin: DecodeSimpleEncryption

TextInputWithSimpleEncrypt.apk must be put into \Music\MorseCodeAgent\Plugin\EncodeInput
TextInputWithSimpleEncrypt.7z is the source code.
You do not have the required permissions to view the files attached to this post.

MCADevelopment
Posts: 28
Joined: Tue Sep 18, 2018 6:23 am

Re: [User Guide] Plugin overview and examples

Post by MCADevelopment » Wed Oct 24, 2018 11:06 am

Decode-Output plugin example - DecodeSimpleEncryption

This plugin decodes the ciphered text which is encrypted by plugin: TextInputWithSimpleEncrypt.
This plugin must works with the plugin: TextInputWithSimpleEncrypt

DecodeSimpleEncryption.apk must be put into \Music\MorseCodeAgent\Plugin\DecodeOutput
DecodeSimpleEncryption.7z is the source code.
You do not have the required permissions to view the files attached to this post.

Post Reply