diff --git a/README.md b/README.md index eff82d6..cc4bd7f 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,19 @@ Interactive Math Pad ==================== -![preview](https://github.com/raw/jingkecn/myscript-iink-codelabs-android-kotlin/master/docs/images/app/math-pad/preview.gif) +This is a reproduction of [MyScript MathPad](https://www.myscript.com/retired-apps) on Android platform, based on [MyScript Interactive Ink SDK](https://www.myscript.com/interactive-ink). -> [!INFO] -> This is a reproduction of the retired MyScript MathPad for Android. +![preview](docs/images/preview.gif) + +> [!ACKNOWLEDGEMENTS] +> +> - [1] [MyScript Interactive Ink](https://www.myscript.com/interactive-ink)® +> - [2] [中國色](http://zhongguose.com/) > > [!DISCLAIMER] -> The software is for your study and reference only and the developer will not be responsible for its content. +> **The software is for your study and reference only and the developer will not be responsible for its content.** + +LICENSE +------- + +[MIT License](LICENSE). diff --git a/app/src/main/java/com/myscript/iink/app/mathpad/MainActivity.kt b/app/src/main/java/com/myscript/iink/app/mathpad/MainActivity.kt index 6ec7bab..ea74fb3 100644 --- a/app/src/main/java/com/myscript/iink/app/mathpad/MainActivity.kt +++ b/app/src/main/java/com/myscript/iink/app/mathpad/MainActivity.kt @@ -6,11 +6,111 @@ package com.myscript.iink.app.mathpad import android.os.Bundle import android.support.v7.app.AppCompatActivity +import android.view.Menu +import android.view.MenuItem +import android.view.View +import android.widget.Toast +import com.myscript.iink.* +import com.myscript.iink.extensions.convert +import com.myscript.iink.extensions.copyToClipboard +import com.myscript.iink.uireferenceimplementation.EditorView +import com.myscript.iink.uireferenceimplementation.FontUtils +import com.myscript.iink.uireferenceimplementation.InputController +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch -class MainActivity : AppCompatActivity() { +class MainActivity : AppCompatActivity(), IEditorListener { + + private lateinit var contentPart: ContentPart + private lateinit var editorView: EditorView override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) + (application as? MyApplication)?.contentPackage?.let { initWith(it) } + editorView = findViewById(R.id.editor_view).also { initWith(it) } + } + + private fun initWith(contentPackage: ContentPackage) = with(contentPackage) { + createPart("Math").let { contentPart = it } + } + + private fun initWith(view: EditorView) = with(view) { + (application as? IInteractiveInkApplication)?.engine?.let { + setEngine(it) + editor?.addListener(this@MainActivity) + inputMode = InputController.INPUT_MODE_FORCE_PEN + setTypefaces(FontUtils.loadFontsFromAssets(applicationContext.assets)) + post { + editor?.part = contentPart + visibility = View.VISIBLE + } + } + } + + override fun onDestroy() { + editorView.close() + contentPart.close() + super.onDestroy() } + + // region Implementations (options menu) + + override fun onCreateOptionsMenu(menu: Menu?): Boolean { + menuInflater.inflate(R.menu.activity_main, menu) + return super.onCreateOptionsMenu(menu) + } + + override fun onPrepareOptionsMenu(menu: Menu?): Boolean { + menu?.let { + editorView.editor?.run { + it.findItem(R.id.menu_clear)?.isEnabled = part?.isClosed == false + it.findItem(R.id.menu_redo)?.isEnabled = canRedo() + it.findItem(R.id.menu_undo)?.isEnabled = canUndo() + } + } + return super.onPrepareOptionsMenu(menu) + } + + override fun onOptionsItemSelected(item: MenuItem?): Boolean { + editorView.editor?.let { + // wait for the editor to be idle. + if (!it.isIdle) it.waitForIdle() + when (item?.itemId) { + R.id.menu_clear -> it.clear() + R.id.menu_convert -> it.convert() + R.id.menu_redo -> it.redo() + R.id.menu_undo -> it.undo() + R.id.menu_export_latex -> it.copyToClipboard(this, MimeType.LATEX) + R.id.menu_export_math_ml -> it.copyToClipboard(this, MimeType.MATHML) + else -> return@let + } + } + return super.onOptionsItemSelected(item) + } + + // endregion + + // region Implementations (IEditorListener) + + override fun contentChanged(editor: Editor?, blockIds: Array?) { + invalidateOptionsMenu() + } + + override fun partChanging(editor: Editor?, old: ContentPart?, new: ContentPart?) { + invalidateOptionsMenu() + } + + override fun partChanged(editor: Editor?) { + invalidateOptionsMenu() + } + + override fun onError(editor: Editor?, blockId: String?, message: String?) { + GlobalScope.launch(Dispatchers.Main) { + Toast.makeText(this@MainActivity, message, Toast.LENGTH_LONG).show() + } + } + + // endregion } diff --git a/app/src/main/java/com/myscript/iink/app/mathpad/MyApplication.kt b/app/src/main/java/com/myscript/iink/app/mathpad/MyApplication.kt index e37d6ad..6826517 100644 --- a/app/src/main/java/com/myscript/iink/app/mathpad/MyApplication.kt +++ b/app/src/main/java/com/myscript/iink/app/mathpad/MyApplication.kt @@ -6,6 +6,7 @@ package com.myscript.iink.app.mathpad import android.app.Application import com.myscript.certificate.MyCertificate +import com.myscript.iink.ContentPackage import com.myscript.iink.Engine import java.io.File @@ -15,6 +16,9 @@ class MyApplication : Application(), IInteractiveInkApplication { override lateinit var engine: Engine private set + lateinit var contentPackage: ContentPackage + private set + override fun onCreate() { super.onCreate() // Create MyScript interactive ink engine. @@ -33,11 +37,21 @@ class MyApplication : Application(), IInteractiveInkApplication { it.setString("content-package.temp-folder", "${filesDir.path}${File.separator}tmp") } } + val myPackageFile = File(filesDir, "$IINK_PACKAGE_NAME.iink") + try { + contentPackage = engine.createPackage(myPackageFile) + } catch (e: Exception) { + e.printStackTrace() + } } override fun onTerminate() { - // close MyScript iink runtime to release resources. + contentPackage.close() engine.close() super.onTerminate() } + + companion object { + private const val IINK_PACKAGE_NAME = "my_math_pad_package" + } } diff --git a/app/src/main/java/com/myscript/iink/extensions/Editor.kt b/app/src/main/java/com/myscript/iink/extensions/Editor.kt new file mode 100644 index 0000000..0e37968 --- /dev/null +++ b/app/src/main/java/com/myscript/iink/extensions/Editor.kt @@ -0,0 +1,33 @@ +/* + * Copyright (c) MyScript. All rights reserved. + */ + +package com.myscript.iink.extensions + +import android.content.ClipData +import android.content.ClipboardManager +import android.content.Context +import android.support.annotation.NonNull +import android.widget.Toast +import com.myscript.iink.Editor +import com.myscript.iink.MimeType +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch + +fun Editor.convert() = + getSupportedTargetConversionStates(null).firstOrNull()?.let { convert(null, it) } + +fun Editor.copyToClipboard(@NonNull context: Context, type: MimeType) = + export_(null, type).let { + GlobalScope.launch(Dispatchers.Main) { + (context.getSystemService(Context.CLIPBOARD_SERVICE) as? ClipboardManager)?.run { + primaryClip = ClipData.newPlainText(type.name, it) + Toast.makeText( + context, + "String ($type) copied to clipboard:\n$it", + Toast.LENGTH_LONG + ).show() + } + } + } diff --git a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml index c16e569..0cbcded 100644 --- a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml +++ b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -5,57 +5,60 @@ + android:viewportWidth="1024" + android:viewportHeight="1024"> + android:fillColor="#000000" + android:pathData="M280.62,309.23L280.62,293.77L541.24,293.77L570.54,394.31L552.02,394.31L532.57,335.72Q528.59,323.53 519.68,318.61Q511.01,313.45 484.52,313.45L367.1,313.45L507.49,496.97L507.49,506.58L352.34,665.95L539.37,665.95Q549.45,665.95 552.96,662.91Q556.71,659.86 558.82,650.95L574.05,597.28L592.57,597.28L555.77,731.11L279.68,731.11L279.68,714.47L453.12,537.28L280.62,309.23Z" /> + + android:fillColor="#009fe3" + android:pathData="M725.4,551.5c0.4,-0.3 0.4,-0.8 0.6,-1.3c2.1,-6.7 3.3,-13.7 4.5,-20.5c1.3,-7.7 2.2,-15.5 3,-23.2c1.6,-15.6 2.5,-31.4 3,-47.1c0.2,-3.5 0.7,-7.1 -0.5,-10.6c-1,-2.9 -4.4,-4.8 -7.5,-4.6c-3.1,0.2 -5.8,2.6 -6.5,5.5c-0.8,3.4 0,7.1 0.3,10.6c1.3,15.5 2.3,31.2 2.8,46.8c0.3,7.9 0.4,15.7 0.3,23.5c-0.1,6.7 -0.4,13.4 -1.3,20c-0.1,0.7 0.7,1.3 1.3,0.9z" /> + android:fillColor="#009fe3" + android:pathData="M522.8,596c1.6,1 4.1,1.2 6.7,0.9c2.7,-0.2 5.5,-0.9 8.2,-1.5c5.6,-1.3 11.4,-2.7 17.2,-3.8c11.9,-2.2 23.8,-4.2 35.8,-5.7c12.3,-1.4 24.7,-2.4 37.1,-2.9c12.1,-0.5 24.2,-0.6 36.3,-0.4c5.6,0 11.2,0.2 16.7,0.5c2.1,0.1 4.3,0.2 6.5,0.3c0.4,0 0.7,0 1,0c0.8,-0.1 0.9,-1.1 0.1,-1.4c-1.2,-0.4 -2.5,-0.3 -3.7,-0.5c-2.7,-0.4 -5.4,-0.7 -8.1,-1c-5.7,-0.6 -11.4,-1.2 -17.1,-1.7c-12,-1.1 -24.1,-1.7 -36.1,-1.9c-12.5,-0.2 -24.8,0.2 -37.3,0.9c-12,0.7 -24.1,1.9 -36,3.8c-5.6,0.8 -11.4,1.7 -17.1,2.8c-4.6,0.9 -9,1.5 -11.5,5.9c-1,2 -0.5,4.7 1.3,5.7z" /> + android:pathData="M693.5,546.7l-24.7,-33.6l23.3,-28.3h-17.6l-20.7,26.2v-57.5l-15.7,2.5v92.1h15.7v-31.3l23.2,32.2z" /> + android:pathData="M612.2,548.1h15.9v-45.6c0,-11.8 -6.3,-19 -18.1,-19c-8.5,0 -15.2,4.6 -21.1,10.2l-1.5,-8.9h-13.4v63.3h15.7v-42.7c4.6,-4.8 9.4,-8 14.4,-8c5.7,0 8.1,3.8 8.1,9.3z" /> + android:pathData="M547.8,548.1h15.6v-63.3h-15.6v63.3z" /> + android:pathData="M590.1,465.2c0,-5.2 -4.2,-9.4 -9.4,-9.4c-5.2,0 -9.4,4.2 -9.4,9.4c0,5.2 4.2,9.4 9.4,9.4c5.2,0 9.4,-4.2 9.4,-9.4z" /> + android:pathData="M565,465.2c0,-5.2 -4.2,-9.4 -9.4,-9.4c-5.2,0 -9.4,4.2 -9.4,9.4c0,5.2 4.2,9.4 9.4,9.4c5.2,0 9.4,-4.2 9.4,-9.4z" /> + android:pathData="M562.3,443.4h3l-1.2,-15.4h-3.7l-3.9,11.7l-3.9,-11.7h-3.8l-1.2,15.4h2.7l0.8,-11.3l3.9,11.3h2.6l3.9,-11.3l0.8,11.3z" /> + android:pathData="M576.4,432.6h-2.7l-2.4,7.5l-2.5,-7.7l-2.8,0.4l3.8,10.8l-0.2,0.7c-0.3,0.7 -0.9,1.1 -1.7,1.1c-0.6,0 -0.9,-0.1 -1.3,-0.2l0.4,2.2c0.3,0.1 0.5,0.1 1,0.1c2.1,0 3.3,-0.8 4.3,-3.5z" /> + android:pathData="M587.2,439c0,-2.4 -1.1,-3.5 -4.3,-4.8c-2.1,-0.8 -2.6,-1.3 -2.6,-2.3c0,-1 0.6,-1.7 2.1,-1.7c1.2,0 2.5,0.5 3.6,1.2l0.4,-2.7c-1.1,-0.5 -2.4,-0.9 -4.1,-0.9c-2.9,0 -5,1.6 -5,4.3c0,2.4 1.2,3.4 4.2,4.6c2.3,1 2.8,1.5 2.8,2.6c0,1.3 -0.9,1.9 -2.3,1.9c-1.6,0 -3.2,-0.6 -4.5,-1.4l-0.4,2.7c1.4,0.7 3,1.1 4.9,1.1c3,0 5.2,-1.6 5.2,-4.6z" /> + android:pathData="M597.1,442.6l-0.4,-2.3c-1,0.8 -1.9,1 -2.8,1c-1.6,0 -2.8,-1.1 -2.8,-3.3c0,-2.2 1.2,-3.3 2.7,-3.3c1,0 1.9,0.3 2.8,1l0.4,-2.4c-0.9,-0.5 -1.9,-0.9 -3.4,-0.9c-2.9,0 -5.2,1.9 -5.2,5.7c0,3.5 2.1,5.5 5.1,5.5c1.3,0 2.4,-0.3 3.6,-1z" /> + android:pathData="M605,435.1l-0.4,-2.7c-1.7,0.1 -2.8,1.1 -3.5,2.4l-0.3,-2.2h-2.3v10.8h2.7v-6.2c0.8,-1.2 2.2,-2.1 3.8,-2.1z" /> + android:pathData="M609.1,429.3c0,-1 -0.7,-1.6 -1.6,-1.6c-0.9,0 -1.6,0.7 -1.6,1.6c0,0.9 0.7,1.5 1.6,1.5c0.9,0 1.6,-0.7 1.6,-1.5zM606.1,443.4h2.7v-10.8h-2.7z" /> + android:pathData="M613.6,443.1v4.1l-2.7,0.4v-15h2.3l0.2,1.5c0.8,-0.9 1.8,-1.7 3.3,-1.7c2.3,0 4.1,1.7 4.1,5.3c0,4 -2.2,5.8 -4.7,5.8c-1,0 -1.9,-0.2 -2.5,-0.4zM616,434.7c-1,0 -1.7,0.6 -2.4,1.5v4.6c0.6,0.3 1.2,0.5 2.1,0.5c1.4,0 2.4,-1.1 2.4,-3.5c0,-2 -0.9,-3.1 -2.1,-3.1z" /> + android:pathData="M628,443.5l-0.3,-2.3c-0.2,0.1 -0.5,0.1 -0.8,0.1c-1,0 -1.4,-0.4 -1.4,-1.3v-5.1h2.5l-0.3,-2.2h-2.2v-3.8l-2.6,0.4v3.4h-1.5v2.2h1.5v5.5c0,2.4 1.5,3.2 3.6,3.2c0.8,0 1.3,-0.1 1.5,-0.1z" /> + android:pathData="M703.9,548.9c-3,0 -5.1,-2.1 -5.1,-5.2c0,-3.1 2.1,-5.2 5.1,-5.2c3,0 5.1,2.1 5.1,5.2c0,3.1 -2.1,5.2 -5.1,5.2zM703.9,539.1c-2.4,0 -4.3,1.7 -4.3,4.6c0,2.9 1.9,4.6 4.3,4.6c2.4,0 4.4,-1.7 4.4,-4.6c0,-2.9 -1.9,-4.6 -4.4,-4.6zM705.2,546.5l-1.5,-2.3h-0.4v2.2h-1.3v-5.7h2c1.3,0 2.1,0.6 2.1,1.7c0,0.8 -0.4,1.3 -1.1,1.6l1.5,2.3zM703.3,541.7v1.6h0.6c0.6,0 1,-0.3 1,-0.8c-0.1,-0.5 -0.4,-0.8 -1,-0.8z" /> diff --git a/app/src/main/res/drawable/ic_clear.xml b/app/src/main/res/drawable/ic_clear.xml new file mode 100644 index 0000000..0743d47 --- /dev/null +++ b/app/src/main/res/drawable/ic_clear.xml @@ -0,0 +1,14 @@ + + + + + diff --git a/app/src/main/res/drawable/ic_convert.xml b/app/src/main/res/drawable/ic_convert.xml new file mode 100644 index 0000000..04d4b2f --- /dev/null +++ b/app/src/main/res/drawable/ic_convert.xml @@ -0,0 +1,14 @@ + + + + + diff --git a/app/src/main/res/drawable/ic_export.xml b/app/src/main/res/drawable/ic_export.xml new file mode 100644 index 0000000..71a1819 --- /dev/null +++ b/app/src/main/res/drawable/ic_export.xml @@ -0,0 +1,14 @@ + + + + + diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml index 85efc6f..06ac429 100644 --- a/app/src/main/res/drawable/ic_launcher_background.xml +++ b/app/src/main/res/drawable/ic_launcher_background.xml @@ -5,9 +5,10 @@ diff --git a/app/src/main/res/drawable/ic_logo_iink.xml b/app/src/main/res/drawable/ic_logo_iink.xml new file mode 100644 index 0000000..82f76a2 --- /dev/null +++ b/app/src/main/res/drawable/ic_logo_iink.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_redo.xml b/app/src/main/res/drawable/ic_redo.xml new file mode 100644 index 0000000..223f00e --- /dev/null +++ b/app/src/main/res/drawable/ic_redo.xml @@ -0,0 +1,14 @@ + + + + + diff --git a/app/src/main/res/drawable/ic_undo.xml b/app/src/main/res/drawable/ic_undo.xml new file mode 100644 index 0000000..6ff0e7a --- /dev/null +++ b/app/src/main/res/drawable/ic_undo.xml @@ -0,0 +1,14 @@ + + + + + diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 1c69e25..dacfd38 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -5,6 +5,7 @@ --> + + diff --git a/app/src/main/res/menu/activity_main.xml b/app/src/main/res/menu/activity_main.xml new file mode 100644 index 0000000..4dcd6e5 --- /dev/null +++ b/app/src/main/res/menu/activity_main.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml index 6824835..96525d0 100644 --- a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -5,6 +5,6 @@ --> - - + + diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml index 6824835..96525d0 100644 --- a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -5,6 +5,6 @@ --> - - + + diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.png b/app/src/main/res/mipmap-hdpi/ic_launcher.png index a98a138..328b0d3 100644 Binary files a/app/src/main/res/mipmap-hdpi/ic_launcher.png and b/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.png b/app/src/main/res/mipmap-mdpi/ic_launcher.png index 34ca9b3..bc46265 100644 Binary files a/app/src/main/res/mipmap-mdpi/ic_launcher.png and b/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/app/src/main/res/mipmap-xhdpi/ic_launcher.png index 4b3eb36..50452bb 100644 Binary files a/app/src/main/res/mipmap-xhdpi/ic_launcher.png and b/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png index bbea1d0..3d56b84 100644 Binary files a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png index 36639e3..407f699 100644 Binary files a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index dcfa90c..76b86ec 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -5,7 +5,12 @@ --> - #009FE3 - #008DC9 + @color/chMudanfenhong + @color/chManjianghong @android:color/white + + + #a7535a + #eea2a4 + #f0c9cf diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 9716dfd..68ae282 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -3,5 +3,15 @@ --> - Interactive Math Pad + Interactive Math Pad + + Undo + Redo + Clear + Convert + Export As + LaTeX + Math ML + + All rights reserved. Powered by diff --git a/build.gradle b/build.gradle index c8fe179..71b3ad5 100644 --- a/build.gradle +++ b/build.gradle @@ -5,52 +5,52 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext { - android_plugin_version = '3.3.2' - kotlin_version = '1.3.21' - kotlinx_coroutines_version = '1.1.1' - } - repositories { - google() - jcenter() - } - dependencies { - classpath "com.android.tools.build:gradle:$android_plugin_version" - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files - } + ext { + android_plugin_version = '3.3.2' + kotlin_version = '1.3.30' + kotlinx_coroutines_version = '1.1.1' + } + repositories { + google() + jcenter() + } + dependencies { + classpath "com.android.tools.build:gradle:$android_plugin_version" + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + + // NOTE: Do not place your application dependencies here; they belong + // in the individual module build.gradle files + } } allprojects { - repositories { - google() - jcenter() - } - ext { - // configure versions used by dependencies to harmonize and update easily across all components - - // Android SDK - compileSdkVersion = 28 - minSdkVersion = 21 - targetSdkVersion = 28 - - // Android libraries - supportLibraryVersion = '28.0.0' - - // Android test libraries - testRunnerVersion = '1.0.2' - - // Supported ABIs for the native libraries (see below) - abiFilters = [] - - // iink version - iinkVersionCode = 1300 - iinkVersionName = '1.3.0' - } + repositories { + google() + jcenter() + } + ext { + // configure versions used by dependencies to harmonize and update easily across all components + + // Android SDK + compileSdkVersion = 28 + minSdkVersion = 21 + targetSdkVersion = 28 + + // Android libraries + supportLibraryVersion = '28.0.0' + + // Android test libraries + testRunnerVersion = '1.0.2' + + // Supported ABIs for the native libraries (see below) + abiFilters = [] + + // iink version + iinkVersionCode = 1300 + iinkVersionName = '1.3.0' + } } task clean(type: Delete) { - delete rootProject.buildDir + delete rootProject.buildDir } diff --git a/buildSrc/src/main/groovy/com/myscript/gradle/tasks/FetchRecognitionAssetsTask.groovy b/buildSrc/src/main/groovy/com/myscript/gradle/tasks/FetchRecognitionAssetsTask.groovy index fa13798..3c69ea0 100644 --- a/buildSrc/src/main/groovy/com/myscript/gradle/tasks/FetchRecognitionAssetsTask.groovy +++ b/buildSrc/src/main/groovy/com/myscript/gradle/tasks/FetchRecognitionAssetsTask.groovy @@ -17,24 +17,15 @@ class FetchRecognitionAssetsTask extends DefaultTask { void fetchRecognitionAssets() { // Thanks to https://gitreleases.dev/ def baseUrl = "https://gitreleases.dev/gh/jingkecn/myscript-iink-recognition-assets/latest" - def urls = [ - "$baseUrl/myscript-iink-recognition-diagram.zip", - "$baseUrl/myscript-iink-recognition-raw-content.zip", - "$baseUrl/myscript-iink-recognition-math.zip", - "$baseUrl/myscript-iink-recognition-text-en_US.zip" - ] + def urls = ["$baseUrl/myscript-iink-recognition-math.zip"] def intoDir = project.file("$project.projectDir/src/main/assets") if (!intoDir.isDirectory()) intoDir.mkdirs() - def diagramConf = project.file("$intoDir/conf/diagram.conf") - def rawContentConf = project.file("$intoDir/conf/raw-content.conf") def mathConf = project.file("$intoDir/conf/math.conf") - def enUSConf = project.file("$intoDir/conf/en_US.conf") - if (!diagramConf.exists() || !rawContentConf.exists() || !mathConf.exists() - || !enUSConf.exists()) { + if (!mathConf.exists()) { def fromDir = project.file("$intoDir/temp") if (!fromDir.isDirectory()) fromDir.mkdirs() diff --git a/certificate/src/main/java/com/myscript/certificate/MyCertificate.java b/certificate/src/main/java/com/myscript/certificate/MyCertificate.java index 9ecd0b8..b108a54 100644 --- a/certificate/src/main/java/com/myscript/certificate/MyCertificate.java +++ b/certificate/src/main/java/com/myscript/certificate/MyCertificate.java @@ -1,14 +1,614 @@ -/* - * Copyright (c) MyScript. All rights reserved. - */ - package com.myscript.certificate; +/** + * The MyCertificate class provides the bytes of the user + * certificate used to grant the access to the MyScript technologies. + */ public final class MyCertificate { + /** + * The bytes of the user certificate. + */ + private static final byte[] BYTES = new byte[]{ + 91, 63, -14, -6, 78, 43, 86, 34, + 52, -28, 76, -61, 68, -115, -71, 125, + -51, 24, 93, -127, 107, 81, -99, -11, + 114, 113, 50, 32, 84, -12, -58, -82, + 120, 109, 125, 119, -100, 114, -117, -8, + -102, -59, -117, 21, 127, -24, -12, 45, + 48, -74, 120, -3, -38, 20, -124, 10, + 59, -117, 48, -61, -19, 83, 30, 84, + 21, 71, 102, -15, -22, 113, -70, -49, + 103, 119, -57, -99, 101, 10, 103, 27, + -122, 58, 41, 116, -51, 38, 31, -65, + -84, 34, 67, 86, -18, -118, 14, 37, + -97, 18, -40, 111, -45, 54, 95, -84, + -92, -20, 125, 33, -88, -86, 94, -89, + -120, -9, 23, 63, -5, -67, 90, -46, + -37, -118, 91, 17, -105, -50, 56, -9, + 112, 60, 1, 13, 81, 127, 111, 115, + 7, -112, 74, -17, -82, 53, 66, 36, + -44, -13, -3, 96, 72, 105, 77, 79, + 4, -18, -64, -90, 66, 86, -118, 16, + -104, -71, -35, -63, -58, 9, -85, 94, + -109, -33, 123, -13, 7, -120, 0, -50, + -105, 45, 88, -101, -59, 27, -38, -97, + -58, -13, -34, -58, -98, -68, -104, -41, + -27, -104, 79, -11, -58, -65, -4, 3, + -7, -62, 35, 94, 15, 120, 91, 120, + 100, 88, -112, 110, 107, 127, 29, -42, + -108, -70, -31, -29, -60, -40, -14, 35, + -20, -109, -88, -41, 88, 23, 82, 14, + 46, -74, -6, 121, -12, 35, -4, -30, + 27, 59, 36, 126, 117, -13, 57, 10, + 79, 116, 43, 65, -61, -34, 31, -14, + 34, -89, 109, 30, -82, 72, 28, 65, + 124, 83, -42, 86, -102, -76, 55, -126, + 70, -91, 111, 30, 68, 18, -117, 66, + -80, 40, 69, 85, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + 103, -34, -15, 86, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + -125, 33, 14, -87, -101, -76, 55, -126, + 39, 70, -78, 28, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + 56, -91, 111, 30, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + -36, 90, -112, -31, 68, 18, -117, 66, + -64, 21, 101, 87, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + 103, -34, -15, 86, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + -125, 33, 14, -87, -101, -76, 55, -126, + -9, -39, 90, 27, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + 56, -91, 111, 30, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + -36, 90, -112, -31, 68, 18, -117, 66, + -6, -70, -103, 84, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + 103, -34, -15, 86, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + -125, 33, 14, -87, -101, -76, 55, -126, + -107, -28, -47, 27, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + 56, -91, 111, 30, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + -36, 90, -112, -31, 68, 18, -117, 66, + 96, -120, 70, 82, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + 103, -34, -15, 86, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + -125, 33, 14, -87, -101, -76, 55, -126, + 18, 41, -26, 31, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + 56, -91, 111, 30, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + -36, 90, -112, -31, 71, 18, -117, 66, + 125, 32, 18, 83, 70, -69, 55, -126, + 33, -91, 111, 30, -70, -19, 116, -67, + 103, -34, -15, 86, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + -125, 33, 14, -87, -104, -76, 55, -126, + 70, -97, 107, 28, -101, 29, -117, 66, + 120, -34, -15, 86, 101, 75, -56, 125, + 56, -91, 111, 30, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + -36, 90, -112, -31, 71, 18, -117, 66, + -100, -34, 5, 85, 120, -69, 55, -126, + 38, -91, 111, 30, -70, -19, 116, -67, + 103, -34, -15, 86, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + -125, 33, 14, -87, -104, -76, 55, -126, + 41, 61, -116, 28, -94, 29, -117, 66, + 120, -34, -15, 86, 101, 75, -56, 125, + 56, -91, 111, 30, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + -36, 90, -112, -31, 71, 18, -117, 66, + 39, -119, -112, 87, 113, -69, 55, -126, + 42, -91, 111, 30, -70, -19, 116, -67, + 103, -34, -15, 86, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + -125, 33, 14, -87, -104, -76, 55, -126, + -13, -109, -39, 29, -79, 29, -117, 66, + 118, -34, -15, 86, 101, 75, -56, 125, + 56, -91, 111, 30, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + -36, 90, -112, -31, 71, 18, -117, 66, + 4, 108, 39, 82, 100, -69, 55, -126, + 43, -91, 111, 30, -70, -19, 116, -67, + 103, -34, -15, 86, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + -125, 33, 14, -87, -104, -76, 55, -126, + -67, -43, 104, 31, 67, 2, -117, 66, + 123, -34, -15, 86, 101, 75, -56, 125, + 56, -91, 111, 30, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + -36, 90, -112, -31, 71, 18, -117, 66, + 101, -99, -65, 87, 113, -69, 55, -126, + 32, -91, 111, 30, -70, -19, 116, -67, + 103, -34, -15, 86, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + -125, 33, 14, -87, -104, -76, 55, -126, + -101, -47, 19, 27, 72, 2, -117, 66, + 116, -34, -15, 86, 101, 75, -56, 125, + 56, -91, 111, 30, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + -36, 90, -112, -31, 65, 18, -117, 66, + 33, -119, 4, 82, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + 103, -34, -15, 86, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + -125, 33, 14, -87, -98, -76, 55, -126, + -55, 8, -96, 29, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + 56, -91, 111, 30, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + -36, 90, -112, -31, 65, 18, -117, 66, + -87, -15, -80, 85, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + 103, -34, -15, 86, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + -125, 33, 14, -87, -98, -76, 55, -126, + 111, 78, 114, 29, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + 56, -91, 111, 30, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + -36, 90, -112, -31, 70, 18, -117, 66, + 102, -99, 41, 82, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + 103, -34, -15, 86, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + -125, 33, 14, -87, -103, -76, 55, -126, + 74, 0, 28, 31, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + 56, -91, 111, 30, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + -36, 90, -112, -31, 70, 18, -117, 66, + 113, -38, 5, 85, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + 103, -34, -15, 86, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + -125, 33, 14, -87, -103, -76, 55, -126, + 92, -128, -55, 28, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + 56, -91, 111, 30, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + -36, 90, -112, -31, 70, 18, -117, 66, + 94, -68, -110, 82, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + 103, -34, -15, 86, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + -125, 33, 14, -87, -103, -76, 55, -126, + -88, 38, -41, 30, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + 56, -91, 111, 30, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + -36, 90, -112, -31, 70, 18, -117, 66, + 87, -57, 23, 86, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + 103, -34, -15, 86, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + -125, 33, 14, -87, -103, -76, 55, -126, + 117, 118, -104, 30, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + 56, -91, 111, 30, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + -36, 90, -112, -31, 70, 18, -117, 66, + 58, -44, -40, 87, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + 103, -34, -15, 86, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + -125, 33, 14, -87, -103, -76, 55, -126, + -111, 51, 66, 31, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + 56, -91, 111, 30, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + -36, 90, -112, -31, 70, 18, -117, 66, + 20, -44, 120, 87, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + 103, -34, -15, 86, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + -125, 33, 14, -87, -103, -76, 55, -126, + 3, 66, -99, 31, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + 56, -91, 111, 30, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + -36, 90, -112, -31, 70, 18, -117, 66, + -2, -49, 9, 87, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + 103, -34, -15, 86, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + -125, 33, 14, -87, -103, -76, 55, -126, + 107, 20, 95, 28, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + 56, -91, 111, 30, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + -36, 90, -112, -31, 70, 18, -117, 66, + -12, 119, -61, 84, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + 103, -34, -15, 86, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + -125, 33, 14, -87, -103, -76, 55, -126, + 124, 126, 51, 28, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + 56, -91, 111, 30, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + -36, 90, -112, -31, 70, 18, -117, 66, + -115, -76, -82, 84, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + 103, -34, -15, 86, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + -125, 33, 14, -87, -103, -76, 55, -126, + 26, 59, -61, 28, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + 56, -91, 111, 30, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + -36, 90, -112, -31, 70, 18, -117, 66, + 78, 8, 45, 84, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + 103, -34, -15, 86, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + -125, 33, 14, -87, -103, -76, 55, -126, + 7, -72, 110, 29, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + 56, -91, 111, 30, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + -36, 90, -112, -31, 70, 18, -117, 66, + 48, -47, -111, 85, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + 103, -34, -15, 86, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + -125, 33, 14, -87, -103, -76, 55, -126, + -31, 21, 10, 29, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + 56, -91, 111, 30, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + -36, 90, -112, -31, 70, 18, -117, 66, + -43, 54, -105, 85, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + 103, -34, -15, 86, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + -125, 33, 14, -87, -103, -76, 55, -126, + -117, -1, 2, 29, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + 56, -91, 111, 30, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + -36, 90, -112, -31, 70, 18, -117, 66, + -113, -110, 116, 85, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + 103, -34, -15, 86, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + -125, 33, 14, -87, -103, -76, 55, -126, + 36, 10, -59, 29, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + 56, -91, 111, 30, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + -36, 90, -112, -31, 70, 18, -117, 66, + 105, 52, 92, 85, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + 103, -34, -15, 86, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + -125, 33, 14, -87, -103, -76, 55, -126, + 51, 72, -42, 29, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + 56, -91, 111, 30, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + -36, 90, -112, -31, 70, 18, -117, 66, + -114, -74, 48, 85, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + 103, -34, -15, 86, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + -125, 33, 14, -87, -103, -76, 55, -126, + 31, 110, -119, 29, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + 56, -91, 111, 30, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + -36, 90, -112, -31, 70, 18, -117, 66, + 51, 88, 25, 85, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + 103, -34, -15, 86, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + -125, 33, 14, -87, -103, -76, 55, -126, + -101, 75, -112, 29, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + 56, -91, 111, 30, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + -36, 90, -112, -31, 70, 18, -117, 66, + -121, -28, -14, 82, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + 103, -34, -15, 86, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + -125, 33, 14, -87, -103, -76, 55, -126, + -81, 72, 102, 26, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + 56, -91, 111, 30, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + -36, 90, -112, -31, 70, 18, -117, 66, + 6, -89, -90, 82, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + 103, -34, -15, 86, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + -125, 33, 14, -87, -103, -76, 55, -126, + 29, -88, 54, 26, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + 56, -91, 111, 30, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + -36, 90, -112, -31, 70, 18, -117, 66, + -52, 76, -114, 82, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + 103, -34, -15, 86, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + -125, 33, 14, -87, -103, -76, 55, -126, + -116, 16, -5, 26, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + 56, -91, 111, 30, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + -36, 90, -112, -31, 70, 18, -117, 66, + -27, -99, 102, 82, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + 103, -34, -15, 86, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + -125, 33, 14, -87, -103, -76, 55, -126, + -58, 34, -10, 26, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + 56, -91, 111, 30, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + -36, 90, -112, -31, 70, 18, -117, 66, + -3, 29, 89, 82, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + 103, -34, -15, 86, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + -125, 33, 14, -87, -103, -76, 55, -126, + 75, 9, -35, 26, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + 56, -91, 111, 30, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + -36, 90, -112, -31, 70, 18, -117, 66, + 53, 125, 57, 82, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + 103, -34, -15, 86, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + -125, 33, 14, -87, -103, -76, 55, -126, + -6, -19, -75, 26, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + 56, -91, 111, 30, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + -36, 90, -112, -31, 70, 18, -117, 66, + 79, 35, 46, 82, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + 103, -34, -15, 86, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + -125, 33, 14, -87, -103, -76, 55, -126, + 60, -101, -101, 26, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + 56, -91, 111, 30, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + -36, 90, -112, -31, 70, 18, -117, 66, + 55, -39, -13, 83, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + 103, -34, -15, 86, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + -125, 33, 14, -87, -103, -76, 55, -126, + 82, -94, 100, 27, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + 56, -91, 111, 30, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + -36, 90, -112, -31, 70, 18, -117, 66, + -53, 29, -4, 83, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + 103, -34, -15, 86, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + -125, 33, 14, -87, -103, -76, 55, -126, + 24, 32, 90, 27, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + 56, -91, 111, 30, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + -36, 90, -112, -31, 70, 18, -117, 66, + 13, 57, -87, 83, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + 103, -34, -15, 86, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + -125, 33, 14, -87, -103, -76, 55, -126, + -123, 67, 53, 27, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + 56, -91, 111, 30, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + -36, 90, -112, -31, 70, 18, -117, 66, + -25, 67, -103, 83, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + 103, -34, -15, 86, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + -125, 33, 14, -87, -103, -76, 55, -126, + -22, -15, 2, 27, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + 56, -91, 111, 30, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + -36, 90, -112, -31, 70, 18, -117, 66, + 41, 127, -126, 83, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + 103, -34, -15, 86, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + -125, 33, 14, -87, -103, -76, 55, -126, + -72, -47, 27, 27, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + 56, -91, 111, 30, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + -36, 90, -112, -31, 70, 18, -117, 66, + -113, -63, 124, 83, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + 103, -34, -15, 86, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + -125, 33, 14, -87, -103, -76, 55, -126, + -10, -29, -4, 27, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + 56, -91, 111, 30, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + -36, 90, -112, -31, 70, 18, -117, 66, + -1, 9, 79, 83, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + 103, -34, -15, 86, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + -125, 33, 14, -87, -103, -76, 55, -126, + 83, 2, -70, 27, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + 56, -91, 111, 30, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + -36, 90, -112, -31, 70, 18, -117, 66, + 13, -120, 9, 84, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + 103, -34, -15, 86, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + -125, 33, 14, -87, -103, -76, 55, -126, + 62, 26, 81, 29, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + 56, -91, 111, 30, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + -36, 90, -112, -31, 70, 18, -117, 66, + -3, 79, 64, 86, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + 103, -34, -15, 86, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + -125, 33, 14, -87, -103, -76, 55, -126, + 80, 54, 93, 27, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + 56, -91, 111, 30, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + -36, 90, -112, -31, 70, 18, -117, 66, + -64, -107, -83, 85, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + 103, -34, -15, 86, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + -125, 33, 14, -87, -103, -76, 55, -126, + -110, 127, 7, 28, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + 56, -91, 111, 30, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + -36, 90, -112, -31, 70, 18, -117, 66, + -115, 62, 85, 84, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + 103, -34, -15, 86, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + -125, 33, 14, -87, -103, -76, 55, -126, + 32, 109, 101, 26, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + 56, -91, 111, 30, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + -36, 90, -112, -31, 70, 18, -117, 66, + -103, -105, -126, 87, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + 103, -34, -15, 86, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + -125, 33, 14, -87, -103, -76, 55, -126, + -30, 88, -76, 31, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + 56, -91, 111, 30, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + -36, 90, -112, -31, 70, 18, -117, 66, + 43, -61, 41, 84, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + 103, -34, -15, 86, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + -125, 33, 14, -87, -103, -76, 55, -126, + 17, 42, 5, 31, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + 56, -91, 111, 30, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + -36, 90, -112, -31, 70, 18, -117, 66, + 51, 49, 31, 82, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + 103, -34, -15, 86, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + -125, 33, 14, -87, -103, -76, 55, -126, + -56, -20, -94, 26, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + 56, -91, 111, 30, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + -36, 90, -112, -31, 70, 18, -117, 66, + -23, -22, -116, 87, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + 103, -34, -15, 86, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + -125, 33, 14, -87, -103, -76, 55, -126, + -91, 107, 3, 31, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + 56, -91, 111, 30, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + -36, 90, -112, -31, 70, 18, -117, 66, + -25, 18, -96, 83, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + 103, -34, -15, 86, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + -125, 33, 14, -87, -97, -76, 55, -126, + 35, -91, 111, 30, 80, 2, -117, 66, + 78, -33, -15, 86, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + -36, 90, -112, -31, 67, 18, -117, 66, + -125, 33, 14, -87, -35, -91, 55, -126, + 19, -91, 111, 30, -70, -19, 116, -67, + -125, 33, 14, -87, 101, 75, -56, 125, + -36, 90, -112, -31, -70, -19, 116, -67, + -125, 33, 14, -87, -88, -16, 122, -29, + 87, -51, 60, 118, 36, 98, -18, 22, + 25, -90, -123, 31, -12, -33, 100, -25, + 66, -41, 12, 118, 21, 96, -18, 38, + 21, -67, -123, 63, -11, -38, 115, -19, + 64, -48, 2, 123, 43, 102, -52, 39, + 15, -86, -124, 36, -1, -11, 89, -29, + 79, -36, 21, 123, 55, 75, 57, 27, + 74, -36, -78, 31, -123, -76, 79, -32, + -107, -107, -19, 31, 103, 34, -122, 68, + 117, -12, 119, 30, 28, 67, 58, -125, + 34, -92, 106, 30, 70, -112, -118, 77, + 124, -18, 115, 87, -112, -74, -75, -125, + 34, -91, -14, 94, 42, 81, 118, -12, + -123, 63, -35, 32, 75, 125, 38, 30, + -75, 15, 102, 97, 30, -18, -127, 126, + -29, 109, 58, 120, -125, 45, -84, -104, + 56, 79, -120, -31, 93, -102, 113, -70, + 90, 60, 5, -7, 84, -76, 34, -29, + -108, 25, -19, 94, -21, -86, 29, 35, + -33, 77, -128, -118, -99, -5, 117, -32, + 11, -107, 5, -120, 59, -12, 118, 83, + -84, -2, 54, -43, -98, 31, 83, 74, + -82, -72, -36, 91, 69, -82, -14, -124, + 59, 16, 99, 4, -31, -104, 70, 79, + -66, 102, 78, -111, -46, -31, 95, 77, + -36, -7, -99, -24, -61, 22, 92, 92, + 36, -44, 109, -91, 13, -59, 82, -79, + -82, -74, -96, 20, -10, 20, -3, 87, + 23, -5, -93, -68, -8, -121, 10, -66, + 120, 20, -103, 87, 6, -101, 14, -27, + -103, 71, -24, 48, -48, -22, -85, 112, + 7, 97, -126, 125, -14, -25, 7, -21, + -7, -122, -75, 111, -76, -20, -90, -40, + 58, 52, 82, -50, -69, -63, 77, 105, + -30, -21, 23, -11, -57, 94, -105, 120, + 87, 68, -72, -64, -21, -65, -34, -110, + 62, 7, 6, -13, -24, -70, -9, -124, + 31, 0, -106, 117, 120, 3, -59, 24, + -33, -54, 14, 44, 20, 41, -86, -102, + -91, -2, 93, -33, 33, 116, -75, 64, + -100, 122, -44, 6, -1, -86, -62, -65, + -53, 23, 86, -49, -43, -119, 126, -119, + 126, 28, 18, -83, -42, -54, 71, -3, + -17, 33, 121, -127, 27, 11, 101, 52, + 32, -104, 109, 29, 68, 18, -118, 42, + 8, -86, -127, 37, -96, -101, 24, -29, + 87, -50, 65, 115, 60, 97, -24, 48, + 21, -82, -123, 120, -7, -37, 90, -83, + 71, -64, 25, 119, 38, 119, -76, 35, + 12, -82, -72, 18, -89, -111, 68, -92, + 71, -60, 27, 127, 120, 55, -8 + }; + + /** + * Returns the bytes of the user certificate. + * + * @return The bytes of the user certificate. + */ + public static byte[] getBytes() { + return BYTES; + } - public static byte[] getBytes() { - throw new RuntimeException( - "Please replace the content of MyCertificate.java with the certificate you received from " - + "the developer portal"); - } -} +} // end of: class MyCertificate diff --git a/docs/images/preview.gif b/docs/images/preview.gif new file mode 100644 index 0000000..e479ea0 Binary files /dev/null and b/docs/images/preview.gif differ