Skip to content

Instantly share code, notes, and snippets.

View ok3141's full-sized avatar

Oleksii ok3141

View GitHub Profile
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.function.BiFunction;
import java.util.function.Function;
@ok3141
ok3141 / bible.txt
Created November 15, 2022 19:28 — forked from chickencoder/bible.txt
Plain text list of all the books of the bible. Line separated and capitalised.
Genesis
Exodus
Leviticus
Numbers
Deuteronomy
Joshua
Judges
Ruth
1 Samuel
2 Samuel
@ok3141
ok3141 / smali-cheatsheet.md
Created August 15, 2022 09:33 — forked from LionZXY/smali-cheatsheet.md
Smali docs на русском. Теперь в Markdown

Русская шпаргалка по Smali

Приветствую, любители реверс-инжинирить Android. Перед вами шпаргалка по Smali - аналогу ассемблера для Android-приложений.

Изначальный текст на русском взят отсюда. Там текст появился из машинного перевода официальной документации.

В итоге, оформил сухой текст + поправил небольшие опечатки и корявости перевода. По поводу замечаний и предложений можете писать либо мне в ЛС, либо оформлять PR на Gist.

Общая информация

Виды(Types)

@ok3141
ok3141 / .gitlab-ci.yml
Created May 6, 2022 09:27 — forked from illuzor/.gitlab-ci.yml
Config for gitlab ci android with unit tests and instrumented tests
image: openjdk:11-jdk
variables:
ANDROID_COMPILE_SDK: "30"
ANDROID_BUILD_TOOLS: "30.0.3"
SDK_TOOLS: "6858069" # from https://developer.android.com/studio/#command-tools
EMULATOR_VERSION: "24"
before_script:
- wget --quiet --output-document=android-sdk.zip https://dl.google.com/android/repository/commandlinetools-linux-${SDK_TOOLS}_latest.zip
@ok3141
ok3141 / downscale.sh
Created November 1, 2021 14:02 — forked from lanceli/downscale.sh
sips downscale image by percentage in Mac OS X
#!/bin/bash
if [ $1 ]
then
echo Processing file $1;
else
for var in `find *.png`;
do
echo Processing file $var;
sips -Z $(($(sips -g pixelWidth "$var" | cut -s -d ':' -f 2 | cut -c 2-) / 2)) "$var" --out "resized_$var" &> /dev/null
@ok3141
ok3141 / MathUtils.java
Created May 21, 2021 11:58
Mathematics Utils
public class MathUtils {
@SuppressWarnings("ManualMinMaxCalculation")
public static int isqrt(int s) {
int x0, x1 = 1;
int d0, d1 = s;
do {
d0 = d1;
x0 = x1;
@ok3141
ok3141 / Utils.java
Created November 9, 2020 22:38
Optimal ThreadPool
public static ThreadPoolExecutor createThreadPool(
int corePoolSize,
int maxPoolSize,
final String threadNamePrefix,
long keepAliveSeconds
) {
ThreadPoolExecutor result = new ThreadPoolExecutor(
corePoolSize, maxPoolSize, keepAliveSeconds, TimeUnit.SECONDS,
new LinkedTransferQueue<Runnable>() {
@Override
@ok3141
ok3141 / JavaPasswordSecurity.java
Created October 17, 2020 20:27 — forked from jtan189/JavaPasswordSecurity.java
Java PBKDF2 Password Hashing Code
import java.security.SecureRandom;
import javax.crypto.spec.PBEKeySpec;
import javax.crypto.SecretKeyFactory;
import java.math.BigInteger;
import java.security.NoSuchAlgorithmException;
import java.security.spec.InvalidKeySpecException;
/*
* PBKDF2 salted password hashing.
* Author: havoc AT defuse.ca
public static String generatePin(int n, int k, Random random) {
StringBuilder sb = new StringBuilder();
while (k-- > 0) {
sb.append("0123456789");
}
char[] result = new char[n];
for (int i = 0; i < n; ++i) {
1. Download latest apktool version.
2. Download the batch file and aapt.exe.
3. Create a folder anywhere in the PC and put all the apktool.jar, aapt.exe and the batch script in that folder.
4. Open command prompt.
5. Navigate to the folder where you placed apktool.jar, batch script and the aapt.exe.
6. Now, you need to install the file using the " IF " command.
7. Type the following command.
apktool if name-of-the-app.apk