Skip to content

Commit 0ff445c

Browse files
authored
Merge pull request #160 from immutable/fix/android-newer-unity-versions
[DX-2622] fix: android custom tabs version, build immutable android library as aar
2 parents f2338c2 + ed3594e commit 0ff445c

File tree

26 files changed

+505
-64
lines changed

26 files changed

+505
-64
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/caches
5+
/.idea/libraries
6+
/.idea/modules.xml
7+
/.idea/workspace.xml
8+
/.idea/navEditor.xml
9+
/.idea/assetWizardSettings.xml
10+
.DS_Store
11+
/build
12+
/captures
13+
.externalNativeBuild
14+
.cxx
15+
local.properties
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
plugins {
2+
id 'com.android.library'
3+
}
4+
5+
android {
6+
namespace 'com.immutable.unity'
7+
compileSdk 33
8+
9+
defaultConfig {
10+
minSdk 22
11+
12+
consumerProguardFiles "consumer-rules.pro"
13+
}
14+
15+
buildTypes {
16+
release {
17+
minifyEnabled false
18+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
19+
}
20+
}
21+
compileOptions {
22+
sourceCompatibility JavaVersion.VERSION_1_8
23+
targetCompatibility JavaVersion.VERSION_1_8
24+
}
25+
}
26+
27+
dependencies {
28+
implementation 'androidx.browser:browser:1.5.0'
29+
}
30+
31+
assemble.doLast {
32+
copy {
33+
def aarName = 'ImmutableAndroid-release.aar'
34+
println "Copying aar to Unity SDK..."
35+
from("$projectDir/build/outputs/aar") {
36+
include aarName
37+
}
38+
into "$projectDir/../../../../src/Packages/Passport/Runtime/Assets/Plugins/Android"
39+
rename aarName, 'ImmutableAndroid.aar'
40+
println "Successfully copied aar to Unity SDK"
41+
}
42+
}

Plugins/Android/ImmutableAndroid/ImmutableAndroid/consumer-rules.pro

Whitespace-only changes.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
3+
<queries>
4+
<intent>
5+
<action android:name="android.support.customtabs.action.CustomTabsService" />
6+
</intent>
7+
</queries>
8+
<application>
9+
<activity
10+
android:name="com.immutable.unity.ImmutableActivity"
11+
android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation|keyboard|keyboardHidden"
12+
android:exported="false"
13+
android:launchMode="singleTask"
14+
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
15+
</application>
16+
</manifest>

src/Packages/Passport/Runtime/Assets/ImmutableAndroid.androidlib/src/main/java/com/immutable/unity/CustomTabsController.java renamed to Plugins/Android/ImmutableAndroid/ImmutableAndroid/src/main/java/com/immutable/unity/CustomTabsController.java

File renamed without changes.

src/Packages/Passport/Runtime/Assets/ImmutableAndroid.androidlib/src/main/java/com/immutable/unity/ImmutableActivity.java renamed to Plugins/Android/ImmutableAndroid/ImmutableAndroid/src/main/java/com/immutable/unity/ImmutableActivity.java

File renamed without changes.

src/Packages/Passport/Runtime/Assets/ImmutableAndroid.androidlib/src/main/java/com/immutable/unity/RedirectActivity.java renamed to Plugins/Android/ImmutableAndroid/ImmutableAndroid/src/main/java/com/immutable/unity/RedirectActivity.java

File renamed without changes.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Immutable Android plugin
2+
3+
To build and use a new version:
4+
1. Run the `assemble` gradle command (A custom task will copy the generated aar to `src/Packages/Passport/Runtime/Assets/Plugins/Android` and rename it to `ImmutableAndroid.aar`)

0 commit comments

Comments
 (0)