diff --git a/app/src/main/assets/help.html b/app/src/main/assets/help.html index 91067a8..88fd371 100644 --- a/app/src/main/assets/help.html +++ b/app/src/main/assets/help.html @@ -48,6 +48,7 @@

Snow10 messages are meant to be embedded elsewhere, specifically within or by standard blocks of text.

Messages with the 'zero width characters' setting work in most places that accept unicode input.

Simply enter the message you want to hide (waring: larger messages are more noticeable, and really massive messages may be dangerous/not work)

+

Optionally put a message in the "Text to hide inside" (this is the parent message that is visible).

You can uncheck 'use zero width characters' but this is more noticeable in some cases and is more likely to be stripped out.

Enable encryption to ensure your messages are protected (you must use a good password if you do so).

Press 'encode' and wait for the output window to show, then, press 'copy to clipboard'.

diff --git a/app/src/main/assets/index.html b/app/src/main/assets/index.html index fc12f55..2041c46 100755 --- a/app/src/main/assets/index.html +++ b/app/src/main/assets/index.html @@ -62,7 +62,7 @@

Help & Info

- +

Bytes: 0


@@ -73,7 +73,7 @@


- +

diff --git a/app/src/main/assets/main.js b/app/src/main/assets/main.js index a7b3ad2..96a104d 100755 --- a/app/src/main/assets/main.js +++ b/app/src/main/assets/main.js @@ -18,6 +18,8 @@ AndroidFunction.share($('#output').val()); $.bootstrapGrowl('shared', {type: 'success'}) }); + + function split2(str, delim) { var parts=str.split(delim); return [parts[0], parts.splice(1,parts.length).join(delim)]; @@ -42,6 +44,9 @@ function byteCountt(s) { $('#text').on('input', function(){ $('#countBytes').text(byteCountt($('#text').val())); + if ($('#countBytes').text() >= 25000){ + showError('Warning: this message may cause issues due to its size.'); + } }); function showError(msg){ @@ -187,11 +192,17 @@ function go(mode) { output = textToBin(encodeURIComponent(input)); output = replaceAll(replaceAll(output.toString(), "1", one), "0", zero); coverText = $('#visibleText').val(); - coverText = split2(coverText); - partOne = coverText[0]; - partTwo = coverText[1]; - $('#output').val(partOne + output + partTwo); - console.log(partOne + output + partTwo); + if (zero == w_zero){ + output = coverText + output; + } + else{ + coverText = split2(coverText); + partOne = coverText[0]; + partTwo = coverText[1]; + output = partOne + output + partTwo; + } + $('#output').text(output); + console.log('Output: ' + output); } else { diff --git a/app/src/main/java/net/chaoswebs/snow10/MainActivity.java b/app/src/main/java/net/chaoswebs/snow10/MainActivity.java index 62248d0..ad0a11e 100644 --- a/app/src/main/java/net/chaoswebs/snow10/MainActivity.java +++ b/app/src/main/java/net/chaoswebs/snow10/MainActivity.java @@ -27,22 +27,6 @@ public class MainActivity extends AppCompatActivity { You should have received a copy of the GNU General Public License along with this program. If not, see . */ -/* - public class JavascriptInterface{ - Context mContext; - - JavascriptInterface(Context c) { - mContext = c; - } - - public void share(String action){ - Intent intent2 = new Intent(); intent2.setAction(Intent.ACTION_SEND); - intent2.setType("text/plain"); - intent2.putExtra(Intent.EXTRA_TEXT, action ); - startActivity(Intent.createChooser(intent2, "Share via")); - } - } - */ public class JavaScriptInterface { Context mContext; @@ -55,10 +39,11 @@ public class MainActivity extends AppCompatActivity { /** Show a toast from the web page */ @JavascriptInterface public void share(String action){ - Intent intent2 = new Intent(); intent2.setAction(Intent.ACTION_SEND); - intent2.setType("text/plain"); - intent2.putExtra(Intent.EXTRA_TEXT, action ); - startActivity(Intent.createChooser(intent2, "Share via")); + Intent sendIntent = new Intent(); + sendIntent.setAction(Intent.ACTION_SEND); + sendIntent.putExtra(Intent.EXTRA_TEXT, action); + sendIntent.setType("text/plain"); + startActivity(sendIntent); } }