11/20/1
This commit is contained in:
@@ -1,69 +1,134 @@
|
||||
import 'dart:convert';
|
||||
import 'package:crypto/crypto.dart';
|
||||
import 'package:ride/constant/links.dart';
|
||||
import 'package:ride/controller/functions/crud.dart';
|
||||
import 'package:ride/main.dart';
|
||||
|
||||
import 'box_name.dart';
|
||||
import 'char_map.dart';
|
||||
|
||||
class AppCredintials {
|
||||
static const String basicAuthCredentials = 'hamzaayedphp:malDEV@2101';
|
||||
static const String serverAPI =
|
||||
'AAAAinYllCo:APA91bF1shTpzSsSxqbfY6c60D8zs1ZsdIsl9ix6nl7GDdjCqWPRK0G0ub5SqFdb1jDpQDvQPxGg-697MWLo0sy3oYImBwBLObyhk0GjtNzyr0PbE3hI-pOvhf8Vp1xgUgBmofbZYXkH';
|
||||
// AIzaSyCyfwRXTwSTLOFQSQgN5p7QZgGJVZnEKq0
|
||||
static const String mapAPIKEY = 'AIzaSyCyfwRXTwSTLOFQSQgN5p7QZgGJVZnEKq0';
|
||||
static const String twilloRecoveryCode = 'TQF13XUVU2NJ3VFU8JWBWYBS';
|
||||
static const String accountSIDTwillo = 'ACb4ad857efe0903bfd6238a763a2ce4d1';
|
||||
static const String authTokenTwillo = '14f39ef4628bb8a4f18469f462f8af75';
|
||||
static const String publishablekey = '14f39ef4628bb8a4f18469f462f8af75';
|
||||
static const String chatGPTkey =
|
||||
'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';
|
||||
static const String chatGPTkeySefer =
|
||||
'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';
|
||||
// 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
|
||||
String getBasicAuthCredentials() {
|
||||
return base64Encode(utf8.encode(basicAuthCredentials));
|
||||
getApiKey() async {
|
||||
var res = await CRUD().get(link: AppLink.getApiKey, payload: {});
|
||||
var decod = jsonDecode(res);
|
||||
print(decod);
|
||||
for (var i = 0; i < decod['message'].length; i++) {
|
||||
print(i);
|
||||
String retrievedString =
|
||||
r(decod['message'][i]['hashed_key'].toString(), charMap);
|
||||
await storage.write(
|
||||
key: decod['message'][i]['name'].toString(),
|
||||
value: retrievedString.toString(),
|
||||
);
|
||||
}
|
||||
box.write(BoxName.apiKeyRun, 'run');
|
||||
}
|
||||
|
||||
static const String transactionCloude =
|
||||
'Authorization:API_EMDJX6BHQ67DBGT6WV:DG2XPU7YEN02M0VJ2F';
|
||||
static const String visionApi = '0vQRyaYYDWpsv73A5CZOknseK7S2sgwE';
|
||||
}
|
||||
String q(String b, String c) {
|
||||
final d = utf8.encode(c);
|
||||
final e = utf8.encode(b);
|
||||
|
||||
class StripeKey {
|
||||
static const String publishableKey =
|
||||
'pk_test_51O4WTODMEVrOCA5SN5e6b8pAvF5CPDC3c3Pif18q74NEQApU5AfmZZEN9X2WIayfIrUTjju1pUavmgoeLgb3FR5k00pn4oMHGO';
|
||||
static const String secretKey =
|
||||
'sk_test_51O4WTODMEVrOCA5SBgaoSS69nNFRyfZx2Tl5ODswYyjqLpc0RxBHW3hhcP38Tp78TZ1PQoZo7eHFllRiQd3rMHPN00Lr9WD3n2';
|
||||
}
|
||||
final f = Hmac(sha256, d);
|
||||
final g = f.convert(e);
|
||||
|
||||
//
|
||||
class MyClass {
|
||||
static const String mapAPIKEY = 'AIzaSyCyfwRXTwSTLOFQSQgN5p7QZgGJVZnEKq0';
|
||||
static const String twilloRecoveryCode = 'TQF13XUVU2NJ3VFU8JWBWYBS';
|
||||
static const String accountSIDTwillo = 'ACb4ad857efe0903bfd6238a763a2ce4d1';
|
||||
static const String authTokenTwillo = '14f39ef4628bb8a4f18469f462f8af75';
|
||||
static const String additionalText = 'additional text';
|
||||
|
||||
String getBasicAuthCredentials() {
|
||||
return base64Encode(utf8.encode(mapAPIKEY));
|
||||
final h = g.bytes;
|
||||
final i = base64Url.encode(h);
|
||||
return i;
|
||||
}
|
||||
|
||||
String removeAddedText(String apiKey, String addedText) {
|
||||
final hashedText = sha256.convert(utf8.encode(addedText)).toString();
|
||||
return apiKey.replaceAll(hashedText, '');
|
||||
String j(String k, String l) {
|
||||
final m = utf8.encode(l);
|
||||
final n = base64Url.decode(k);
|
||||
|
||||
final o = Hmac(sha256, m);
|
||||
final p = o.convert(n);
|
||||
|
||||
final q = utf8.decode(p.bytes);
|
||||
return q;
|
||||
}
|
||||
|
||||
String addTextToAPIKey(String apiKey, String textToAdd) {
|
||||
final hashedText = sha256.convert(utf8.encode(textToAdd)).toString();
|
||||
final midIndex = apiKey.length ~/ 2;
|
||||
final firstHalf = apiKey.substring(0, midIndex);
|
||||
final secondHalf = apiKey.substring(midIndex);
|
||||
return '$firstHalf$hashedText$secondHalf';
|
||||
String a(String b, String c) {
|
||||
int d = b.length;
|
||||
int e = d ~/ 4;
|
||||
|
||||
List<String> f = [];
|
||||
for (int g = 0; g < d; g += e) {
|
||||
int h = g + e;
|
||||
if (h > d) {
|
||||
h = d;
|
||||
}
|
||||
String i = b.substring(g, h);
|
||||
f.add(i);
|
||||
}
|
||||
|
||||
print(f);
|
||||
Map<String, String> j = {};
|
||||
j['birinci'] = f[4];
|
||||
j['ikinci'] = f[2];
|
||||
j['üçüncü'] = c + f[1];
|
||||
j['dördüncü'] = f[0];
|
||||
j['beş'] = f[3];
|
||||
|
||||
String k = '';
|
||||
j.forEach((l, m) {
|
||||
k += m;
|
||||
});
|
||||
|
||||
return k;
|
||||
}
|
||||
|
||||
void exampleUsage() {
|
||||
String modifiedAPIKey = addTextToAPIKey(mapAPIKEY, additionalText);
|
||||
print('Modified API Key: $modifiedAPIKey');
|
||||
Map<String, String> n(String o, String c) {
|
||||
String p = o.replaceAll(c, '');
|
||||
|
||||
String finalAPIKey = removeAddedText(modifiedAPIKey, additionalText);
|
||||
print('Final API Key: $finalAPIKey');
|
||||
Map<String, String> q = {};
|
||||
q['birinci'] = p[p.length - 5] + p[p.length - 3];
|
||||
q['ikinci'] = p[p.length - 1] + p[p.length - 15];
|
||||
q['üçüncü'] = p[p.length - 9] + p[p.length - 12];
|
||||
q['dördüncü'] = p[p.length - 11] + p[p.length - 6];
|
||||
q['beş'] = p[p.length - 2] + p[p.length - 8];
|
||||
|
||||
return q;
|
||||
}
|
||||
|
||||
String c(String a, Map<String, String> b) {
|
||||
StringBuffer c = StringBuffer();
|
||||
c.write(a);
|
||||
|
||||
String d = "Bl";
|
||||
c.write(b[d] ?? d);
|
||||
|
||||
StringBuffer e = StringBuffer();
|
||||
String f = c.toString();
|
||||
|
||||
for (int g = 0; g < f.length; g++) {
|
||||
String h = f[g];
|
||||
e.write(b[h] ?? h);
|
||||
}
|
||||
|
||||
return e.toString();
|
||||
}
|
||||
|
||||
String r(String a, Map<String, String> b) {
|
||||
StringBuffer c = StringBuffer();
|
||||
String d = "Bl";
|
||||
int e = d.length;
|
||||
|
||||
for (int f = 0; f < a.length; f++) {
|
||||
String g = a[f];
|
||||
String h = b.keys.firstWhere(
|
||||
(i) => b[i] == g,
|
||||
orElse: () => g,
|
||||
);
|
||||
|
||||
c.write(h);
|
||||
}
|
||||
|
||||
String j = c.toString();
|
||||
|
||||
if (j.endsWith(d)) {
|
||||
j = j.substring(0, j.length - e);
|
||||
}
|
||||
|
||||
return j;
|
||||
}
|
||||
}
|
||||
// Modified API Key: AIzaSyCyfwRXTwSTLOFc57cb9e210a21def772cad3cd9ef83247e70bed77da89a64c9a5e91e7f3348dbQSQgN5p7QZgGJVZnEKq0
|
||||
// I/flutter ( 5490): Final API Key: AIzaSyCyfwRXTwSTLOFc57cb9e210a21def772cad3cd9ef83247e70bed77da89a64c9a5e91e7f3348dbQSQgN5p7QZgGJVZnEKq0
|
||||
|
||||
Reference in New Issue
Block a user