Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 6 additions & 20 deletions unity/Assets/Plugins/Android/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.emotiv.unityexample">
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.BLUETOOTH"
Expand All @@ -13,41 +12,28 @@
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<application>
<!--Used when Application Entry is set to Activity, otherwise remove this activity block-->
<activity android:name="com.emotiv.unityplugin.CustomUnityPlayerActivity"
android:theme="@style/UnityThemeSelector">
<activity android:name="com.unity3d.player.UnityPlayerActivity"
android:theme="@style/UnityThemeSelector"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- <data android:scheme="${customScheme}" android:host="authorize" /> -->
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
<meta-data android:name="android.app.background_running" android:value="true"/>
</activity>
<activity
android:name="com.onevcat.uniwebview.UniWebViewAuthenticationActivity"
android:exported="true"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data android:scheme="${customScheme}" android:host="authorize" />
</intent-filter>
</activity>
<service
android:name="com.emotiv.unityplugin.BForegroundService"
android:foregroundServiceType="connectedDevice"
android:exported="false">
</service>
</application>
</manifest>
</manifest>

4 changes: 2 additions & 2 deletions unity/Assets/Plugins/Android/baseProjectTemplate.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ plugins {
// See which Gradle version is preinstalled with Unity here https://docs.unity3d.com/Manual/android-gradle-overview.html
// See official Gradle and Android Gradle Plugin compatibility table here https://developer.android.com/studio/releases/gradle-plugin#updating-gradle
// To specify a custom Gradle version in Unity, go do "Preferences > External Tools", uncheck "Gradle Installed with Unity (recommended)" and specify a path to a custom Gradle version
id 'com.android.application' version '7.3.1' apply false
id 'com.android.library' version '7.3.1' apply false
id 'com.android.application' version '7.4.2' apply false
id 'com.android.library' version '7.4.2' apply false
**BUILD_SCRIPT_DEPS**
}

Expand Down
25 changes: 12 additions & 13 deletions unity/Assets/Plugins/Android/launcherTemplate.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ dependencies {
}

android {
ndkVersion "**NDKVERSION**"
ndkPath "**NDKPATH**"
namespace "**NAMESPACE**"

compileSdkVersion **APIVERSION**
compileSdk **APIVERSION**
buildToolsVersion '**BUILDTOOLS**'

compileOptions {
Expand All @@ -17,37 +18,35 @@ android {
}

defaultConfig {
minSdkVersion 24
targetSdkVersion **TARGETSDKVERSION**
minSdk 24
targetSdk **TARGETSDK**
applicationId '**APPLICATIONID**'
ndk {
debugSymbolLevel **DEBUGSYMBOLLEVEL**
abiFilters **ABIFILTERS**
}
versionCode **VERSIONCODE**
versionName '**VERSIONNAME**'
}

aaptOptions {
androidResources {
noCompress = **BUILTIN_NOCOMPRESS** + unityStreamingAssets.tokenize(', ')
ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:!CVS:!thumbs.db:!picasa.ini:!*~"
}**SIGN**

}
lintOptions {
abortOnError false
}

buildTypes {
debug {
minifyEnabled **MINIFY_DEBUG**
proguardFiles getDefaultProguardFile('proguard-android.txt')**SIGNCONFIG**
proguardFiles getDefaultProguardFile('proguard-android.txt')
jniDebuggable true
}
release {
minifyEnabled **MINIFY_RELEASE**
proguardFiles getDefaultProguardFile('proguard-android.txt')**SIGNCONFIG**
proguardFiles getDefaultProguardFile('proguard-android.txt')
}
}
packagingOptions {
packagingOptions {
exclude 'META-INF/kotlinx_coroutines_core.version'
exclude 'META-INF/androidx.lifecycle_lifecycle-livedata-core.version'
exclude 'kotlin/internal/internal.kotlin_builtins'
Expand All @@ -60,7 +59,7 @@ android {
exclude 'kotlin/**/*.kotlin_builtins'
exclude 'kotlin/*.kotlin_builtins'
}
**PACKAGING_OPTIONS****PLAY_ASSET_PACKS****SPLITS**
**PACKAGING****PLAY_ASSET_PACKS****SPLITS**
**BUILT_APK_LOCATION**
bundle {
language {
Expand All @@ -77,5 +76,5 @@ android {
}
}

**GOOGLE_PLAY_DEPENDENCIES**
**GOOGLE_PLAY_DEPENDENCIES**
}**SPLITS_VERSION_CODE****LAUNCHER_SOURCE_BUILD_SETUP**
55 changes: 31 additions & 24 deletions unity/Assets/Plugins/Android/mainTemplate.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ apply plugin: 'com.android.library'
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.5.1'
**DEPS**
}
implementation(name: 'EmotivCortexLib', ext:'aar')
**DEPS**}

buildscript {
repositories {
Expand All @@ -13,11 +13,17 @@ buildscript {
}
}

repositories {
google()
mavenCentral()
}

android {
ndkVersion "**NDKVERSION**"
ndkPath "**NDKPATH**"
namespace "com.unity3d.player"

compileSdkVersion **APIVERSION**
compileSdk **APIVERSION**
buildToolsVersion '**BUILDTOOLS**'

compileOptions {
Expand All @@ -26,36 +32,37 @@ android {
}

defaultConfig {
minSdkVersion 24
targetSdkVersion **TARGETSDKVERSION**
minSdk 24
targetSdk **TARGETSDK**
ndk {
debugSymbolLevel **DEBUGSYMBOLLEVEL**
abiFilters **ABIFILTERS**
}
versionCode **VERSIONCODE**
versionName '**VERSIONNAME**'
String client_id = "your_client_id_here" // Replace with your actual client_id
if (client_id.isEmpty()) {
System.err << "You need to config value for client_id"
} else {
String value = client_id.md5()
manifestPlaceholders = [
'customScheme': 'emotiv-' + value
]
}

consumerProguardFiles 'proguard-unity.txt' **USER_PROGUARD**
**DEFAULT_CONFIG_SETUP**
String client_id = "put_your_application_client_id_for_here"
if (client_id.isEmpty()) {
System.err << "You need to config value for client_id"
}
else {
String value = client_id.md5()
manifestPlaceholders = [
'customScheme': 'emotiv-' + value,
"appAuthRedirectScheme": ""
]
}
consumerProguardFiles 'proguard-unity.txt'**USER_PROGUARD**
**DEFAULT_CONFIG_SETUP**
}

lintOptions {
abortOnError false
}

aaptOptions {
noCompress = **BUILTIN_NOCOMPRESS** + unityStreamingAssets.tokenize(', ') // Unity will replace this placeholder with no-compress settings.
androidResources {
noCompress = **BUILTIN_NOCOMPRESS** + unityStreamingAssets.tokenize(', ')
ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:!CVS:!thumbs.db:!picasa.ini:!*~"
}

packagingOptions {
exclude 'META-INF/kotlinx_coroutines_core.version'
exclude 'META-INF/androidx.lifecycle_lifecycle-livedata-core.version'
Expand All @@ -68,9 +75,9 @@ android {
exclude 'kotlin/collections/*.kotlin_builtins'
exclude 'kotlin/**/*.kotlin_builtins'
exclude 'kotlin/*.kotlin_builtins'
**PACKAGING_OPTIONS**
}
**IL_CPP_BUILD_SETUP**
**SOURCE_BUILD_SETUP**
**EXTERNAL_SOURCES**
**PACKAGING**
}
**IL_CPP_BUILD_SETUP**
**SOURCE_BUILD_SETUP**
**EXTERNAL_SOURCES**
2 changes: 1 addition & 1 deletion unity/Assets/Plugins/Emotiv-Unity-Plugin
9 changes: 3 additions & 6 deletions unity/Packages/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,14 @@
"com.unity.2d.sprite": "1.0.0",
"com.unity.2d.tilemap": "1.0.0",
"com.unity.ads": "4.4.2",
"com.unity.ai.navigation": "2.0.0",
"com.unity.analytics": "3.8.1",
"com.unity.ide.rider": "3.0.28",
"com.unity.ide.visualstudio": "2.0.22",
"com.unity.ide.rider": "3.0.36",
"com.unity.ide.visualstudio": "2.0.23",
"com.unity.ide.vscode": "1.2.5",
"com.unity.mobile.android-logcat": "1.4.2",
"com.unity.test-framework": "1.3.9",
"com.unity.timeline": "1.8.6",
"com.unity.ugui": "2.0.0",
"com.unity.xr.legacyinputhelpers": "2.1.10",
"com.unity.modules.accessibility": "1.0.0",
"com.unity.xr.legacyinputhelpers": "2.1.12",
"com.unity.modules.ai": "1.0.0",
"com.unity.modules.androidjni": "1.0.0",
"com.unity.modules.animation": "1.0.0",
Expand Down
Loading