Skip to content

Commit bc65928

Browse files
authored
Migrate to version 1.33.0
1 parent d6be59a commit bc65928

File tree

7 files changed

+75
-50
lines changed

7 files changed

+75
-50
lines changed

app/build.gradle

+20-8
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
plugins {
22
id 'com.android.application'
33
id 'kotlin-android'
4-
id 'kotlin-android-extensions'
4+
id 'kotlin-parcelize' // ! USE instead of removed 'kotlin-android-extensions'
55
}
66

77
android {
8-
compileSdkVersion 33
9-
buildToolsVersion "30.0.3"
8+
9+
namespace "com.banuba.example.integrationapp"
1010

1111
defaultConfig {
1212
applicationId "com.banuba.example.integrationapp"
13+
compileSdk 33
1314
minSdkVersion 23
1415
targetSdkVersion 33
16+
buildToolsVersion "33.0.1"
17+
1518
versionCode 1
1619
versionName "1.0"
1720

@@ -24,21 +27,30 @@ android {
2427

2528
buildTypes {
2629
release {
27-
minifyEnabled false
30+
minifyEnabled true
31+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
32+
}
33+
debug {
34+
minifyEnabled true
2835
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
2936
}
3037
}
3138
compileOptions {
32-
sourceCompatibility JavaVersion.VERSION_1_8
33-
targetCompatibility JavaVersion.VERSION_1_8
39+
sourceCompatibility JavaVersion.VERSION_17
40+
targetCompatibility JavaVersion.VERSION_17
3441
}
3542

3643
packagingOptions {
3744
pickFirst '**/libbanuba-ve-yuv.so'
45+
46+
jniLibs {
47+
// ! USE INSTEAD OF REMOVED android.bundle.enableUncompressedNativeLibs=false
48+
useLegacyPackaging = true
49+
}
3850
}
3951

4052
kotlinOptions {
41-
jvmTarget = '1.8'
53+
jvmTarget = '17'
4254
}
4355
}
4456

@@ -48,7 +60,7 @@ dependencies {
4860

4961
// Banuba Video Editor SDK dependencies
5062

51-
def banubaSdkVersion = '1.32.2'
63+
def banubaSdkVersion = '1.33.0'
5264
implementation "com.banuba.sdk:ffmpeg:5.1.3"
5365
implementation "com.banuba.sdk:camera-sdk:${banubaSdkVersion}"
5466
implementation "com.banuba.sdk:camera-ui-sdk:${banubaSdkVersion}"

app/proguard-rules.pro

+23-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,29 @@
1414

1515
# Uncomment this to preserve the line number information for
1616
# debugging stack traces.
17-
#-keepattributes SourceFile,LineNumberTable
17+
-keepattributes SourceFile,LineNumberTable
18+
-renamesourcefileattribute SourceFile
1819

1920
# If you keep the line number information, uncomment this to
2021
# hide the original source file name.
21-
#-renamesourcefileattribute SourceFile
22+
#-renamesourcefileattribute SourceFile
23+
24+
-keep class com.banuba.sdk.core.effects.** { *; }
25+
-keep class com.banuba.sdk.effects.ve.speed.** { *; }
26+
27+
-keep class kotlinx.android.extensions.** { *; }
28+
29+
# The following rules are taken from generated "missing_rules.txt" file provided by R8
30+
# Please add these rules to your existing keep rules in order to suppress warnings.
31+
# This is generated automatically by the Android Gradle plugin.
32+
-dontwarn kotlinx.android.extensions.LayoutContainer
33+
-dontwarn kotlinx.parcelize.Parcelize
34+
-dontwarn org.bouncycastle.jsse.BCSSLParameters
35+
-dontwarn org.bouncycastle.jsse.BCSSLSocket
36+
-dontwarn org.bouncycastle.jsse.provider.BouncyCastleJsseProvider
37+
-dontwarn org.conscrypt.Conscrypt$Version
38+
-dontwarn org.conscrypt.Conscrypt
39+
-dontwarn org.conscrypt.ConscryptHostnameVerifier
40+
-dontwarn org.openjsse.javax.net.ssl.SSLParameters
41+
-dontwarn org.openjsse.javax.net.ssl.SSLSocket
42+
-dontwarn org.openjsse.net.ssl.OpenJSSE

app/src/main/java/com/banuba/example/integrationapp/MainActivity.kt

+28-14
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,18 @@ import android.content.Intent
44
import android.net.Uri
55
import android.os.Bundle
66
import android.util.Log
7+
import android.view.LayoutInflater
78
import androidx.activity.result.contract.ActivityResultContracts
89
import androidx.appcompat.app.AlertDialog
910
import androidx.appcompat.app.AppCompatActivity
1011
import androidx.lifecycle.lifecycleScope
12+
import com.banuba.example.integrationapp.databinding.ActivityMainBinding
1113
import com.banuba.sdk.cameraui.data.PipConfig
1214
import com.banuba.sdk.core.ui.ext.visible
1315
import com.banuba.sdk.export.data.ExportResult
1416
import com.banuba.sdk.export.utils.EXTRA_EXPORTED_SUCCESS
1517
import com.banuba.sdk.ve.flow.VideoCreationActivity
16-
import kotlinx.android.synthetic.main.activity_main.*
18+
1719

1820
class MainActivity : AppCompatActivity() {
1921

@@ -71,15 +73,22 @@ class MainActivity : AppCompatActivity() {
7173
}
7274
}
7375

76+
private var _binding: ActivityMainBinding? = null
77+
78+
private val binding: ActivityMainBinding
79+
get() = requireNotNull(_binding)
80+
7481
override fun onCreate(savedInstanceState: Bundle?) {
7582
super.onCreate(savedInstanceState)
76-
setContentView(R.layout.activity_main)
83+
_binding = ActivityMainBinding.inflate(LayoutInflater.from(this))
84+
85+
setContentView(binding.root)
7786

7887
// Handle Video Editor license flow
7988
val videoEditor = (application as SampleApp).videoEditor
8089
if (videoEditor == null) {
81-
licenseStateView.visible()
82-
licenseStateView.text = SampleApp.ERR_SDK_NOT_INITIALIZED
90+
binding.licenseStateView.visible()
91+
binding.licenseStateView.text = SampleApp.ERR_SDK_NOT_INITIALIZED
8392
return
8493
}
8594

@@ -90,32 +99,37 @@ class MainActivity : AppCompatActivity() {
9099
// ✅ License is active, all good
91100
// You can show button that opens Video Editor or
92101
// Start Video Editor right away
93-
btnVideoEditor.setOnClickListener {
102+
binding.btnVideoEditor.setOnClickListener {
94103
openVideoEditor()
95104
}
96-
btnPiPVideoEditor.setOnClickListener {
105+
binding.btnPiPVideoEditor.setOnClickListener {
97106
requestVideoOpenPIP.launch("video/*")
98107
}
99-
btnDraftsVideoEditor.setOnClickListener {
108+
binding.btnDraftsVideoEditor.setOnClickListener {
100109
openVideoEditorDrafts()
101110
}
102-
btnSlideShowVideoEditorTrimmer.setOnClickListener {
111+
binding.btnSlideShowVideoEditorTrimmer.setOnClickListener {
103112
requestImageOpenTrimmer.launch("image/*")
104113
}
105114
} else {
106115
// ❌ Use of Video Editor is restricted. License is revoked or expired.
107-
licenseStateView.text = SampleApp.ERR_LICENSE_REVOKED
116+
binding.licenseStateView.text = SampleApp.ERR_LICENSE_REVOKED
108117
Log.w(SampleApp.TAG, SampleApp.ERR_LICENSE_REVOKED)
109118

110-
licenseStateView.visible()
111-
btnVideoEditor.isEnabled = false
112-
btnPiPVideoEditor.isEnabled = false
113-
btnDraftsVideoEditor.isEnabled = false
114-
btnSlideShowVideoEditorTrimmer.isEnabled = false
119+
binding.licenseStateView.visible()
120+
binding.btnVideoEditor.isEnabled = false
121+
binding.btnPiPVideoEditor.isEnabled = false
122+
binding.btnDraftsVideoEditor.isEnabled = false
123+
binding.btnSlideShowVideoEditorTrimmer.isEnabled = false
115124
}
116125
}
117126
}
118127

128+
override fun onDestroy() {
129+
super.onDestroy()
130+
_binding = null
131+
}
132+
119133
private fun openVideoEditor(pipVideo: Uri = Uri.EMPTY) {
120134
val videoCreationIntent = VideoCreationActivity.startFromCamera(
121135
context = this,

app/src/main/java/com/banuba/example/integrationapp/VideoEditorModule.kt

-21
Original file line numberDiff line numberDiff line change
@@ -75,19 +75,6 @@ class VideoEditorModule {
7575
private class SampleIntegrationKoinModule {
7676

7777
val module = module {
78-
single<ExportFlowManager> {
79-
ForegroundExportFlowManager(
80-
exportDataProvider = get(),
81-
exportSessionHelper = get(),
82-
exportDir = get(named("exportDir")),
83-
shouldClearSessionOnFinish = true,
84-
publishManager = get(),
85-
errorParser = get(),
86-
exportBundleProvider = get(),
87-
eventConverter = get()
88-
)
89-
}
90-
9178
/**
9279
* Provides params for export
9380
* */
@@ -114,14 +101,6 @@ private class SampleIntegrationKoinModule {
114101
AudioBrowserMusicProvider()
115102
}
116103

117-
single<CoverProvider> {
118-
CoverProvider.EXTENDED
119-
}
120-
121-
single<CameraTimerActionProvider> {
122-
HandsFreeTimerActionProvider()
123-
}
124-
125104
single<AspectRatioProvider> {
126105
object : AspectRatioProvider {
127106
override fun provide(): AspectRatio = AspectRatio(9.0 / 16)

build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22
buildscript {
3-
ext.kotlin_version = "1.7.10"
3+
ext.kotlin_version = "1.8.22"
44

55
repositories {
66
google()
77
jcenter()
88
}
99
dependencies {
10-
classpath "com.android.tools.build:gradle:7.2.0"
10+
classpath "com.android.tools.build:gradle:8.1.2"
1111
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1212

1313
// NOTE: Do not place your application dependencies here; they belong

gradle.properties

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,4 @@ android.useAndroidX=true
1818
# Automatically convert third-party libraries to use AndroidX
1919
android.enableJetifier=true
2020
# Kotlin code style for this project: "official" or "obsolete":
21-
kotlin.code.style=official
22-
android.bundle.enableUncompressedNativeLibs=false
21+
kotlin.code.style=official

gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip

0 commit comments

Comments
 (0)