2 Commits
1.7 ... master

Author SHA1 Message Date
  Manoj 0d4a354f84 deprication surpass 2 years ago
  Manoj b0cb873cd4 changed depricated 2 years ago
5 changed files with 118 additions and 115 deletions
Unified View
  1. +1
    -0
      app/src/main/java/com/nivesh/production/bajajfd/ui/fragment/StepTwoBajajFDFragment.kt
  2. +1
    -0
      app/src/main/java/com/nivesh/production/bajajfd/ui/providerfactory/FDModelProviderFactory.kt
  3. +1
    -0
      app/src/main/java/com/nivesh/production/bajajfd/util/Common.kt
  4. +7
    -7
      app/src/main/java/com/nivesh/production/bajajfd/util/EncryptionDecryption.kt
  5. +108
    -108
      app/src/main/java/com/nivesh/production/bajajfd/util/Utility.kt

+ 1
- 0
app/src/main/java/com/nivesh/production/bajajfd/ui/fragment/StepTwoBajajFDFragment.kt View File

@ -987,6 +987,7 @@ class StepTwoBajajFDFragment : Fragment() {
} }
} }
@Suppress("Deprecation")
private fun setUpRecyclerView( private fun setUpRecyclerView(
bankList: List<ClientBanklist>?, bankList: List<ClientBanklist>?,
selectedAccount: String? = null selectedAccount: String? = null


+ 1
- 0
app/src/main/java/com/nivesh/production/bajajfd/ui/providerfactory/FDModelProviderFactory.kt View File

@ -5,6 +5,7 @@ import androidx.lifecycle.ViewModelProvider
import com.nivesh.production.bajajfd.repositories.MainRepository import com.nivesh.production.bajajfd.repositories.MainRepository
import com.nivesh.production.bajajfd.viewModel.BajajFDViewModel import com.nivesh.production.bajajfd.viewModel.BajajFDViewModel
@Suppress("UNCHECKED_CAST")
class FDModelProviderFactory(private val mainRepository: MainRepository) : class FDModelProviderFactory(private val mainRepository: MainRepository) :
ViewModelProvider.Factory { ViewModelProvider.Factory {


+ 1
- 0
app/src/main/java/com/nivesh/production/bajajfd/util/Common.kt View File

@ -47,6 +47,7 @@ class Common {
val connectivityManager = getApplication<NewsApplication>().getSystemService(.... val connectivityManager = getApplication<NewsApplication>().getSystemService(....
**/ **/
//internet check //internet check
@Suppress("Deprecation")
fun isNetworkAvailable(activity: Activity): Boolean { fun isNetworkAvailable(activity: Activity): Boolean {
val connectivityManager = activity.getSystemService( val connectivityManager = activity.getSystemService(
Context.CONNECTIVITY_SERVICE Context.CONNECTIVITY_SERVICE


+ 7
- 7
app/src/main/java/com/nivesh/production/bajajfd/util/EncryptionDecryption.kt View File

@ -49,13 +49,13 @@ class EncryptionDecryption {
ivParameterSpec = IvParameterSpec(rawSecretKey) ivParameterSpec = IvParameterSpec(rawSecretKey)
} }
fun encryptAsBase64(dataToEncrypt: String): String? {
var dataToEncrypt = dataToEncrypt
val dateFormat = SimpleDateFormat("SSS", Locale.US)
dataToEncrypt = dataToEncrypt + dateFormat.format(Date())
val encryptedData = encrypt(dataToEncrypt.toByteArray())
return Base64.encodeToString(encryptedData, Base64.DEFAULT)
}
// fun encryptAsBase64(dataToEncrypt: String): String? {
// var dataToEncrypt = dataToEncrypt
// val dateFormat = SimpleDateFormat("SSS", Locale.US)
// dataToEncrypt = dataToEncrypt + dateFormat.format(Date())
// val encryptedData = encrypt(dataToEncrypt.toByteArray())
// return Base64.encodeToString(encryptedData, Base64.DEFAULT)
// }
// public String decrypt(String textToDecrypt) throws Exception { // public String decrypt(String textToDecrypt) throws Exception {
// //


+ 108
- 108
app/src/main/java/com/nivesh/production/bajajfd/util/Utility.kt View File

@ -57,113 +57,113 @@ class Utility {
} }
} }
@SuppressLint("HardwareIds")
fun getDeviceInfo(mContext: Context): DeviceInfo {
val deviceInfo = DeviceInfo()
var device_id: String? = ""
try {
val telephonyManager =
mContext.getSystemService(Context.TELEPHONY_SERVICE) n class="k">as TelephonyManager
deviceInfo.app_version = (
SharedPrefrenceDataMethods.getVersionCode(
Constants.KEY_VERSION_CODE,
mContext
)
)
deviceInfo.device_model = (if (TextUtils.isEmpty(Build.DEVICE)) "" else Build.DEVICE)
deviceInfo.device_os_version = (if (TextUtils.isEmpty(Build.VERSION.RELEASE)) "" else Build.VERSION.RELEASE)
deviceInfo.device_name = (if (TextUtils.isEmpty(Build.PRODUCT)) "" else Build.PRODUCT)
deviceInfo.device_token = (
if (TextUtils.isEmpty(
SharedPrefrenceDataMethods.getGcmAppId(
Constants.KEY_GCM_APP_ID,
mContext
)
)
) "" else SharedPrefrenceDataMethods.getGcmAppId(
Constants.KEY_GCM_APP_ID,
mContext
)
)
deviceInfo.device_type = ("Android")
// Hemant Code Added start 28-10-2020
if (ActivityCompat.checkSelfPermission(
mContext,
Manifest.permission.READ_PHONE_STATE
) != PackageManager.PERMISSION_GRANTED
) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
device_id = telephonyManager.imei
if (device_id == null) {
device_id =
if (TextUtils.isEmpty(Build.getSerial())) "" else Build.getSerial()
}
} else {
device_id = telephonyManager.deviceId
if (device_id == null) {
device_id =
if (TextUtils.isEmpty(Build.SERIAL)) "" else Build.SERIAL
}
}
} else {
device_id = telephonyManager.deviceId
if (device_id == null) {
device_id = if (TextUtils.isEmpty(Build.SERIAL)) "" else Build.SERIAL
}
}
if (device_id == null || device_id.isEmpty() || device_id.equals(
"unknown",
ignoreCase = true
)
) {
device_id = if (TextUtils.isEmpty(
Settings.Secure.getString(
mContext.contentResolver,
Settings.Secure.ANDROID_ID
)
)
) "" else Settings.Secure.getString(
mContext.contentResolver,
Settings.Secure.ANDROID_ID
)
}
Log.e("device_id", "-> $device_id")
// Hemant changes 07-11-2019 start commented and Added 12-12-2019
// deviceInfo.device_id = (device_id + "#" + com.nivesh.production.util.Utility.getFlavor())
// Hemant changes 07-11-2019 end commented and Added 12-12-2019
// Hemant changes 07-11-2019 start added and commented 12-12-2019
deviceInfo.device_id_for_UMSId = (device_id)
// deviceInfo.setDeviceId(device_id);
// Hemant changes 07-11-2019 end added and commented 12-12-2019
} catch (e: java.lang.Exception) {
e.printStackTrace()
// Hemant changes 07-11-2019 start Added 28-10-2020
if (device_id == null || device_id.isEmpty() || device_id.equals(
"unknown",
ignoreCase = true
)
) {
device_id = if (TextUtils.isEmpty(
Settings.Secure.getString(
mContext.contentResolver,
Settings.Secure.ANDROID_ID
)
)
) "" else Settings.Secure.getString(
mContext.contentResolver,
Settings.Secure.ANDROID_ID
)
}
Log.e("device_id", "-> $device_id")
// deviceInfo.setDeviceId(device_id + "#" + com.nivesh.production.util.Utility.getFlavor())
deviceInfo.device_id_for_UMSId = (device_id)
// Hemant changes 07-11-2019 end Added 28-10-2020
}
return deviceInfo
}
// @SuppressLint("HardwareIds")
// fun getDeviceInfo(mContext: Context): DeviceInfo {
// val deviceInfo = DeviceInfo()
// var device_id: String? = ""
// try {
// val telephonyManager =
// mContext.getSystemService(Context.TELEPHONY_SERVICE) as TelephonyManager
// deviceInfo.app_version = (
// SharedPrefrenceDataMethods.getVersionCode(
// Constants.KEY_VERSION_CODE,
// mContext
// )
// )
//
// deviceInfo.device_model = (if (TextUtils.isEmpty(Build.DEVICE)) "" else Build.DEVICE)
// deviceInfo.device_os_version = (if (TextUtils.isEmpty(Build.VERSION.RELEASE)) "" else Build.VERSION.RELEASE)
// deviceInfo.device_name = (if (TextUtils.isEmpty(Build.PRODUCT)) "" else Build.PRODUCT)
// deviceInfo.device_token = (
// if (TextUtils.isEmpty(
// SharedPrefrenceDataMethods.getGcmAppId(
// Constants.KEY_GCM_APP_ID,
// mContext
// )
// )
// ) "" else SharedPrefrenceDataMethods.getGcmAppId(
// Constants.KEY_GCM_APP_ID,
// mContext
// )
// )
// deviceInfo.device_type = ("Android")
//
// // Hemant Code Added start 28-10-2020
// if (ActivityCompat.checkSelfPermission(
// mContext,
// Manifest.permission.READ_PHONE_STATE
// ) != PackageManager.PERMISSION_GRANTED
// ) {
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
// device_id = telephonyManager.imei
// if (device_id == null) {
// device_id =
// if (TextUtils.isEmpty(Build.getSerial())) "" else Build.getSerial()
// }
// } else {
// device_id = telephonyManager.deviceId
// if (device_id == null) {
// device_id =
// if (TextUtils.isEmpty(Build.SERIAL)) "" else Build.SERIAL
// }
// }
// } else {
// device_id = telephonyManager.deviceId
// if (device_id == null) {
// device_id = if (TextUtils.isEmpty(Build.SERIAL)) "" else Build.SERIAL
// }
// }
// if (device_id == null || device_id.isEmpty() || device_id.equals(
// "unknown",
// ignoreCase = true
// )
// ) {
// device_id = if (TextUtils.isEmpty(
// Settings.Secure.getString(
// mContext.contentResolver,
// Settings.Secure.ANDROID_ID
// )
// )
// ) "" else Settings.Secure.getString(
// mContext.contentResolver,
// Settings.Secure.ANDROID_ID
// )
// }
// Log.e("device_id", "-> $device_id")
// // Hemant changes 07-11-2019 start commented and Added 12-12-2019
//// deviceInfo.device_id = (device_id + "#" + com.nivesh.production.util.Utility.getFlavor())
// // Hemant changes 07-11-2019 end commented and Added 12-12-2019
//
//
// // Hemant changes 07-11-2019 start added and commented 12-12-2019
// deviceInfo.device_id_for_UMSId = (device_id)
// // deviceInfo.setDeviceId(device_id);
// // Hemant changes 07-11-2019 end added and commented 12-12-2019
// } catch (e: java.lang.Exception) {
// e.printStackTrace()
// // Hemant changes 07-11-2019 start Added 28-10-2020
// if (device_id == null || device_id.isEmpty() || device_id.equals(
// "unknown",
// ignoreCase = true
// )
// ) {
// device_id = if (TextUtils.isEmpty(
// Settings.Secure.getString(
// mContext.contentResolver,
// Settings.Secure.ANDROID_ID
// )
// )
// ) "" else Settings.Secure.getString(
// mContext.contentResolver,
// Settings.Secure.ANDROID_ID
// )
// }
// Log.e("device_id", "-> $device_id")
//// deviceInfo.setDeviceId(device_id + "#" + com.nivesh.production.util.Utility.getFlavor())
// deviceInfo.device_id_for_UMSId = (device_id)
// // Hemant changes 07-11-2019 end Added 28-10-2020
// }
// return deviceInfo
// }
} }
} }

Loading…
Cancel
Save

Powered by TurnKey Linux.