Skip to content

Instantly share code, notes, and snippets.

View vjgarciag96's full-sized avatar

Víctor Julián García Granado vjgarciag96

View GitHub Profile
class Solution {
public int numIslands(char[][] grid) {
if(grid.length == 0) return 0;
int numIslands = 0;
for (int i = 0; i < grid.length; i++) {
for (int j = 0; j < grid[i].length; j++) {
char currentPoint = grid[i][j];
if(currentPoint == '1') {
/**
* Definition for a binary tree node.
* public class TreeNode {
* int val;
* TreeNode left;
* TreeNode right;
* TreeNode(int x) { val = x; }
* }
*/
class Solution {
@vjgarciag96
vjgarciag96 / get_apk.txt
Created April 14, 2019 16:14
Get apk from an installed app on an Android Device through adb
# list all packages available on device
adb shell pm list packages
# Get the apk path for a given package. e.g. "com.whatsapp"
adb shell pm path com.whatsapp # stdout -> package:/data/app/com.whatsapp-QFa1SvnqTnITvgcxOiQj5A==/base.apk
# Download the apk
adb pull /data/app/com.whatsapp-QFa1SvnqTnITvgcxOiQj5A==/base.apk
@vjgarciag96
vjgarciag96 / reverse_apk.txt
Last active November 2, 2019 13:54
Decompile, modify and rebuild any android apk (no piracy purpose)
# decompile apk
java -jar apktool.jar -f d source_apk.apk -o destination_project --frame-path frameworks
# rebuild decompiled apk
java -jar apktool.jar -f b destination_project -o destination_apk.apk --frame-path frameworks
# sign rebuit apk
java -jar uber-apk-signer.jar --debug -a destination_apk.apk --overwrite --allowResign
# install it
adb install -r destination_apk.apk
apktool -> https://ibotpeaches.github.io/Apktool/install/
@vjgarciag96
vjgarciag96 / publish.gradle
Created April 7, 2019 13:08
Gradle file to generate android library release artifacts
// ./gradlew clean build generateRelease
apply plugin: 'maven'
def groupId = project.PUBLISH_GROUP_ID
def artifactId = project.PUBLISH_ARTIFACT_ID
def version = project.PUBLISH_VERSION
def pomName = project.NAME
def pomDescription = project.DESCRIPTION
def pomWebsite = project.WEBSITE
def localReleaseDest = "${buildDir}/release/${version}"