Skip to content

Instantly share code, notes, and snippets.

View esabook's full-sized avatar
🛰️
Seeking planet

esabook

🛰️
Seeking planet
View GitHub Profile
1. Open bash
2. goto root project
3. git config --global alias.change-commits '!'"f() { VAR=\$1; OLD=\$2; NEW=\$3; shift 3; git filter-branch --env-filter \"if [[ \\\"\$\`echo \$VAR\`\\\" = '\$OLD' ]]; then export \$VAR='\$NEW'; fi\" \$@; }; f"
4. git change-commits GIT_AUTHOR_EMAIL "egit.saputra@bareksa.com" "esa_book@outlook.com" HEAD~50..HEAD
@esabook
esabook / NetworkStateMonitoringService.java
Last active June 23, 2022 12:57
Sample of network state listener, connect or disconnect
package ***.services;
import android.app.Activity;
import android.app.Application;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
@esabook
esabook / SplashScreenDialog.kt
Last active May 19, 2022 07:01
splash screen dialog with event
package ***
import android.os.Bundle
import android.os.CountDownTimer
import android.os.Handler
import android.os.Looper
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.DialogFragment
@esabook
esabook / SmsBroadcastReceiver.java
Last active May 19, 2022 07:01
Sample of sms listener
package ***.services;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.telephony.SmsMessage;
public class SmsBroadcastReceiver extends BroadcastReceiver {
@esabook
esabook / AspectFrameLayout.java
Last active May 19, 2022 07:00
[Android] CameraActivity: FrontCam/MainCam, GreenScreen base for MaskingIndicator/Crop
package *;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.FrameLayout;
import timber.log.Timber;
/**
@esabook
esabook / DialogMessageFragment.java
Last active May 19, 2022 06:59
Fullscreen dialog with dialogFragment, support image, header, title, message, custom layout for message, button
package ***;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.annotation.DrawableRes;
import android.support.annotation.LayoutRes;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.content.res.ResourcesCompat;
/*
* Copyright (c) 2022 esabook.
* Author: egit
*/
package com.esabook.app.services
import android.app.Activity
import android.content.BroadcastReceiver
import android.content.Context
@esabook
esabook / frida-android-repinning.js
Created November 25, 2019 14:49
Mirror frida-android-repinning.js
/*
Android SSL Re-pinning frida script v0.2 030417-pier
$ adb push burpca-cert-der.crt /data/local/tmp/cert-der.crt
$ frida -U -f it.app.mobile -l frida-android-repinning.js --no-pause
https://techblog.mediaservice.net/2017/07/universal-android-ssl-pinning-bypass-with-frida/
*/
setTimeout(function(){
@esabook
esabook / Ignore.java
Last active January 24, 2022 18:01
Execute code with silent crash mode;Ignore throwable runtime code;Can be used for Getter or Setter
/**
* Execute code with silent crash mode<br>
* usage:<br>
* <pre>
* Ignore.of(()-> {
* String bankName = o.infoPayment.namaBank.toUpperCase().replace("BANK", "");
* binding.tvBankName.setText(bankName);
* });
* </pre>
@esabook
esabook / ImageViewUtil.kt
Created December 21, 2021 09:37
Imageloader for glide, auto stop/dispose when View.onDetach()
fun ImageView.loadImageWithGlide(
imgObj: Any?,
cacheMode: DiskCacheStrategy = DiskCacheStrategy.AUTOMATIC,
onFail: (() -> Unit?)? = null,
onSuccess: (() -> Unit?)? = null,
) {
try {
Glide.with(this)
.load(imgObj)
.placeholder(this.drawable)