Skip to content

Instantly share code, notes, and snippets.

View MacKentoch's full-sized avatar
👨‍💻

Erwan DATIN MacKentoch

👨‍💻
  • France
View GitHub Profile

🔎Analyse assets (decompile <-> re-compile apk)

Using apktool you can decode resources to nearly original form and rebuild them after making some eventual modifications.

Grab apktool

brew install apktool
#!/bin/bash
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)
class MaClass {
constructor(valeurInitial) {
this.maPropriete = valeurInitial;
}
maMethode() {
return this.maPropriete;
}
}
function ajoute2(nombre) {
return nombre + 2;
}
console.log('quatre: ', ajoute2(2));
console.log('six: ', ajoute2(ajoute2(2)));

In ROOT_PROJECT/ios directory:

rm -rf "${HOME}/Library/Caches/CocoaPods"
rm -rf "`pwd`/Pods/"
pod update
{
// coding style and xp:
"editor.tabSize": 2,
"editor.insertSpaces": true,
"editor.autoClosingBrackets": true,
// search:
"search.exclude": {
"**/node_modules": true,
"**/bower_components": true,
"jspm_package": true,
{
// coding style and xp:
"editor.tabSize": 2,
"editor.insertSpaces": true,
"editor.autoClosingBrackets": true,
// npm scripts
"npm.enableScriptExplorer": true,
// search:
"search.exclude": {
"**/node_modules": true,
@MacKentoch
MacKentoch / Alamofire-JSON-Serialization.md
Created July 11, 2018 16:16 — forked from jpotts18/Alamofire-JSON-Serialization.md
Alamofire JSON Serialization of Objects, Collections, Nesting

Alamofire JSON Serialization of Objects and Collections

Alamofire is a great Swift library developed by the creator of AFNetworking @mattt. The purpose of this gist is to explain how to use the built-in power of Alamofire to serialize your JSON. In this example we will be serializing a simple blog API. First we will start with serializing a single JSON object and add complexity as we go along.

Warning: This was written before Swift 1.2

A Single JSON Serialization

This is the first JSON object that we will be serializing.

import { Dimensions, Platform, StatusBar } from 'react-native';
// NOTE:
// const iPhoneXSMax = { width: 414, height: 896 };
// const iphoneXS = { width: 375, scale: 3, height: 812 };
// const iphoneXR = { width: 414, height: 896 };
export function isIphoneX() {
const dimen = Dimensions.get('window');
return (
@MacKentoch
MacKentoch / android-adb-pull-apk.md
Created February 11, 2019 13:51 — forked from ctrl-freak/android-adb-pull-apk.md
Retrieve APK from Non-Rooted Android Device through ADB

https://stackoverflow.com/a/18003462/348146

None of these suggestions worked for me, because Android was appending a sequence number to the package name to produce the final APK file name (this may vary with the version of Android OS). The following sequence of commands is what worked for me on a non-rooted device:

  1. Determine the package name of the app, e.g. com.example.someapp. Skip this step if you already know the package name.

    adb shell pm list packages

    Look through the list of package names and try to find a match between the app in question and the package name. This is usually easy, but note that the package name can be completely unrelated to the app name. If you can't recognize the app from the list of package names, try finding the app in Google Play using a browser. The URL for an app in Google Play contains the package name.