Skip to content

Instantly share code, notes, and snippets.

@nguyendung17
nguyendung17 / android-backup-apk-and-datas.md
Created December 23, 2022 04:18 — forked from AnatomicJC/android-backup-apk-and-datas.md
Backup android app, data included, no root needed, with adb

Backup android app, data included, no root needed, with adb

adb is the Android CLI tool with which you can interact with your android device, from your PC

You must enable developer mode (tap 7 times on the build version in parameters) and install adb on your PC.

Don't hesitate to read comments, there is useful tips, thanks guys for this !

Fetch application APK

// ---------------------------------------------------------------------------
// Example Support of GOOUUU TECH IOT-GA6-B Gprs Gsm Module
// ---------------------------------------------------------------------------
#include <SoftwareSerial.h>
#define GSM_RX 2 // Arduino pin 2 to URX
#define GSM_TX 3 // Arduino pin 3 to URX
// VCC - 5v
// GND - GND
// Tx - 10
// Rx - 11
#include <SoftwareSerial.h>
SoftwareSerial sim(10, 11);
int _timeout;
String _buffer;
String number = "+84985443701"; //-> change with your number
@nguyendung17
nguyendung17 / PhonecallReceiver.java
Created March 16, 2020 05:53 — forked from ftvs/PhonecallReceiver.java
Detecting an incoming call coming to an Android device. Remember to set the appropriate permissions in AndroidManifest.xml as suggested in the Stackoverflow link. Usage example in comments. Source: http://stackoverflow.com/a/15564021/264619 Explanation: http://gabesechansoftware.com/is-the-phone-ringing/#more-8
package com.gabesechan.android.reusable.receivers;
import java.util.Date;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.telephony.TelephonyManager;
public abstract class PhonecallReceiver extends BroadcastReceiver {
Sometimes it's useful to start with a clean slate and remove all Docker containers and even images. Here are some handy shortcuts.
List all containers (only IDs)
docker ps -aq
Stop all running containers
docker stop $(docker ps -aq)
Remove all containers
docker rm $(docker ps -aq)
Remove all images
docker rmi $(docker images -q)
const fs = require('fs');
const readline = require('readline');
const {google} = require('googleapis');
// If modifying these scopes, delete token.json.
const SCOPES = [
'https://www.googleapis.com/auth/drive.metadata.readonly',
'https://www.googleapis.com/auth/drive.file',
'https://www.googleapis.com/auth/drive.metadata'];
// The file token.json stores the user's access and refresh tokens, and is
git checkout develop && git pull origin develop && git checkout - && git rebase -
@nguyendung17
nguyendung17 / A6_test.ino
Created September 28, 2018 10:11 — forked from Nsk1107/A6_test.ino
This simple code can be use to send a text message and make a voice call using AI Thinker A6 GSM/GPRS Module.
#include <SoftwareSerial.h>
SoftwareSerial A6Module(10, 11); //RX,TX
char input='\0';
void setup() {
A6Module.begin(115200);
Serial.begin(9600);
delay(500);
[code]
//If you're targeting API 22 or higher. You can use the following code to get the list of SIM Cards. You can also allow user to choose the SIM Card:
final ArrayList<Integer> simCardList = new ArrayList<>();
SubscriptionManager subscriptionManager;
subscriptionManager = SubscriptionManager.from(activity);
final List<SubscriptionInfo> subscriptionInfoList = subscriptionManager
.getActiveSubscriptionInfoList();
for (SubscriptionInfo subscriptionInfo : subscriptionInfoList) {
int subscriptionId = subscriptionInfo.getSubscriptionId();
//If you're targeting API 22 or higher. You can use the following code to get the list of SIM Cards. You can also allow user to choose the SIM Card:
final ArrayList<Integer> simCardList = new ArrayList<>();
SubscriptionManager subscriptionManager;
subscriptionManager = SubscriptionManager.from(activity);
final List<SubscriptionInfo> subscriptionInfoList = subscriptionManager
.getActiveSubscriptionInfoList();
for (SubscriptionInfo subscriptionInfo : subscriptionInfoList) {
int subscriptionId = subscriptionInfo.getSubscriptionId();
simCardList.add(subscriptionId);