Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,6 @@ nitrogen/
.bsb.lock
*.res.js
*.gen.tsx


lib/**
14 changes: 11 additions & 3 deletions HyperswitchSdkReactNative.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,19 @@ Pod::Spec.new do |s|
s.platforms = { :ios => min_ios_version_supported }
s.source = { :git => "https://github.com/juspay/hyperswitch-sdk-react-native.git", :tag => "#{s.version}" }

s.source_files = "ios/**/*.{h,m,mm,cpp}"
s.source_files = "ios/**/*.{h,m,mm,cpp,swift}"
s.private_header_files = "ios/**/*.h"
s.resources = ["ios/assets/hyperswitch.bundle"]
s.resources = ["ios/Resources/hyperswitch.bundle"]

s.frameworks = "PassKit"
s.dependency 'HyperOTA', '0.0.8'

s.pod_target_xcconfig = {
'DEFINES_MODULE' => 'YES',
'OTHER_SWIFT_FLAGS' => "-enable-experimental-feature AccessLevelOnImport"
}

s.dependency 'ReactAppDependencyProvider'
add_dependency(s, "React-RCTAppDelegate")

install_modules_dependencies(s)
end
48 changes: 42 additions & 6 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ buildscript {
repositories {
google()
mavenCentral()
maven { url "https://maven.juspay.in/hyper-sdk/" }
}

dependencies {
Expand All @@ -25,6 +26,10 @@ def getExtOrIntegerDefault(name) {
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["HyperswitchSdkReactNative_" + name]).toInteger()
}

def isNewArchitectureEnabled() {
return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true"
}

android {
namespace "com.hyperswitchsdkreactnative"

Expand All @@ -33,25 +38,38 @@ android {
defaultConfig {
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
versionCode 1
versionName "1.0"
buildConfigField "String", "VERSION_NAME", "\"${version}\""
buildConfigField "boolean", "IS_HERMES_ENABLED", hermesEnabled
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", newArchEnabled
}

buildFeatures {
buildConfig true
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
debug {
debuggable true
}
}

lintOptions {
disable "GradleCompatible"
abortOnError false
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = '17'
}

sourceSets {
Expand All @@ -63,20 +81,38 @@ android {
]
}
}

packagingOptions {
pickFirst '**/libc++_shared.so'
pickFirst '**/libfbjni.so'
pickFirst '**/libreactnativejni.so'
}
}
rootProject.repositories {
mavenCentral()
google()
maven { url "https://maven.juspay.in/hyper-sdk/" }
}

repositories {
mavenCentral()
google()
maven { url "https://maven.juspay.in/hyper-sdk/" }
}

def kotlin_version = getExtOrDefault("kotlinVersion")

apply from: "./hyperswitch_autolinking.gradle"
applyHyperswitchAutolinking(project)

dependencies {
implementation "com.facebook.react:react-android"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "com.google.android.gms:play-services-wallet:19.4.0"
implementation 'androidx.activity:activity-ktx:1.10.1'
implementation("org.greenrobot:eventbus")
implementation "in.juspay:hyperotareact:0.0.1-xota.10"
// implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.7'
// implementation 'androidx.lifecycle:lifecycle-common-java8:2.8.7'
// implementation 'androidx.fragment:fragment-ktx:1.8.5'
}

apply from: "./hyperswitch_autolinking.gradle"
applyHyperswitchAutolinking(project)
72 changes: 72 additions & 0 deletions android/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Hyperswitch SDK ProGuard Rules

# Keep public classes and methods that are part of the SDK API
-keep public class com.hyperswitchsdkreactnative.** {
public *;
}

# Keep React Native module classes
-keep class com.hyperswitchsdkreactnative.modules.** { *; }
-keep class com.hyperswitchsdkreactnative.provider.** { *; }
-keep class com.hyperswitchsdkreactnative.gpay.** { *; }
-keep class com.hyperswitchsdkreactnative.utils.** { *; }

# Keep annotation classes
-keepattributes *Annotation*
-keepattributes RuntimeVisibleAnnotations
-keepattributes RuntimeInvisibleAnnotations

# Keep Kotlin metadata
-keep class kotlin.Metadata { *; }
-keep class kotlin.jvm.internal.Intrinsics { *; }

# Keep React Native classes
-keep class com.facebook.react.** { *; }
-keep class com.facebook.react.bridge.** { *; }
-keep class com.facebook.react.uimanager.** { *; }

# Keep Google Pay classes
-keep class com.google.android.gms.wallet.** { *; }
-keep class com.google.android.gms.common.api.** { *; }

# Keep AndroidX classes that are commonly used
-keep class androidx.lifecycle.** { *; }
-keep class androidx.fragment.** { *; }
-keep class androidx.activity.** { *; }

# Keep enum classes
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}

# Keep serializable classes
-keepnames class * implements java.io.Serializable
-keepclassmembers class * implements java.io.Serializable {
static final long serialVersionUID;
private static final java.io.ObjectStreamField[] serialPersistentFields;
!static !transient <fields>;
!private <methods>;
private void writeObject(java.io.ObjectOutputStream);
private void readObject(java.io.ObjectInputStream);
java.lang.Object writeReplace();
java.lang.Object readResolve();
}

# Keep callback methods
-keepclassmembers class * {
@android.webkit.JavascriptInterface <methods>;
}

# Keep promise-related classes
-keep class com.facebook.react.bridge.Promise { *; }
-keep class com.facebook.react.bridge.WritableMap { *; }
-keep class com.facebook.react.bridge.ReadableMap { *; }

# Optimization settings
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
24 changes: 23 additions & 1 deletion android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,2 +1,24 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<manifest xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android">
<application >
<meta-data android:name="com.google.android.gms.wallet.api.enabled" android:value="true" />
<activity android:enableOnBackInvokedCallback="true"
tools:targetApi="33" android:name="com.hyperswitchsdkreactnative.gpay.GooglePayActivity" android:exported="false">
</activity>
<activity
android:name=".activity.RedirectActivity"
android:exported="true"
android:launchMode="singleTask"
>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data android:scheme="${applicationId}.hyperswitch" />
<data android:host="" tools:ignore="AppLinkUrlError" />
</intent-filter>
</activity>
</application>
</manifest>
Loading
Loading