This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
adb help // List all comands | |
== Adb Server | |
adb kill-server | |
adb start-server | |
== Adb Reboot | |
adb reboot | |
adb reboot recovery | |
adb reboot-bootloader |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private fun convertStreamToString(inputStream: InputStream): String { | |
val reader = BufferedReader(InputStreamReader(inputStream, "utf-8")) | |
val sb = StringBuilder() | |
var line: String? | |
try { | |
while (reader.readLine().also { line = it } != null) { | |
sb.append(line) | |
} | |
} catch (e: Exception) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private fun getPathFromURI(context: Context, uri: Uri): String { | |
var realPath = "" | |
uri.path?.let { path -> | |
val databaseUri: Uri | |
val selection: String? | |
val selectionArgs: Array<String>? | |
if (path.contains("/document/image:")) { // files selected from "Documents" | |
databaseUri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI | |
selection = "_id=?" | |
selectionArgs = arrayOf(DocumentsContract.getDocumentId(uri).split(":")[1]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// { | |
// "message": "inicio con exito", | |
// "data": [ | |
// { | |
// "id_usuario": 44, | |
// "nombre": "Benjamin", | |
// "apellidos": "Cruz Q", | |
// "correo": "[email protected]", | |
// "pasword": "$2a$10$Hgtd/AZQuNeMfG6/5PrjteyiZGUmEX7FYapvxP7ht1obAMQdtr4P6", | |
// "rol_usuario": "Admin", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.os.Build | |
import java.io.BufferedReader | |
import java.io.File | |
import java.io.InputStreamReader | |
class RootUtil { | |
val isDeviceRooted: Boolean | |
get() = checkRootMethod1() || checkRootMethod2() || checkRootMethod3() | |
private fun checkRootMethod1(): Boolean { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:convert'; | |
import 'dart:io'; | |
import 'dart:typed_data'; | |
import 'package:flutter/material.dart'; | |
class ImageUtil { | |
Image imageFromBase64String(String base64String) { | |
return Image.memory( | |
base64Decode(base64String), |