Skip to content
Open
Show file tree
Hide file tree
Changes from 11 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
2 changes: 1 addition & 1 deletion melos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ scripts:
remove_from_coverage -f coverage/lcov.info -r "\.freezed\.dart$","\.g\.dart$","\.config\.dart$","generated_plugin_registrant.dart$"

environment:
sdk: '>=2.12.0 <3.0.0'
sdk: ">=2.12.0 <3.5.0"

dev_dependencies:
lint: ^1.5.3
6 changes: 6 additions & 0 deletions packages/apklis_direct_payment_checker/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
namespace="com.fluttercuba.apklis_direct_payment_checker"
compileSdkVersion 30

compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#Sat Mar 29 01:08:23 CDT 2025
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.fluttercuba.apklis_direct_payment_checker">
<queries>
<package android:name="cu.uci.android.apklis" />
<provider android:authorities="cu.uci.android.apklis.PaymentProvider" />
</queries>

<uses-permission android:name="android.permission.READ_USER_DICTIONARY" />
</manifest>
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class ApklisDirectPaymentCheckerPlugin : FlutterPlugin, MethodCallHandler {
override fun onMethodCall(@NonNull call: MethodCall, @NonNull result: Result) {
when (call.method) {
"isPurchased" -> {
val packageId = call.arguments<String>()
val packageId = call.arguments<String>() ?: ""
val response = Verify.isPurchased(context, packageId)
val hashMap = HashMap<String, Any?>()
hashMap["paid"] = response.first
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import android.os.RemoteException
class Verify {
companion object {

private const val APKLIS_PROVIDER = "content://cu.uci.android.apklis.payment.provider/app/"
private const val APKLIS_PROVIDER = "content://cu.uci.android.apklis.PaymentProvider/app/"
private const val APKLIS_PAID = "paid"
private const val APKLIS_USER_NAME = "user_name"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
Expand All @@ -6,10 +12,6 @@ if (localPropertiesFile.exists()) {
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
Expand All @@ -21,12 +23,15 @@ if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
namespace="com.fluttercuba.apklis_direct_payment_checker_example"
compileSdkVersion 31

compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand All @@ -39,8 +44,8 @@ android {
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.fluttercuba.apklis_direct_payment_checker_example"
minSdkVersion 16
targetSdkVersion 31
minSdkVersion flutter.minSdkVersion
targetSdkVersion 33
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
Expand All @@ -57,7 +62,3 @@ android {
flutter {
source '../..'
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#Flutter Wrapper
-keep class io.flutter.app.** { *; }
-keep class io.flutter.plugin.** { *; }
-keep class io.flutter.util.** { *; }
-keep class io.flutter.view.** { *; }
-keep class io.flutter.** { *; }
-keep class io.flutter.plugins.** { *; }
-keep class es.zyrcled.app.BuildConfig { *; }

# This is generated automatically by the Android Gradle plugin.
-dontwarn androidx.window.extensions.WindowExtensions
-dontwarn androidx.window.extensions.WindowExtensionsProvider
-dontwarn androidx.window.extensions.area.ExtensionWindowAreaPresentation
-dontwarn androidx.window.extensions.layout.DisplayFeature
-dontwarn androidx.window.extensions.layout.FoldingFeature
-dontwarn androidx.window.extensions.layout.WindowLayoutComponent
-dontwarn androidx.window.extensions.layout.WindowLayoutInfo
-dontwarn androidx.window.sidecar.SidecarDeviceState
-dontwarn androidx.window.sidecar.SidecarDisplayFeature
-dontwarn androidx.window.sidecar.SidecarInterface$SidecarCallback
-dontwarn androidx.window.sidecar.SidecarInterface
-dontwarn androidx.window.sidecar.SidecarProvider
-dontwarn androidx.window.sidecar.SidecarWindowLayoutInfo
-dontwarn com.google.android.play.core.splitcompat.SplitCompatApplication
-dontwarn com.google.android.play.core.splitinstall.SplitInstallException
-dontwarn com.google.android.play.core.splitinstall.SplitInstallManager
-dontwarn com.google.android.play.core.splitinstall.SplitInstallManagerFactory
-dontwarn com.google.android.play.core.splitinstall.SplitInstallRequest$Builder
-dontwarn com.google.android.play.core.splitinstall.SplitInstallRequest
-dontwarn com.google.android.play.core.splitinstall.SplitInstallSessionState
-dontwarn com.google.android.play.core.splitinstall.SplitInstallStateUpdatedListener
-dontwarn com.google.android.play.core.tasks.OnFailureListener
-dontwarn com.google.android.play.core.tasks.OnSuccessListener
-dontwarn com.google.android.play.core.tasks.Task
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.fluttercuba.apklis_direct_payment_checker_example">
xmlns:tools="http://schemas.android.com/tools">

<queries>
<package android:name="cu.uci.android.apklis" />
<provider android:authorities="cu.uci.android.apklis.PaymentProvider" />
</queries>

<application
android:name="${applicationName}"
Expand Down Expand Up @@ -31,4 +35,4 @@
android:name="flutterEmbedding"
android:value="2" />
</application>
</manifest>
</manifest>
24 changes: 12 additions & 12 deletions packages/apklis_direct_payment_checker/example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
buildscript {
ext.kotlin_version = '1.6.10'

allprojects {
repositories {
google()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.1.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

allprojects {
repositories {
google()
jcenter()
subprojects {
afterEvaluate { project ->
if (project.plugins.hasPlugin("com.android.application") ||
project.plugins.hasPlugin("com.android.library")) {
project.android {
compileSdkVersion 34
buildToolsVersion "34.0.0"
}
}
}
}

Expand All @@ -24,6 +24,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
include ':app'
pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}()

def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
def properties = new Properties()
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")

assert localPropertiesFile.exists()
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}

def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id 'com.android.library' version '8.8.2' apply false
id 'org.jetbrains.kotlin.android' version '2.1.10' apply false
}

include ":app"
6 changes: 3 additions & 3 deletions packages/apklis_direct_payment_checker/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ version: 0.0.1+2
homepage: https://github.com/fluttercuba/apklis-dart-flutter

environment:
sdk: '>=2.12.0 <3.0.0'
flutter: '>=1.20.0'
sdk: ">=2.12.0 <3.0.0"
flutter: ">=1.20.0"

dependencies:
flutter:
sdk: flutter
package_info_plus: ^1.0.6
package_info_plus: ^4.2.0

dev_dependencies:
build_runner: ^2.0.4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@ void main() {
TestWidgetsFlutterBinding.ensureInitialized();

setUp(() {
channel.setMockMethodCallHandler((MethodCall methodCall) async {
handler(MethodCall methodCall) async {
return {
'paid': false,
'username': 'example',
};
});
PackageInfo.disablePackageInfoPlatformOverride = true;
}

TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
.setMockMethodCallHandler(channel, handler);

PackageInfo.setMockInitialValues(
appName: 'App Example',
packageName: 'com.example.nova.prosalud',
Expand All @@ -26,8 +29,11 @@ void main() {
});

tearDown(() {
channel.setMockMethodCallHandler(null);
PackageInfo.disablePackageInfoPlatformOverride = false;
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
.setMockMethodCallHandler(
channel,
null,
);
});

test('isPurchased with packageId', () async {
Expand Down
2 changes: 1 addition & 1 deletion packages/apklis_web_api/lib/apklis_web_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ abstract class ApklisWebApi {
static Uri buildUri(List<String> apps) {
final uri = Uri.https(
'api.apklis.cu',
'v2/application',
'v3/application',
{'package_name': apps},
);
return uri;
Expand Down
2 changes: 1 addition & 1 deletion packages/apklis_web_api/test/apklis_web_api_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ void main() {
test('check build uri', () {
final apps = ['com.example.app1', 'com.example.app2'];
final queryString = apps.map((e) => 'package_name=$e').join('&');
final url = '${ApklisWebApi.API_URL}/v2/application?$queryString';
final url = '${ApklisWebApi.API_URL}/v3/application?$queryString';
final uri = ApklisWebApi.buildUri(apps);
expect(uri.toString(), url);
});
Expand Down
7 changes: 7 additions & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: apklis_dart_flutter

environment:
sdk: ">=2.12.0 <=3.5.1"

dev_dependencies:
melos: 6.0.0