Skip to content

Commit

Permalink
Bump app version to 3.2
Browse files Browse the repository at this point in the history
- added 5 extra webhooks to avoid hooks suspension from discord.
  • Loading branch information
dead8309 committed Sep 15, 2022
1 parent 7cbc6db commit bced130
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ android {
minSdk 27
targetSdk 32
versionCode 3
versionName "3.2"
versionName "3.3"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
Expand Down
30 changes: 26 additions & 4 deletions app/src/main/java/com/my/kizzy/rpc/ImageResolver.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@ import android.content.pm.PackageManager
import android.graphics.Bitmap
import android.graphics.Canvas
import android.util.DisplayMetrics
import com.blankj.utilcode.util.AppUtils
import com.google.gson.Gson
import com.google.gson.JsonSyntaxException
import com.google.gson.reflect.TypeToken
import com.my.kizzy.BuildConfig
import com.my.kizzy.utils.Prefs
import com.my.kizzy.utils.Prefs.RPC_USE_CUSTOM_WEBHOOK
import com.my.kizzy.utils.Prefs.RPC_USE_LOW_RES_ICON
import okhttp3.*
import okhttp3.MediaType.Companion.toMediaTypeOrNull
import okhttp3.RequestBody.Companion.asRequestBody
Expand Down Expand Up @@ -93,10 +96,12 @@ class ImageResolver {
val applicationInfo =
context.packageManager.getApplicationInfo(packageName, PackageManager.GET_META_DATA)
val res = context.packageManager.getResourcesForApplication(applicationInfo)
val icon = res.getDrawableForDensity(
val icon = if (Prefs[RPC_USE_LOW_RES_ICON,false])
AppUtils.getAppIcon(packageName)
else res.getDrawableForDensity(
applicationInfo.icon,
DisplayMetrics.DENSITY_XXXHIGH
)
DisplayMetrics.DENSITY_XXXHIGH)

val bitmap = icon?.let {
Bitmap.createBitmap(it.intrinsicWidth,
icon.intrinsicHeight,
Expand Down Expand Up @@ -140,8 +145,10 @@ class ImageResolver {
.addFormDataPart("content", "${file.name} from Rpc")
.build()

var url = Prefs[RPC_USE_CUSTOM_WEBHOOK, URLS.random()]
if (url.compareTo(BuildConfig.RPC_IMAGE_API)<10) url = URLS.random()
val req: Request = Request.Builder()
.url(BuildConfig.RPC_IMAGE_API)
.url(url)
.post(body)
.build()

Expand Down Expand Up @@ -183,4 +190,19 @@ class ImageResolver {
return image
}

companion object {
private const val WEBHOOK1 =
"https://discord.com/api/webhooks/1020065785495945277/O1jmWIEWoHVUTKS_wlDubq6wky-lNWvZgRIhhrvL5Zs5umYDPRd2ZLyddV-0hzqxOYys?wait=true"
private const val WEBHOOK2 =
"https://discord.com/api/webhooks/1020066240372416543/moEas3gIkIv9__niuHOTkpf925MRvjb75aWGGEEwXlLKxLJ4xHOhjKubf1AM-ztv1e3u?wait=true"
private const val WEBHOOK3 =
"https://discord.com/api/webhooks/1020066539615043675/YVLzNa3Bsfw_A_nNItIAwFT5QJgNAecyxvltFYlqJ33ZW_xTYPNudQ3Rx818Y-TcQuhX?wait=true"
private const val WEBHOOK4 =
"https://discord.com/api/webhooks/1020067456682831922/pgumvpp0AkdY8U70At3T5L9VVSyP87IfCVaDpDj5-eIJuaucdGRoTm6igLXRutIjwdng?wait=true"
private const val WEBHOOK5 =
"https://discord.com/api/webhooks/1020067820614197360/1w9LG1lpkuK7kAWLbYgLbA1Ivhzaxf1Kz_2_IenadpBzFYHaxcaQa7Flp_fxQZSbEi8g?wait=true"
val URLS = listOf(WEBHOOK1, WEBHOOK2 , WEBHOOK3, WEBHOOK4,WEBHOOK5,BuildConfig.RPC_IMAGE_API)

}
}

2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ kotlin.code.style=official
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true
WEBHOOK="https://discord.com/api/webhooks/1003272608193724516/vUi-4nKjaKMCFQYBlukz0nkqgXg7otbgzHq_lO2Z5qORfSjHDjcUpqGpx6RFAoaUlYGU?wait=true"
WEBHOOK="https://discord.com/api/webhooks/1020052951034757161/V5ubjcuCUe5WG5yZmDpUyZML9DJqF9mk3XvxAxxd2hJUlG4TFyiktQ4t77Qj8De_SCWl?wait=true"
KIZZY_GOOGLE_IMAGE_API="https://script.google.com/macros/s/AKfycbyRP05ZEJ8Vmlqwf3oUZQ0vnQJIeXAZr0_ySz1B0lWam5_DwUog/exec?url="
RELEASE_STORE_FILE=Kizzy.keystore
RELEASE_STORE_PASSWORD=monu8309
Expand Down

1 comment on commit bced130

@dead8309
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bumped app version to 3.3*

Please sign in to comment.