Skip to content

Instantly share code, notes, and snippets.

View samuelbezerrab's full-sized avatar

Samuel Bezerra samuelbezerrab

View GitHub Profile
@samuelbezerrab
samuelbezerrab / run.sh
Created October 4, 2022 14:07
Enable remote screenshare on macOS
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -off -restart -agent -privs -all -allowAccessFor -allUsers
# Later restart the computer
@samuelbezerrab
samuelbezerrab / Apple_mobile_device_types.txt
Created September 21, 2022 15:42 — forked from adamawolf/Apple_mobile_device_types.txt
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S
@samuelbezerrab
samuelbezerrab / aab_to_apk.sh
Created July 1, 2022 17:46
Get APKs from AAB file
# install bundletool, read more at https://developer.android.com/studio/command-line/bundletool
brew install bundletool
# extract apks file from aab. If bundle is signed, specify the keystore attributes as well. If the bundle is not signed, you can add universal model, change the output to .zip, & use universal.apk
bundletool build-apks --bundle=bundle.aab --output=output.apks --ks=key.jks --ks-pass=pass:password --ks-key-alias=password --key-pass=pass:password
# install the apks file to your device
bundletool install-apks —apks=output.apks
# extract the path of your package name
@samuelbezerrab
samuelbezerrab / pull_apk.md
Created August 6, 2021 21:07 — forked from oozzal/pull_apk.md
Pull Apk from 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.

  1. Get the full path name of the APK file for the desired package.
@samuelbezerrab
samuelbezerrab / WatermelonProvider.tsx
Created April 23, 2021 19:42 — forked from sidferreira/WatermelonProvider.js
WatermelonDB preloaded db
import React, { ReactChild } from 'react';
import { Database } from '@nozbe/watermelondb';
import { getWatermelon } from 'app/utils/DBWatermelonOld/DBWatermelonOld';
import DatabaseProvider from '@nozbe/watermelondb/DatabaseProvider';
const WatermelonProvider: React.ComponentType<{
children?: ReactChild;
}> = (props) => {
const watermelonRef = React.useRef<Promise<Database>>();
const [database, setDatabase] = React.useState<Database>();
@samuelbezerrab
samuelbezerrab / recursive-resample.sh
Created April 23, 2021 13:56 — forked from jorgehatccrma/recursive-resample.sh
Recursively resample a bunch of audio files in a directory, using sox
#!/bin/bash
# A simple script to recursively resample a bunch of files
# in a directory. Only certain file extensions (mp3, aac,
# flac, wav) are considered.
#
# It takes 2 command line options: `indir` and `outdir`.
# The destination (`outdir`) is relative to the current
# directory of where you were when the script was run.
#
@samuelbezerrab
samuelbezerrab / gist:679db2cc006bb8819fcdf817a5d467e6
Last active November 15, 2022 15:15
Facebook app Key Hash from Google Play App signing key certificate
# FROM GOOGLE PLAY:
echo YOUR_SHA1_HASH | xxd -r -p | openssl base64
## The YOUR_SHA1_HASH is the hash code of the certificate (signing key) fingerprint of the app.
1. Go to Play Console (https://play.google.com/apps/publish);
2. Click on your app;
3. On the Left Menu, click on "Setup" > "App Integrity"
4. Now, copy the "SHA-1 certificate fingerprint" and use it to replace the value of YOUR_SHA1_HASH
#### Install APK tool
`brew install apktool`
#### Depack the apk
`apktool d app-release.apk -o extracted_apk`
#### Change whatever you want inside the created apk
`code extracted_apk`
#### Repack the apk
@samuelbezerrab
samuelbezerrab / gist:05e2d1f6cc2577f9fc656ef522cd594f
Created August 8, 2020 13:08
Solve glog compile problem on RN
# You can just install glog yourself to solve this program.
cd /glog (node_modules/react-native/third-party/glog-x.x.x) then
./configure
make
make install
//Objective-C
for (NSString *familyName in [UIFont familyNames]){
NSLog(@"Family name: %@", familyName);
for (NSString *fontName in [UIFont fontNamesForFamilyName:familyName]) {
NSLog(@"--Font name: %@", fontName);
}
}
// Swift
for familyName:String in UIFont.familyNames {