Skip to content

Commit a56206c

Browse files
Removed all ad-code, renamed huawei flavor to generic flavor
1 parent e10492d commit a56206c

File tree

12 files changed

+6
-464
lines changed

12 files changed

+6
-464
lines changed

app/build.gradle

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,14 @@ android {
8383
dimension 'version'
8484
versionNameSuffix '.gplay'
8585
}
86-
huawei {
87-
dimension 'version'
88-
versionNameSuffix '.huawei'
89-
}
9086
ose {
9187
dimension 'version'
9288
versionNameSuffix '.ose'
9389
}
90+
generic {
91+
dimension 'version'
92+
versionNameSuffix '.generic'
93+
}
9494
}
9595

9696
// the flavor alphatest should not be used for the build type release, we filter this here
@@ -182,11 +182,6 @@ dependencies {
182182
gplayImplementation "com.google.android.gms:play-services-maps:18.1.0"
183183
gplayImplementation "com.google.android.gms:play-services-location:20.0.0"
184184

185-
// Huawei Ads Lite (works only on Huawei phones)
186-
huaweiImplementation "com.huawei.hms:ads:3.4.49.301" // should be replaced by ads-lite when it can be tested with a huawei phone
187-
//implementation "com.huawei.hms:ads-lite:13.4.49.301"
188-
huaweiImplementation "com.huawei.hms:ads-consent:3.4.49.301"
189-
190185
// Workmanager support
191186
implementation "androidx.work:work-runtime-ktx:$version_work"
192187
androidTestImplementation "androidx.work:work-testing:$version_work"

app/src/huawei/java/at/techbee/jtx/flavored/BillingManager.kt renamed to app/src/generic/java/at/techbee/jtx/flavored/BillingManager.kt

File renamed without changes.

app/src/huawei/java/at/techbee/jtx/flavored/MapComposable.kt renamed to app/src/generic/java/at/techbee/jtx/flavored/MapComposable.kt

File renamed without changes.

app/src/huawei/java/at/techbee/jtx/flavored/ReviewManager.kt renamed to app/src/generic/java/at/techbee/jtx/flavored/ReviewManager.kt

File renamed without changes.

app/src/gplay/java/at/techbee/jtx/flavored/AdManager.kt

Lines changed: 0 additions & 56 deletions
This file was deleted.

app/src/huawei/java/at/techbee/jtx/flavored/AdManager.kt

Lines changed: 0 additions & 144 deletions
This file was deleted.

app/src/main/java/at/techbee/jtx/MainActivity2.kt

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import at.techbee.jtx.MainActivity2.Companion.BUILD_FLAVOR_GOOGLEPLAY
3232
import at.techbee.jtx.MainActivity2.Companion.BUILD_FLAVOR_OSE
3333
import at.techbee.jtx.database.Module
3434
import at.techbee.jtx.database.properties.Attachment
35-
import at.techbee.jtx.flavored.AdManager
3635
import at.techbee.jtx.flavored.BillingManager
3736
import at.techbee.jtx.flavored.JtxReviewManager
3837
import at.techbee.jtx.ui.GlobalStateHolder
@@ -74,7 +73,7 @@ const val AUTHORITY_FILEPROVIDER = "at.techbee.jtx.fileprovider"
7473

7574
const val BUILD_FLAVOR_OSE = "ose"
7675
const val BUILD_FLAVOR_GOOGLEPLAY = "gplay"
77-
const val BUILD_FLAVOR_HUAWEI = "huawei"
76+
const val BUILD_FLAVOR_GENERIC = "generic"
7877
}
7978

8079
override fun onCreate(savedInstanceState: Bundle?) {
@@ -90,16 +89,8 @@ const val AUTHORITY_FILEPROVIDER = "at.techbee.jtx.fileprovider"
9089

9190
TimeZoneRegistryFactory.getInstance().createRegistry() // necessary for ical4j
9291
createNotificationChannel() // Register Notification Channel for Reminders
93-
9492
BillingManager.getInstance().initialise(this)
9593

96-
/* TODO
97-
billingManager?.isProPurchased?.observe(this) { isPurchased ->
98-
if(!isPurchased)
99-
AdManager.getInstance()?.checkOrRequestConsentAndLoadAds(this, applicationContext)
100-
}
101-
*/
102-
10394
setContent {
10495
val isProPurchased = BillingManager.getInstance().isProPurchased.observeAsState()
10596
JtxBoardTheme(
@@ -123,7 +114,6 @@ const val AUTHORITY_FILEPROVIDER = "at.techbee.jtx.fileprovider"
123114

124115
override fun onResume() {
125116
super.onResume()
126-
AdManager.getInstance()?.resumeAds()
127117

128118
//handle intents, but only if it wasn't already handled
129119
if(intent.hashCode() != lastProcessedIntentHash) {
@@ -178,12 +168,6 @@ const val AUTHORITY_FILEPROVIDER = "at.techbee.jtx.fileprovider"
178168
}
179169
}
180170

181-
override fun onPause() {
182-
super.onPause()
183-
AdManager.getInstance()?.pauseAds()
184-
}
185-
186-
187171
private fun createNotificationChannel() {
188172
// Create the NotificationChannel, but only on API 26+ because
189173
// the NotificationChannel class is new and not in the support library
@@ -273,7 +257,6 @@ fun MainNavHost(
273257
navController = navController)
274258
}
275259
composable(NavigationDrawerDestination.DONATE.name) { DonateScreen(navController) }
276-
composable(NavigationDrawerDestination.ADINFO.name) { AdInfoScreen(navController) }
277260
composable(NavigationDrawerDestination.ABOUT.name) {
278261
val viewModel: AboutViewModel = viewModel()
279262
AboutScreen(
@@ -341,7 +324,6 @@ fun MainNavHost(
341324
}
342325
)
343326
}
344-
345327
}
346328

347329
@Preview(showBackground = true)

app/src/main/java/at/techbee/jtx/flavored/AdManagerDefinition.kt

Lines changed: 0 additions & 73 deletions
This file was deleted.

0 commit comments

Comments
 (0)