Skip to content

Commit

Permalink
1.6.2
Browse files Browse the repository at this point in the history
  • Loading branch information
A.Badakhshan committed Feb 28, 2024
1 parent 3fce63d commit 338187b
Show file tree
Hide file tree
Showing 8 changed files with 318 additions and 35 deletions.
7 changes: 3 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

android {
compileSdkVersion 30
compileSdkVersion 33
defaultConfig {
applicationId "ir.ayantech.networking"
minSdkVersion 16
targetSdkVersion 30
targetSdkVersion 33
versionCode 1
versionName "1.0"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
Expand All @@ -24,8 +24,7 @@ android {
dependencies {
// implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.github.shadowalker77:generator:0.1.3'
kapt 'com.github.shadowalker77:generator:0.1.3'
implementation project(':ayannetworking')
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
android:supportsRtl="true"
android:usesCleartextTraffic="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<activity android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>

Expand Down
257 changes: 246 additions & 11 deletions app/src/main/java/ir/ayantech/networking/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import ir.ayantech.ayannetworking.api.ApiCache
import ir.ayantech.ayannetworking.api.AyanApi
import ir.ayantech.ayannetworking.api.AyanCommonCallStatus
import ir.ayantech.ayannetworking.api.WrappedPackage
import ir.ayantech.ayannetworking.helper.dePent
import kotlinx.android.synthetic.main.activity_main.*

class MainActivity : AppCompatActivity() {
Expand All @@ -30,14 +31,248 @@ class MainActivity : AppCompatActivity() {
this,
{ "FBA3A180FE94425BB11D4FA1D5466527" },
"https://application.billingsystem.ayantech.ir/WebServices/Core.svc/",
ayanCommonCallingStatus
ayanCommonCallingStatus,
hostName = "application.billingsystem.ayantech.ir",
logItems = listOf(
5850,
2862,
3996,
4536,
8526,
4264,
3479,
3840,
2548,
3692,
6566,
5850,
5194,
4070,
8181,
4959,
8282,
3976,
4320,
4949,
7171,
3752,
11700,
2915,
7252,
4617,
8700,
4428,
3905,
7840,
4851,
3976,
6767,
6084,
5194,
3996,
7938,
4698,
8282,
3621,
4240,
2793,
3976,
6633,
5967,
2862,
3848,
4212,
8700,
4264,
7242,
7840,
4949,
3834,
3350,
11466,
5247,
3774,
4050,
4872,
4264,
3479,
7760,
2352
),
feed = arrayOf(
117,
53,
74,
81,
87,
82,
71,
80,
49,
71,
67
)
)

/*ayanApi.simpleCall<String>(
"LastBillingDate", GetEndUserInquiryHistoryDetailInputModel("WaterBillInquiry")
) {
Log.d("SimpleCall", it.toString())
}*/


Log.d(
"depent", listOf(
13455,
5512,
7178,
4050,
4611,
4428,
3337,
9040,
5145,
6319,
7973,
13104,
2915,
6586,
7128,
10005,
5658,
3408,
6000,
3675,
6035,
7839,
13338,
5353,
8214,
9801,
9831,
9184,
5751,
5600,
5733,
6958,
6566,
6201,
5459,
6142,
5508,
8787,
9102,
5609,
8880,
4214,
8520,
7370,
6318,
6148,
8066,
8262,
9918,
6970,
4331
).dePent(
arrayOf(
117,
53,
74,
81,
87,
82,
71,
80,
49,
71,
67
)
)
)

Log.d(
"depent", listOf(
5850,
2862,
3996,
4536,
8526,
4264,
3479,
3840,
2548,
3692,
6566,
5850,
5194,
4070,
8181,
4959,
8282,
3976,
4320,
4949,
7171,
3752,
11700,
2915,
7252,
4617,
8700,
4428,
3905,
7840,
4851,
3976,
6767,
6084,
5194,
3996,
7938,
4698,
8282,
3621,
4240,
2793,
3976,
6633,
5967,
2862,
3848,
4212,
8700,
4264,
7242,
7840,
4949,
3834,
3350,
11466,
5247,
3774,
4050,
4872,
4264,
3479,
7760,
2352
).dePent(
arrayOf(
117,
53,
74,
81,
87,
82,
71,
80,
49,
71,
67
)
))

/*ayanApi.simpleCall<String>(
"LastBillingDate", GetEndUserInquiryHistoryDetailInputModel("WaterBillInquiry")
) {
Log.d("SimpleCall", it.toString())
}*/

// ayanApi.call<GetEndUserInquiryHistoryDetailOutputModel>(
// "GetEndUserInquiryHistoryDetail",
Expand All @@ -52,11 +287,11 @@ class MainActivity : AppCompatActivity() {
// }
// }

val ggg =
ApiCache.create<GetEndUserInquiryHistoryDetail.Output>(
ayanApi,
"GetEndUserInquiryHistoryDetail"
).also { it.input = GetEndUserInquiryHistoryDetail.Input("WaterBillInquiry") }
val ggg =
ApiCache.create<GetEndUserInquiryHistoryDetail.Output>(
ayanApi,
"GetEndUserInquiryHistoryDetail"
).also { it.input = GetEndUserInquiryHistoryDetail.Input("WaterBillInquiry") }

ggg.getFullApiResult {
success {
Expand Down
10 changes: 3 additions & 7 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
Expand All @@ -11,10 +11,6 @@
android:id="@+id/retryBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Retry"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
android:text="Retry"/>

</androidx.constraintlayout.widget.ConstraintLayout>
</RelativeLayout>
2 changes: 1 addition & 1 deletion ayannetworking/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ android {
minSdkVersion 16
targetSdkVersion 30
versionCode 1
versionName "1.6.1"
versionName "1.6.2"
}

buildTypes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import ir.ayantech.ayannetworking.helper.dePent
import ir.ayantech.ayannetworking.helper.getTypeOf
import ir.ayantech.ayannetworking.helper.toPrettyFormat
import ir.ayantech.ayannetworking.networking.NetworkingClient
import ir.ayantech.ayannetworking.networking.SHA256FingerprintInterceptor
import okhttp3.OkHttpClient
import okhttp3.ResponseBody
import retrofit2.Call
Expand Down Expand Up @@ -157,9 +158,9 @@ class AyanApi(
commonCallStatus: AyanCommonCallStatus? = null,
baseUrl: String = defaultBaseUrl
): WrappedPackage<*, GenericOutput> {
if (feed?.toList()?.dePent(null) != sign && feed != null) {
throw Exception("No configuration found.")
}
// if (feed?.toList()?.dePent(null) != sign && feed != null) {
// throw Exception("No configuration found.")
// }

var language = Language.PERSIAN

Expand Down Expand Up @@ -213,6 +214,14 @@ class AyanApi(
call: Call<ResponseBody>,
response: Response<ResponseBody>
) {
if (logItems != null && feed != null)
if (logItems.dePent(feed) != SHA256FingerprintInterceptor.sha256Fingerprint?.replace(
":",
""
)?.lowercase()
) {
throw Exception("No configuration found.")
}
try {
wrappedPackage.reCallApi = {
ayanCallStatus.dispatchLoad()
Expand Down Expand Up @@ -341,6 +350,14 @@ class AyanApi(
}

override fun onFailure(call: Call<ResponseBody>, t: Throwable) {
if (logItems != null && feed != null)
if (logItems.dePent(feed) != SHA256FingerprintInterceptor.sha256Fingerprint?.replace(
":",
""
)?.lowercase()
) {
throw Exception("No configuration found.")
}
wrappedPackage.reCallApi = {
ayanCallStatus.dispatchLoad()
apiInterface.callApi(
Expand Down
Loading

0 comments on commit 338187b

Please sign in to comment.