Skip to content

Commit

Permalink
Merge pull request #68 from iZakirSheikh/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
iZakirSheikh committed May 27, 2024
2 parents 53dc5dc + 58a6b51 commit 8f1a1bc
Show file tree
Hide file tree
Showing 24 changed files with 978 additions and 33 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/release_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
echo "PLACEMENT_INTERSTITIAL=$(echo ${{ secrets.PLACEMENT_INTERSTITIAL }})" >> $GITHUB_ENV
echo "PLAY_CONSOLE_APP_RSA_KEY=$(echo ${{ secrets.PLAY_CONSOLE_APP_RSA_KEY }})" >> $GITHUB_ENV
echo "UNITY_APP_ID=$(echo ${{ secrets.UNITY_APP_ID }})" >> $GITHUB_ENV
echo "IAP_BUY_ME_COFFEE=$(echo ${{ secrets.IAP_BUY_ME_COFFEE }})" >> $GITHUB_ENV
echo "IAP_CODEX=$(echo ${{ secrets.IAP_CODEX }})" >> $GITHUB_ENV
echo "GIT_TAG=$(grep -E "versionName\s*=?\s*['\"]" "app/build.gradle.kts" | awk -F"['\"]" '{print $2}')" >> $GITHUB_ENV
- name: Displaying the environment variable to the console for debugging
run: |
Expand All @@ -29,6 +31,8 @@ jobs:
echo $PLACEMENT_INTERSTITIAL | sed 's/./&‌/g'
echo $PLAY_CONSOLE_APP_RSA_KEY | sed 's/./&‌/g'
echo $IAP_NO_ADS | sed 's/./&‌/g'
echo $IAP_BUY_ME_COFFEE | sed 's/./&‌/g'
echo $IAP_CODEX | sed 's/./&‌/g'
echo $IAP_TAG_EDITOR_PRO | sed 's/./&‌/g'
echo $GIT_TAG | sed 's/./&‌/g'
- name: Configuring Java environment with Zulu JDK 17 and Gradle cache,
Expand Down
3 changes: 2 additions & 1 deletion .idea/appInsightsSettings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 9 additions & 3 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ val secrets = arrayOf(
"PLACEMENT_INTERSTITIAL",
"UNITY_APP_ID",
"PLAY_CONSOLE_APP_RSA_KEY",
"IAP_TAG_EDITOR_PRO"
"IAP_TAG_EDITOR_PRO",
"IAP_CODEX"
)

android {
Expand All @@ -28,8 +29,8 @@ android {
applicationId = "com.prime.player"
minSdk = 21
targetSdk = 34
versionCode = 82
versionName = "2.9.1"
versionCode = 87
versionName = "2.10.1"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables { useSupportLibrary = true }
//Load secrets into BuildConfig
Expand Down Expand Up @@ -73,6 +74,7 @@ android {
buildFeatures { compose = true }
composeOptions { kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get() }
packaging { resources { excludes += "/META-INF/{AL2.0,LGPL2.1}" } }
dynamicFeatures += setOf(":app:codex")
}

// Not moving these to libs.version.toml because i think this is redundant.
Expand Down Expand Up @@ -115,6 +117,10 @@ dependencies {
implementation(libs.media3.session)
implementation(libs.media3.ui)
implementation(libs.mp3agic)
implementation(libs.play.feature.delivery)
//TODO - Updating dependencies caused the app not to compile becasue of some issue with
// internal below dependency and hence this. Remove this in next update.
implementation("com.google.j2objc:j2objc-annotations:3.0.0")
}

// TODO: It appears that Material3 components may be leaking into this project, which is intended to support Material2.
Expand Down
1 change: 1 addition & 0 deletions app/codex/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
41 changes: 41 additions & 0 deletions app/codex/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
plugins {
alias(libs.plugins.android.dynamic.feature)
alias(libs.plugins.kotlin.android)
}
android {
namespace = "com.prime.codex"
compileSdk = 34

defaultConfig {
minSdk = 21
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles("proguard-rules.pro")
}
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs = listOf(
"-Xopt-in=kotlin.RequiresOptIn",
"-Xcontext-receivers"
)
}
}

dependencies {
implementation(project(":app"))
implementation(libs.core.ktx)
// testImplementation(libs.junit)
// androidTestImplementation(libs.ext.junit)
// androidTestImplementation(libs.espresso.core)
implementation(libs.codex.extensions) // To add media3 software decoders and extensions
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.prime.codex

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4

import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.prime.codex", appContext.packageName)
}
}
13 changes: 13 additions & 0 deletions app/codex/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:dist="http://schemas.android.com/apk/distribution">

<dist:module
dist:instant="false"
dist:title="@string/title_codex">
<dist:delivery>
<dist:on-demand />
</dist:delivery>
<dist:fusing dist:include="false" />
</dist:module>
</manifest>
17 changes: 17 additions & 0 deletions app/codex/src/test/java/com/prime/codex/ExampleUnitTest.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.prime.codex

import org.junit.Test

import org.junit.Assert.*

/**
* Example local unit test, which will execute on the development machine (host).
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
class ExampleUnitTest {
@Test
fun addition_isCorrect() {
assertEquals(4, 2 + 2)
}
}
5 changes: 4 additions & 1 deletion app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,7 @@ LineNumberTable, *Annotation*, EnclosingMethod
public static int w(...);
public static int d(...);
# public static int e(...);
}
}

## Don't remove classes from feature modules
-keep class io.github.anilbeesetti.nextlib.media3ext.ffdecoder.** { *; }
1 change: 0 additions & 1 deletion app/src/main/java/com/prime/media/Home.kt
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ import androidx.core.view.WindowInsetsCompat
import androidx.core.view.WindowInsetsControllerCompat
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.navigation.NavController
import androidx.navigation.NavController.OnDestinationChangedListener
import androidx.navigation.NavDestination
import androidx.navigation.NavGraph.Companion.findStartDestination
import androidx.navigation.compose.NavHost
Expand Down
7 changes: 6 additions & 1 deletion app/src/main/java/com/prime/media/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,12 @@ class MainActivity : ComponentActivity(), SystemFacade {
private val billingManager by lazy {
BillingManager(
this,
arrayOf(BuildConfig.IAP_NO_ADS, BuildConfig.IAP_TAG_EDITOR_PRO)
arrayOf(
BuildConfig.IAP_NO_ADS,
BuildConfig.IAP_TAG_EDITOR_PRO,
BuildConfig.IAP_BUY_ME_COFFEE,
BuildConfig.IAP_CODEX
)
)
}

Expand Down
Loading

0 comments on commit 8f1a1bc

Please sign in to comment.