Skip to content

Commit a9732f1

Browse files
authored
Merge pull request #30 from SEPIA-Framework/dev
v0.23.0 release candidate for SEPIA Home v2.5.1
2 parents 52eef80 + 27c09e2 commit a9732f1

File tree

112 files changed

+4791
-1300
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+4791
-1300
lines changed

README.md

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@ Part of the [SEPIA Framework](https://sepia-framework.github.io/)
88
This is a HTML-based application (SEPIA client) to communicate with SEPIA via browser, iOS and Android.
99
Features of the app are:
1010
* Input via voice (Android, iOS, browser) and text
11-
* Native (Android, iOS, Chrome) and open-source ASR supported ([see STT-Server](https://github.com/SEPIA-Framework/sepia-stt-server))
12-
* Text-to-Speech voice output
11+
* Native platform (Android, iOS, Chrome) and open-source ASR supported ([see STT-Server](https://github.com/SEPIA-Framework/sepia-stt-server))
12+
* Text-to-Speech voice output via client platform and open-source SEPIA server
1313
* WebSocket based chat with SEPIA and other users that are registered on your private or public server ([see Chat-Server](https://github.com/SEPIA-Framework/sepia-websocket-server-java))
1414
* Customizable start-screen with user-recommendations (created by the SEPIA server)
1515
* AlwaysOn mode with animated avatar (works best with OLED screens! ^_^)
1616
* In-chat card results (e.g. for to-do lists), audio player (e.g. for web-radio) and in-app browser for iOS and Android
1717
* User-account management
1818
* Teach-interface to add your own commands/chats/actions to SEPIA ([see Teach-Server](https://github.com/SEPIA-Framework/sepia-teach-server))
19+
* Remote terminal support via CLEXI server to work in 'headless' mode
1920
* Customizable look (skins for the app)
2021
* Tutorial and help screens to get started
2122
* Remote-actions to communicate between clients and devices (e.g. for [wake-word](https://github.com/SEPIA-Framework/sepia-wakeword-tools) integration)
@@ -28,13 +29,36 @@ Features of the app are:
2829

2930
The latest release version is always **online** at: `https://sepia-framework.github.io/app/index.html` (requires server with SSL)
3031
When you've installed **SEPIA-Home** the default link is: `http://[sepia-home-IP]:20721/app/index.html`
31-
The Android app can be installed via the **Google Play Store**: [Play Store link](https://play.google.com/store/apps/details?id=de.bytemind.sepia.app.web) (currently only German)
32+
The Android app can be installed via the **Google Play Store**: [Play Store link](https://play.google.com/store/apps/details?id=de.bytemind.sepia.app.web)
3233

3334
Note: If you don't operate your own SEPIA server you can still open the app in "demo-mode" (simply skip the log-in) and look around a bit though most of the features will not be active in this mode.
3435
More languages for Android and an iOS app are in beta-test phase and will be release "when they are done" :-p
3536

3637
For experts only: Use the build-scripts in this repository to build your own version of the app (Android and iOS are available).
3738

39+
### URL parameters
40+
41+
You can modify the client configuration via several URL parameters:
42+
* `host` - SEPIA server host, e.g. IP address or domain + path
43+
* `lang` - Default language code for client (ISO code)
44+
* `isApp` - 'true' will change client to behave as if it was an app (not a website), e.g. login tokens will be valid for much longer etc.
45+
* `isTiny` - 'true' will optimize the UI and controls to support small displays (e.g. Apple Watch or 240x240px screens)
46+
* `isHeadless` or `autoSetup` - Load client settings from file (settings.js) and trigger setup mode if no user is logged in. 'isHeadless' will set some supported client features as well (e.g. don't open browser tabs etc.).
47+
* `env` - 'environment' setting for client
48+
* `q` - Question that will be triggered when client is connected
49+
* `share` - Shared data e.g. via deeplinks
50+
* `view` - Switch to specific view on start for example always-on mode (e.g.: aomode, teachui, "frame name")
51+
* `clexi` and `clexiId` - CLEXI socket URL and access ID
52+
* `logout` - 'true' will make sure client is logged out at start (all previous user date removed)
53+
* `cordova` - Set Cordova framework mode if 'true'
54+
* `isTest` - tbd
55+
56+
### App deeplinks
57+
58+
* `https://b07z.net/dl/sepia/index.html?q=[my request as text]` - e.g. `test`
59+
* `https://b07z.net/dl/sepia/index.html?view=[app view]` - e.g. `aomode`, `teachui`
60+
* `https://b07z.net/dl/sepia/index.html?share=[base64 encoded share data]` - use long-press on your user name of one of your chat entries inside the app to generate share links
61+
3862
### Version history ...
3963

4064
... can be found [here](https://github.com/SEPIA-Framework/SEPIA-Framework.github.io/blob/master/app/README.md).

config.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version='1.0' encoding='utf-8'?>
2-
<widget id="org.example.sepia.app.web" version="0.22.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
2+
<widget id="org.example.sepia.app.web" version="0.23.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
33
<name>S.E.P.I.A.</name>
44
<description>
55
Prototype of S.E.P.I.A. framework client
@@ -52,7 +52,7 @@
5252
<!--config stuff-->
5353
<preference name="AndroidLaunchMode" value="singleTask" />
5454
<preference name="android-minSdkVersion" value="19" /><!-- Android 4.4+ -->
55-
<preference name="android-targetSdkVersion" value="28" /><!-- Android 9.0 -->
55+
<preference name="android-targetSdkVersion" value="29" /><!-- Android 10.0 -->
5656
<preference name="android-windowSoftInputMode" value="adjustSize" />
5757
<!-- custom manifest changes -->
5858
<custom-preference name="android-manifest/application/activity/@android:theme" value="@style/SplashTheme"/> <!-- Theme mainly for splash screen or background colors -->

create-android-project.sh

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ cordova plugin add cordova-plugin-geolocation
2424
cordova plugin add cordova-plugin-inappbrowser
2525
cordova plugin add cordova-plugin-tts
2626
cordova plugin add cordova-plugin-whitelist
27-
cordova plugin add cordova-universal-links-plugin
27+
#cordova plugin add cordova-universal-links-plugin
28+
cordova plugin add https://github.com/sepia-assistant/cordova-universal-links-plugin.git
2829
cordova plugin add cordova-plugin-statusbar
2930
cordova plugin add cordova-plugin-splashscreen
3031
#cordova plugin add https://github.com/apache/cordova-plugin-splashscreen.git -- NOTE: use this in case releases are too old
@@ -34,12 +35,14 @@ cordova plugin add plugin_mods/speechrecognition/org.apache.cordova.speech.speec
3435
#cordova plugin add de.appplant.cordova.plugin.local-notification
3536
#cordova plugin add plugin_mods/localnotifications/de.appplant.cordova.plugin.local-notification
3637
#cordova plugin add [email protected]
37-
cordova plugin add cordova-plugin-local-notification
38+
#cordova plugin add cordova-plugin-local-notification
39+
cordova plugin add https://github.com/timkellypa/cordova-plugin-local-notifications
3840
cordova plugin add cordova-plugin-file
3941
cordova plugin add cordova-plugin-nativestorage
4042
cordova plugin add cordova-android-support-gradle-release
4143
cordova plugin add phonegap-plugin-media-stream
42-
cordova plugin add https://github.com/EddyVerbruggen/Insomnia-PhoneGap-Plugin.git
44+
#cordova plugin add https://github.com/EddyVerbruggen/Insomnia-PhoneGap-Plugin.git
45+
cordova plugin add https://github.com/tombolaltd/cordova-plugin-insomnia.git
4346
cordova plugin add cordova-plugin-eddystone
4447
cordova plugin add cordova-plugin-navigationbar-color
4548
#NOTE: add before intent plugin if you use: plugin add cordova-plugin-camera
@@ -56,21 +59,21 @@ cp -r -f "plugin_mods/inappbrowser/android/res/" "plugins/cordova-plugin-inappbr
5659
# add android platform
5760
sleep 2
5861
echo "#Adding platform ..."
59-
cordova platform add android@6.4.0
62+
cordova platform add android@8.1.0
6063
#
6164
# prepare build
6265
echo "#Preparing build ..."
6366
cordova prepare android
6467
# overwrite icons (this will be replaced with a proper implementation)
6568
sleep 2
6669
echo "#Adding or overwriting resources, e.g. icons, themes, xml ..."
67-
cp -r -f "resources/icons/android/notifications/res/" "platforms/android/res/"
68-
cp -r "resources/themes/android/background_splash.xml" "platforms/android/res/drawable/background_splash.xml"
69-
cp -r "resources/themes/android/launch_screen.png" "platforms/android/res/drawable/launch_screen.png"
70-
#cp -r "resources/themes/android/styles.xml" "platforms/android/res/values/styles.xml"
71-
cp -r "resources/themes/android/values/" "platforms/android/res/values/"
72-
mkdir -p "platforms/android/res/values-v21"
73-
cp -r "resources/themes/android/values-v21/" "platforms/android/res/values-v21/"
74-
cp -r "resources/config/android/xml/" "platforms/android/res/xml/"
70+
cp -r -f "resources/icons/android/notifications/res/" "platforms/android/app/src/main/res/"
71+
cp -r "resources/themes/android/background_splash.xml" "platforms/android/app/src/main/res/drawable/background_splash.xml"
72+
cp -r "resources/themes/android/launch_screen.png" "platforms/android/app/src/main/res/drawable/launch_screen.png"
73+
#cp -r "resources/themes/android/styles.xml" "platforms/android/app/src/main/res/values/styles.xml"
74+
cp -r "resources/themes/android/values/" "platforms/android/app/src/main/res/values/"
75+
mkdir -p "platforms/android/app/src/main/res/values-v21"
76+
cp -r "resources/themes/android/values-v21/" "platforms/android/app/src/main/res/values-v21/"
77+
cp -r "resources/config/android/xml/" "platforms/android/app/src/main/res/xml/"
7578
echo "#DONE"
7679
echo "If everything worked out fine the next step would be to build the app from the %APP_NAME% folder: cordova build android"

hooks/add-android-intent-filters.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ module.exports = function (context) {
1313
<category android:name="android.intent.category.DEFAULT" />
1414
</intent-filter>
1515
`;
16-
const manifestPath = context.opts.projectRoot + '/platforms/android/AndroidManifest.xml';
16+
let manifestPath = context.opts.projectRoot + '/platforms/android/AndroidManifest.xml';
17+
if (!fs.existsSync(manifestPath)){
18+
//new path
19+
manifestPath = context.opts.projectRoot + '/platforms/android/app/src/main/AndroidManifest.xml';
20+
}
1721
const androidManifest = fs.readFileSync(manifestPath).toString();
1822
if (!androidManifest.includes(`android:scheme="${scheme}"`)) {
1923
const manifestLines = androidManifest.split(/\r?\n/);

hooks/add-android-permissions.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ let permissions = [
1414
module.exports = function (context) {
1515
const parseString = xml2js.parseString;
1616
const builder = new xml2js.Builder();
17-
const manifestPath = context.opts.projectRoot + '/platforms/android/AndroidManifest.xml';
17+
let manifestPath = context.opts.projectRoot + '/platforms/android/AndroidManifest.xml';
18+
if (!fs.existsSync(manifestPath)){
19+
//new path
20+
manifestPath = context.opts.projectRoot + '/platforms/android/app/src/main/AndroidManifest.xml';
21+
}
1822
const androidManifest = fs.readFileSync(manifestPath).toString();
1923

2024
let manifestRoot,
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
## ADD THE CODE FROM BELOW TO 'SplashScreen.java'
2+
3+
```
4+
// Create and show the dialog
5+
splashDialog = new Dialog(context, android.R.style.Theme_Translucent_NoTitleBar);
6+
// check to see if the splash screen should be full screen
7+
if ((cordova.getActivity().getWindow().getAttributes().flags & WindowManager.LayoutParams.FLAG_FULLSCREEN)
8+
== WindowManager.LayoutParams.FLAG_FULLSCREEN) {
9+
splashDialog.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
10+
WindowManager.LayoutParams.FLAG_FULLSCREEN);
11+
}
12+
//---NEW---
13+
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
14+
try {
15+
splashDialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
16+
splashDialog.getWindow().setNavigationBarColor(Color.parseColor(preferences.getString("NavigationBarBackgroundColor", "#000000")));
17+
} catch (Exception e) {
18+
e.printStackTrace();
19+
}
20+
}
21+
//---NEW END---
22+
splashDialog.setContentView(splashImageView);
23+
splashDialog.setCancelable(false);
24+
splashDialog.show();
25+
```

plugin_mods/speechrecognition/org.apache.cordova.speech.speechrecognition/src/android/SpeechRecognition.java

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,13 @@ public void run() {
9999
}
100100
else if (ACTION_SPEECH_RECOGNIZE_START.equals(action)) {
101101
// recognize speech
102-
if (!recognizerPresent) {
102+
if (!this.recognizerPresent) {
103103
callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.ERROR, NOT_PRESENT_MESSAGE));
104-
}
105-
this.lang = args.optString(0, "en");
106-
this.speechRecognizerCallbackContext = callbackContext;
107-
this.promptForMic();
104+
}else{
105+
this.lang = args.optString(0, "en");
106+
this.speechRecognizerCallbackContext = callbackContext;
107+
this.promptForMic();
108+
}
108109
}
109110
else if (ACTION_SPEECH_RECOGNIZE_STOP.equals(action)) {
110111
stop(false);
@@ -135,7 +136,9 @@ private void startRecognition() {
135136

136137
@Override
137138
public void run() {
138-
recognizer.startListening(intent);
139+
if (recognizer != null){
140+
recognizer.startListening(intent);
141+
}
139142
}
140143

141144
});
@@ -152,7 +155,9 @@ private void stop(boolean abort) {
152155

153156
@Override
154157
public void run() {
155-
recognizer.stopListening();
158+
if (recognizer != null){
159+
recognizer.stopListening();
160+
}
156161
}
157162

158163
});

win-create-android-project.bat

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ cordova plugin add cordova-plugin-geolocation |more
2323
cordova plugin add cordova-plugin-inappbrowser |more
2424
cordova plugin add cordova-plugin-tts |more
2525
cordova plugin add cordova-plugin-whitelist |more
26-
cordova plugin add cordova-universal-links-plugin |more
26+
REM cordova plugin add cordova-universal-links-plugin |more
27+
cordova plugin add https://github.com/sepia-assistant/cordova-universal-links-plugin.git |more
2728
cordova plugin add cordova-plugin-statusbar |more
2829
cordova plugin add cordova-plugin-splashscreen |more
2930
REM cordova plugin add https://github.com/apache/cordova-plugin-splashscreen.git |more -- NOTE: use this in case releases are too old
@@ -32,12 +33,14 @@ cordova plugin add cordova-custom-config |more
3233
cordova plugin add plugin_mods/speechrecognition/org.apache.cordova.speech.speechrecognition |more
3334
REM cordova plugin add de.appplant.cordova.plugin.local-notification |more
3435
REM cordova plugin add plugin_mods/localnotifications/de.appplant.cordova.plugin.local-notification |more
35-
cordova plugin add cordova-plugin-local-notification |more
36+
REM cordova plugin add cordova-plugin-local-notification |more
37+
cordova plugin add https://github.com/timkellypa/cordova-plugin-local-notifications |more
3638
cordova plugin add cordova-plugin-file |more
3739
cordova plugin add cordova-plugin-nativestorage |more
3840
cordova plugin add cordova-android-support-gradle-release |more
3941
cordova plugin add phonegap-plugin-media-stream |more
40-
cordova plugin add https://github.com/EddyVerbruggen/Insomnia-PhoneGap-Plugin.git |more
42+
REM cordova plugin add https://github.com/EddyVerbruggen/Insomnia-PhoneGap-Plugin.git |more
43+
cordova plugin add https://github.com/tombolaltd/cordova-plugin-insomnia.git |more
4144
cordova plugin add cordova-plugin-eddystone |more
4245
cordova plugin add cordova-plugin-navigationbar-color |more
4346
REM NOTE: add before intent plugin if you use: plugin add cordova-plugin-camera
@@ -54,20 +57,20 @@ REM
5457
REM add android platform
5558
sleep 2
5659
echo "#Adding platform ..."
57-
cordova platform add android@6.4.0 |more
60+
cordova platform add android@8.1.0 |more
5861
REM
5962
REM prepare build
6063
echo "#Preparing build ..."
6164
cordova prepare android |more
6265
REM overwrite icons (this will be replaced with a proper implementation)
6366
sleep 2
6467
echo "#Adding or overwriting resources, e.g. icons, themes, xml ..."
65-
xcopy "resources\icons\android\notifications\res" "platforms\android\res" /e /h /y |more
66-
xcopy "resources\themes\android\background_splash.xml" "platforms\android\res\drawable" |more
67-
xcopy "resources\themes\android\launch_screen.png" "platforms\android\res\drawable" |more
68-
xcopy "resources\themes\android\values" "platforms\android\res\values" |more
69-
xcopy "resources\themes\android\values-v21" "platforms\android\res\values-v21" /i |more
70-
xcopy "resources\config\android\xml" "platforms\android\res\xml" /i |more
68+
xcopy "resources\icons\android\notifications\res" "platforms\android\app\src\main\res" /e /h /y |more
69+
xcopy "resources\themes\android\background_splash.xml" "platforms\android\app\src\main\res\drawable" |more
70+
xcopy "resources\themes\android\launch_screen.png" "platforms\android\app\src\main\res\drawable" |more
71+
xcopy "resources\themes\android\values" "platforms\android\app\src\main\res\values" |more
72+
xcopy "resources\themes\android\values-v21" "platforms\android\app\src\main\res\values-v21" /i |more
73+
xcopy "resources\config\android\xml" "platforms\android\app\src\main\res\xml" /i |more
7174
echo "#DONE"
7275
echo "If everything worked out fine the next step would be to build the app from the %APP_NAME% folder: cordova build android"
7376
pause

www/channel-manager.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,15 +310,15 @@ <h3>Invite User:</h3>
310310
if (ids.length > 0){
311311
var note = document.createElement("div");
312312
var info = document.createElement("p");
313-
info.innerHTML = "Users you've recently interacted with:";
313+
info.textContent = "Users you've recently interacted with:";
314314
var list = document.createElement("div");
315315
list.className = "chooseBox";
316316
ids.forEach(function(id){
317317
var c = contactsFromChat[id];
318318
var entry = document.createElement("div");
319319
entry.className = "entry";
320320
entry.dataset.id = c.id;
321-
entry.innerHTML = c.name + " (" + c.id + ")";
321+
entry.textContent = c.name + " (" + c.id + ")";
322322
list.appendChild(entry);
323323
$(entry).on('click', function(){
324324
$('#sepiaFW-channel-manager-invite-user').val(this.dataset.id);

www/credits.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ <h3>Credits</h3>
1313
<a href="https://github.com/mattdiamond/Recorderjs">Recorder.js</a><br>
1414
<a href="https://github.com/kdavis-mozilla/vad.js">vad.js</a><br>
1515
<a href="https://github.com/iconfu/svg-inject">SVGInject</a><br>
16+
<a href="https://github.com/cure53/DOMPurify">DOMPurify</a><br>
1617
<p><u>Icons</u></p>
1718
<a href="https://material.io/tools/icons">Google Material Design</a><br>
1819
<p><u>Sounds</u></p>

0 commit comments

Comments
 (0)