Commit a7b582d7 authored by Sai Srinivas's avatar Sai Srinivas
Browse files

04-11-2025 by Srinivas

Network, Font and Device details issues
And Release Keys
parent f82262ff
import java.util.Properties
import java.io.FileInputStream
plugins {
id("com.android.application")
id("kotlin-android")
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
id("dev.flutter.flutter-gradle-plugin")
}
val keystoreProperties = Properties()
val keystorePropertiesFile = rootProject.file("key.properties")
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(FileInputStream(keystorePropertiesFile))
}
android {
namespace = "in.webgrid.genrentals"
compileSdk = flutter.compileSdkVersion
......@@ -25,17 +32,30 @@ android {
applicationId = "in.webgrid.genrentals"
// You can update the following values to match your application needs.
// For more information, see: https://flutter.dev/to/review-gradle-config.
minSdk = flutter.minSdkVersion
minSdk = 23
targetSdk = 36
versionCode = flutter.versionCode
versionName = flutter.versionName
}
signingConfigs {
create("release") {
keyAlias = keystoreProperties["keyAlias"] as String
keyPassword = keystoreProperties["keyPassword"] as String
storeFile = keystoreProperties["storeFile"]?.let { file(it) }
storePassword = keystoreProperties["storePassword"] as String
}
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig = signingConfigs.getByName("debug")
isMinifyEnabled = true
isShrinkResources = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
signingConfig = signingConfigs.getByName("release")
}
}
}
......
-keep class dev.fluttercommunity.plus.device_info.** { *; }
-dontwarn dev.fluttercommunity.plus.device_info.**
-keep class dev.fluttercommunity.plus.connectivity.** { *; }
-dontwarn dev.fluttercommunity.plus.connectivity.**
-keep class io.flutter.plugin.common.** { *; }
-dontwarn io.flutter.plugin.common.**
-keep class io.flutter.** { *; }
-dontwarn io.flutter.**
-keep class in.webgrid.genrentals.** { *; }
\ No newline at end of file
......@@ -12,9 +12,7 @@
<application
android:label="Gen Rentals"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher"
android:usesCleartextTraffic="true"
android:enableOnBackInvokedCallback="true">
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:exported="true"
......
org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
android.useAndroidX=true
android.enableJetifier=true
flutter.minSdkVersion=23
kotlin.jvm.target.validation.mode = IGNORE
storePassword=genrental
keyPassword=genrental
keyAlias=genrental
storeFile=genrental.jks
\ No newline at end of file
File added
import 'dart:developer';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:gen_rentals/Services/api_calling.dart';
import 'package:device_info_plus/device_info_plus.dart';
import 'package:gen_rentals/Utility/CustomSnackbar.dart';
import 'dart:io';
import 'package:android_id/android_id.dart';
import '../Models/CommonResponse.dart';
import '../Models/ProfileResponse.dart';
......@@ -14,6 +15,14 @@ class RentalProvider extends ChangeNotifier {
FetchMobileResponse? otpResponse;
bool _isLoading = false;
String _deviceDetails = "";
String _deviceId = "";
String _androidId = 'Unknown';
static const _androidIdPlugin = AndroidId();
String get deviceId => _deviceId;
String get deviceDetails => _deviceDetails;
FetchMobileResponse? get response => _response;
bool get isLoading => _isLoading;
......@@ -40,13 +49,17 @@ class RentalProvider extends ChangeNotifier {
Future<void> fetchMobileOtp(String mob, String otp) async {
isOtpLoading = true;
notifyListeners();
try {
final deviceDetails = await getDeviceDetails();
if(Platform.isAndroid){
initAndroidId();
}else{
getDevId();
}
final result = await ApiCalling.fetchMobileOtpApi(mob, otp, deviceDetails);
otpResponse = result;
} catch (e) {
debugPrint("❌ OTP API Error: $e");
debugPrint("❌ OTPs API Error: $e");
otpResponse = null;
} finally {
isOtpLoading = false;
......@@ -54,42 +67,111 @@ class RentalProvider extends ChangeNotifier {
}
}
Future<Map<String, String>> getDeviceDetails() async {
final deviceInfo = DeviceInfoPlugin();
if (Platform.isAndroid) {
final androidInfo = await deviceInfo.androidInfo;
return {
"versionName": androidInfo.version.release ?? "",
"versionCode": androidInfo.version.codename ?? "",
"osVersion": androidInfo.version.release ?? "",
"sdkVersion": androidInfo.version.sdkInt.toString(),
"device": androidInfo.device ?? "",
"model": androidInfo.model ?? "",
"product": androidInfo.product ?? "",
"manufacturer": androidInfo.manufacturer ?? "",
"brand": androidInfo.brand ?? "",
"user": androidInfo.data['user'].toString().trim(),
"display": androidInfo.display ?? "",
"hardware": androidInfo.hardware ?? "",
"board": androidInfo.board ?? "",
"host": androidInfo.host ?? "",
"serial": androidInfo.serialNumber ?? "unknown",
"id": androidInfo.id ?? "",
"bootloader": androidInfo.bootloader ?? "",
"cpuAbi1": androidInfo.supportedAbis.isNotEmpty ? androidInfo.supportedAbis[0] : "",
"cpuAbi2": androidInfo.supportedAbis.length > 1 ? androidInfo.supportedAbis[1] : "",
"fingerprint": androidInfo.fingerprint ?? "",
};
}else{
return {};
Future<void> initAndroidId() async {
String androidId;
var deviceInfo = DeviceInfoPlugin(); // import 'dart:io'
var androidDeviceInfo = await deviceInfo.androidInfo;
_deviceDetails = await "Version Name: " +
androidDeviceInfo.version.baseOS.toString().trim() +
", " +
"Version Code: " +
androidDeviceInfo.version.codename.toString().trim() +
", " +
"OS Version: " +
androidDeviceInfo.version.codename.toString().trim() +
", SDK Version: " +
androidDeviceInfo.version.sdkInt.toString().trim() +
", Device: " +
androidDeviceInfo.device.toString().trim() +
", Model: " +
androidDeviceInfo.model.toString().trim() +
", Product: " +
androidDeviceInfo.product.toString().trim() +
", Manufacturer: " +
androidDeviceInfo.manufacturer.toString().trim() +
", Brand: " +
androidDeviceInfo.brand.toString().trim() +
", User: " +
androidDeviceInfo.data['user'].toString().trim() +
", Display: " +
androidDeviceInfo.display.toString().trim() +
", Hardware: " +
androidDeviceInfo.hardware.toString().trim() +
", Board: " +
androidDeviceInfo.board.toString().trim() +
", Host: " +
androidDeviceInfo.host.toString().trim() +
", Serial: " +
androidDeviceInfo.serialNumber.toString().trim() +
", ID: " +
androidDeviceInfo.id.toString().trim() +
", Bootloader: " +
androidDeviceInfo.bootloader.toString().trim() +
", CPU ABI1: " +
androidDeviceInfo.supported64BitAbis.toString().trim() +
", CPU ABI2: " +
androidDeviceInfo.supported64BitAbis.toString().trim() +
", FingerPrint: " +
androidDeviceInfo.fingerprint.toString().trim();
try {
androidId = await _androidIdPlugin.getId() ?? 'Unknown ID';
_deviceId = androidId;
debugPrint("testing" + deviceId);
debugPrint(_deviceDetails.toString());
} on PlatformException {
androidId = 'Failed to get Android ID.';
}
_androidId = androidId;
print(_deviceDetails);
print(_deviceId);
print(_androidId);
notifyListeners();
}
Future<String?> getDevId() async {
var deviceInfo = DeviceInfoPlugin(); // import 'dart:io'
var iosDeviceInfo = await deviceInfo.iosInfo;
_deviceId = iosDeviceInfo.identifierForVendor!;
_deviceDetails = iosDeviceInfo.toString();
notifyListeners();
}
// Future<Map<String, String>> getDeviceDetails() async {
// final deviceInfo = DeviceInfoPlugin();
//
// if (Platform.isAndroid) {
// final androidInfo = await deviceInfo.androidInfo;
// return {
// "versionName": androidInfo.version.release ?? "",
// "versionCode": androidInfo.version.codename ?? "",
// "osVersion": androidInfo.version.release ?? "",
// "sdkVersion": androidInfo.version.sdkInt.toString(),
// "device": androidInfo.device ?? "",
// "model": androidInfo.model ?? "",
// "product": androidInfo.product ?? "",
// "manufacturer": androidInfo.manufacturer ?? "",
// "brand": androidInfo.brand ?? "",
// "user": androidInfo.data['user'].toString().trim(),
// "display": androidInfo.display ?? "",
// "hardware": androidInfo.hardware ?? "",
// "board": androidInfo.board ?? "",
// "host": androidInfo.host ?? "",
// "serial": androidInfo.serialNumber ?? "unknown",
// "id": androidInfo.id ?? "",
// "bootloader": androidInfo.bootloader ?? "",
// "cpuAbi1": androidInfo.supportedAbis.isNotEmpty ? androidInfo.supportedAbis[0] : "",
// "cpuAbi2": androidInfo.supportedAbis.length > 1 ? androidInfo.supportedAbis[1] : "",
// "fingerprint": androidInfo.fingerprint ?? "",
// };
// }else{
// return {};
// }
//
//
// }
bool _isLoggingOut = false;
bool get isLoggingOut => _isLoggingOut;
......
......@@ -69,7 +69,7 @@ class _BillDetailListScreenState extends State<BillDetailListScreen> {
"Bill List",
style: TextStyle(
fontSize: 16,
fontFamily: "Plus Jakarta Sans",
fontFamily: "Poppins",
fontWeight: FontWeight.w400,
color: Colors.black87,
),
......
......@@ -75,7 +75,7 @@ class _BillDetailScreenState extends State<BillDetailScreen> {
"Bill Details",
style: TextStyle(
fontSize: 16,
fontFamily: "Plus Jakarta Sans",
fontFamily: "Poppins",
fontWeight: FontWeight.w600,
color: Colors.black87,
),
......@@ -158,7 +158,7 @@ class _BillDetailScreenState extends State<BillDetailScreen> {
"Products",
style: TextStyle(
fontSize: 14,
fontFamily: "Plus Jakarta Sans",
fontFamily: "Poppins",
fontWeight: FontWeight.w600,
color: Colors.black87,
),
......@@ -230,7 +230,7 @@ class _BillDetailScreenState extends State<BillDetailScreen> {
"Pay Now",
style: TextStyle(
fontSize: 16,
fontFamily: "Plus Jakarta Sans",
fontFamily: "Poppins",
fontWeight: FontWeight.w600,
),
),
......@@ -268,7 +268,7 @@ class _BillDetailScreenState extends State<BillDetailScreen> {
: "Download Receipt",
style: const TextStyle(
fontSize: 16,
fontFamily: "Plus Jakarta Sans",
fontFamily: "Poppins",
fontWeight: FontWeight.w600,
color: Colors.white,
),
......@@ -316,7 +316,7 @@ class _BillDetailScreenState extends State<BillDetailScreen> {
const Text(
"Pay Now",
style: TextStyle(
fontFamily: "Plus Jakarta Sans",
fontFamily: "Poppins",
fontWeight: FontWeight.w700,
fontSize: 20,
color: Colors.black87,
......@@ -328,7 +328,7 @@ class _BillDetailScreenState extends State<BillDetailScreen> {
"Proceed with payment for this bill?",
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: "Plus Jakarta Sans",
fontFamily: "Poppins",
fontSize: 14,
fontWeight: FontWeight.w400,
color: Colors.grey,
......@@ -356,7 +356,7 @@ class _BillDetailScreenState extends State<BillDetailScreen> {
child: const Text(
"Cancel",
style: TextStyle(
fontFamily: "Plus Jakarta Sans",
fontFamily: "Poppins",
fontWeight: FontWeight.w600,
fontSize: 14,
),
......@@ -382,7 +382,7 @@ class _BillDetailScreenState extends State<BillDetailScreen> {
child: const Text(
"Proceed",
style: TextStyle(
fontFamily: "Plus Jakarta Sans",
fontFamily: "Poppins",
fontWeight: FontWeight.w600,
fontSize: 14,
color: Colors.white,
......@@ -422,7 +422,7 @@ class _BillDetailScreenState extends State<BillDetailScreen> {
const Text(
"Processing Payment...",
style: TextStyle(
fontFamily: "Plus Jakarta Sans",
fontFamily: "Poppins",
fontWeight: FontWeight.w500,
),
),
......@@ -447,7 +447,7 @@ class _BillDetailScreenState extends State<BillDetailScreen> {
const Text(
"Payment Successful!",
style: TextStyle(
fontFamily: "Plus Jakarta Sans",
fontFamily: "Poppins",
fontWeight: FontWeight.w500,
),
),
......@@ -482,7 +482,7 @@ class _BillDetailScreenState extends State<BillDetailScreen> {
maxLines: 2,
style: TextStyle(
fontSize: 14,
fontFamily: "Plus Jakarta Sans",
fontFamily: "Poppins",
color: AppColors.subtitleText,
fontWeight: FontWeight.w400,
),
......@@ -492,7 +492,7 @@ class _BillDetailScreenState extends State<BillDetailScreen> {
value,
style: TextStyle(
fontSize: 14,
fontFamily: "Plus Jakarta Sans",
fontFamily: "Poppins",
fontWeight: isBold ? FontWeight.w700 : FontWeight.w400,
color: highlight
? AppColors.normalText
......
......@@ -89,7 +89,7 @@ class _HelpTicketScreenState extends State<HelpTicketScreen> {
"Help?",
style: TextStyle(
fontSize: 16,
fontFamily: "Plus Jakarta Sans",
fontFamily: "Poppins",
fontWeight: FontWeight.w600,
color: Colors.black87,
),
......@@ -120,7 +120,7 @@ class _HelpTicketScreenState extends State<HelpTicketScreen> {
"order #${ widget.orderId}",
style: TextStyle(
fontSize: 12,
fontFamily: "Plus Jakarta Sans",
fontFamily: "Poppins",
fontWeight: FontWeight.w400,
color: Colors.black87,
),
......@@ -432,7 +432,7 @@ class _HelpTicketScreenState extends State<HelpTicketScreen> {
"Select Your Reason",
style: TextStyle(
fontSize: 18,
fontFamily: "Plus Jakarta Sans",
fontFamily: "Poppins",
fontWeight: FontWeight.w600,
color: Colors.black87,
),
......@@ -503,7 +503,7 @@ class _HelpTicketScreenState extends State<HelpTicketScreen> {
color: AppColors.nearDarkText,
fontSize: 14,
fontWeight: FontWeight.w400,
fontFamily: "Plus Jakarta Sans",
fontFamily: "Poppins",
),
),
const SizedBox(height: 4),
......
......@@ -93,7 +93,7 @@ class _HelpScreenState extends State<HelpScreen> {
"Help?",
style: TextStyle(
fontSize: 16,
fontFamily: "Plus Jakarta Sans",
fontFamily: "Poppins",
fontWeight: FontWeight.w400,
color: Colors.black87,
),
......@@ -389,7 +389,7 @@ class CommonListItem extends StatelessWidget {
style: TextStyle(
fontSize: 12,
fontStyle: FontStyle.normal,
fontFamily: "Plus Jakarta Sans",
fontFamily: "Poppins",
fontWeight: FontWeight.w400,
color: Colors.grey[600],
),
......
......@@ -92,7 +92,7 @@ class _OrderHelpScreenState extends State<OrderHelpScreen> {
"Help?",
style: TextStyle(
fontSize: 16,
fontFamily: "Plus Jakarta Sans",
fontFamily: "Poppins",
fontWeight: FontWeight.w400,
color: Colors.black87,
),
......
......@@ -77,7 +77,7 @@ class _TicketChatScreenState extends State<TicketChatScreen> {
"Help?",
style: TextStyle(
fontSize: 16,
fontFamily: "Plus Jakarta Sans",
fontFamily: "Poppins",
fontWeight: FontWeight.w400,
color: Colors.black87,
),
......@@ -298,7 +298,7 @@ class _TicketChatScreenState extends State<TicketChatScreen> {
imageName[index],
style: const TextStyle(
fontSize: 12,
fontFamily: "Plus Jakarta Sans",
fontFamily: "Poppins",
fontWeight: FontWeight.w500,
color: Colors.black54,
),
......@@ -380,7 +380,7 @@ class _TicketChatScreenState extends State<TicketChatScreen> {
"Send a Message",
style: TextStyle(
fontSize: 16,
fontFamily: "Plus Jakarta Sans",
fontFamily: "Poppins",
fontWeight: FontWeight.w600,
color: Colors.black,
),
......@@ -392,7 +392,7 @@ class _TicketChatScreenState extends State<TicketChatScreen> {
"Message",
style: TextStyle(
fontSize: 14,
fontFamily: "Plus Jakarta Sans",
fontFamily: "Poppins",
fontWeight: FontWeight.w400,
color: AppColors.normalText,
),
......@@ -425,7 +425,7 @@ class _TicketChatScreenState extends State<TicketChatScreen> {
"Attach Screenshot (optional)",
style: TextStyle(
fontSize: 14,
fontFamily: "Plus Jakarta Sans",
fontFamily: "Poppins",
fontWeight: FontWeight.w400,
color: AppColors.normalText,
),
......@@ -573,7 +573,7 @@ class _TicketChatScreenState extends State<TicketChatScreen> {
'${_selectedImages.length} file(s) selected',
style: TextStyle(
fontSize: 12,
fontFamily: "Plus Jakarta Sans",
fontFamily: "Poppins",
fontWeight: FontWeight.w400,
color: Colors.grey[600],
),
......
......@@ -772,7 +772,7 @@ class _ProductsDetailScreenState extends State<ProductsDetailScreen> {
fontSize: 14,
fontStyle: FontStyle.normal,
fontWeight: FontWeight.w400,
fontFamily: "Plus Jakarta Sans",
fontFamily: "Poppins",
),
),
),
......
......@@ -82,7 +82,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
Text(
"Logout",
style: TextStyle(
fontFamily: "Plus Jakarta Sans",
fontFamily: "Poppins",
fontWeight: FontWeight.w700,
fontSize: 20,
color: Colors.black87,
......@@ -95,7 +95,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
"Are you sure you want to logout?",
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: "Plus Jakarta Sans",
fontFamily: "Poppins",
fontSize: 14,
fontWeight: FontWeight.w400,
color: Colors.grey[600],
......@@ -127,7 +127,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
child: Text(
"Cancel",
style: TextStyle(
fontFamily: "Plus Jakarta Sans",
fontFamily: "Poppins",
fontWeight: FontWeight.w600,
fontSize: 14,
color: Colors.grey[700],
......@@ -157,7 +157,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
Text(
"Logout",
style: TextStyle(
fontFamily: "Plus Jakarta Sans",
fontFamily: "Poppins",
fontWeight: FontWeight.w600,
fontSize: 14,
color: Colors.white,
......@@ -208,7 +208,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
Text(
"Logging out...",
style: TextStyle(
fontFamily: "Plus Jakarta Sans",
fontFamily: "Poppins",
fontWeight: FontWeight.w500,
color: Colors.grey[700],
),
......@@ -252,7 +252,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
Text(
"Logged out successfully",
style: TextStyle(
fontFamily: "Plus Jakarta Sans",
fontFamily: "Poppins",
fontWeight: FontWeight.w500,
),
),
......@@ -293,7 +293,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
Text(
"Logout failed. Please try again.",
style: TextStyle(
fontFamily: "Plus Jakarta Sans",
fontFamily: "Poppins",
fontWeight: FontWeight.w500,
),
),
......@@ -504,7 +504,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
"Logout",
style: TextStyle(
fontSize: 16,
fontFamily: "Plus Jakarta Sans",
fontFamily: "Poppins",
fontWeight: FontWeight.w600,
color: Colors.white,
),
......@@ -535,12 +535,12 @@ class _ProfileScreenState extends State<ProfileScreen> {
const SizedBox(height: 6),
Text(title,
style: const TextStyle(
fontSize: 14, fontWeight: FontWeight.w400, fontFamily: "Plus Jakarta Sans", color: Colors.black87)),
fontSize: 14, fontWeight: FontWeight.w400, fontFamily: "Poppins", color: Colors.black87)),
const SizedBox(height: 2),
Text(value,
textAlign: TextAlign.center,
style: const TextStyle(
fontSize: 14, fontWeight: FontWeight.w400, fontFamily: "Plus Jakarta Sans", color: Colors.black54)),
fontSize: 14, fontWeight: FontWeight.w400, fontFamily: "Poppins", color: Colors.black54)),
],
);
}
......@@ -550,11 +550,11 @@ class _ProfileScreenState extends State<ProfileScreen> {
children: [
Text(title,
style: const TextStyle(
fontSize: 14, fontWeight: FontWeight.w400, fontFamily: "Plus Jakarta Sans", color: Colors.black87)),
fontSize: 14, fontWeight: FontWeight.w400, fontFamily: "Poppins", color: Colors.black87)),
const SizedBox(height: 4),
Text(value,
style: const TextStyle(
fontSize: 14, fontWeight: FontWeight.w400, fontFamily: "Plus Jakarta Sans", color: Colors.black54)),
fontSize: 14, fontWeight: FontWeight.w400, fontFamily: "Poppins", color: Colors.black54)),
],
);
}
......
......@@ -170,7 +170,7 @@ class _SplashScreenState extends State<SplashScreen> with SingleTickerProviderSt
// Method 2: Fallback with socket test
if (hasInternet) {
try {
final result = await InternetAddress.lookup('google.com');
final result = await InternetAddress.lookup('8.8.8.8');
print("lookup result:$result");
final socketCheck = result.isNotEmpty && result[0].rawAddress.isNotEmpty;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment