Skip to content

Instantly share code, notes, and snippets.

View ibrahimsn98's full-sized avatar

İbrahim Süren ibrahimsn98

View GitHub Profile
@undetected1
undetected1 / DoingSomethingGood.java
Created May 10, 2011 10:57
Multi-Threaded Canvas Draws
private ImageView imageView;
// ...
public void onDoingSomethingGood() {
new Thread(new Runnable() {
public void run() {
final Bitmap bitmap = loadImageFromOutside("http://mycloud.com/image.png");
imageView.post(new Runnable() {
public void run() {
imageView.setImageBitmap(bitmap);
@ameerhamza6733
ameerhamza6733 / AdmobConsentSimple
Last active June 8, 2020 15:05
Simple for Consent sdk android admob
/*https://www.youtube.com/watch?v=_JOapnq8hrs&t=852s
video tutorial for consent sdk android
*/
/*https://www.youtube.com/watch?v=_JOapnq8hrs&t=852s
If you want i do your job you can hair me any time at Upwork.com: https://www.upwork.com/o/profiles/users/_~01cdffbf3d8a9ad74b/
@eybisi
eybisi / get_payload.py
Created December 12, 2018 16:18
get decrypted payload from all apk files
#get apks from server? wget -np -e robots=off -m site.com/apk/folder/
#Place all apks in the same dir as py file or change os.listdir parameter
#you can get del.js from my repo https://github.com/eybisi/fridaScripts/blob/master/del.js
import os
from androguard.core.bytecodes import apk
import frida
import time
device = frida.get_usb_device()
files = [f for f in os.listdir("./")]
for f in files:
@yoshiki
yoshiki / pom.xml
Created October 13, 2011 02:29
Maven pom.xml for Android library project
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example.android</groupId>
<artifactId>my-android-library</artifactId>
<version>0.1</version>
<packaging>apklib</packaging>
<name>my-android-library</name>
@Gnzlt
Gnzlt / OffsetPageTransformer.kt
Last active May 27, 2021 15:43
Android ViewPager2 PageTransformer to show multiple pages at the same time
package com.example
import android.view.View
import android.view.ViewGroup
import androidx.annotation.Px
import androidx.core.view.ViewCompat
import androidx.core.view.updateLayoutParams
import androidx.recyclerview.widget.RecyclerView
import androidx.viewpager2.widget.ViewPager2
@laaptu
laaptu / DpToPxAndPxToDp
Last active February 14, 2022 21:06
Android convert dp to px and vice versa
public static float convertPixelsToDp(float px){
DisplayMetrics metrics = Resources.getSystem().getDisplayMetrics();
float dp = px / (metrics.densityDpi / 160f);
return Math.round(dp);
}
public static float convertDpToPixel(float dp){
DisplayMetrics metrics = Resources.getSystem().getDisplayMetrics();
float px = dp * (metrics.densityDpi / 160f);
return Math.round(px);
@evancummings
evancummings / gist:9490189
Last active April 6, 2022 19:17
Watch network traffic from Android App
# Use ADB to find and pull an Android package from device
adb shell pm list packages
adb shell pm path com.package
adb pull /data/app/com.package.app.apk
# With APK local, can now adb push to device and run it
# Use tcpdump to log traffic to mon.txt
sudo tcpdump -A dst port 80 > mon.txt
@srayhunter
srayhunter / android-adb-over-wifi.md
Last active June 22, 2022 16:41
Android ADB over Wifi

Android ADB over Wifi

Here is a simple way to use ADB over wifi with your device. Make sure that ADB can reach your device over the network.

  1. Connect device to usb

  2. Restart the ADB daemon to listening on TCP port

adb tcpip 5555

@brettwold
brettwold / CustomAdapter.java
Last active December 14, 2022 17:52
Android adding a popup context menu to a RecyclerView
public class CustomAdapter extends RecyclerView.Adapter<CustomAdapter.ViewHolder> {
private List<CustomObject> objects;
private OnItemSelectedListener listener;
private final boolean withContextMenu;
class ViewHolder extends RecyclerView.ViewHolder
implements View.OnClickListener, View.OnCreateContextMenuListener, PopupMenu.OnMenuItemClickListener {
@BindView(R.id.custom_name)
@mnoble01
mnoble01 / international phone number mask
Last active March 2, 2023 14:03
i18n libphonenumber mask (with in-hand country code)
/*
This is using the JS port of Google's libphonenumber.
As far as I know, though, all of the APIs are the same or similar
*/
// I just hardcoded "US" as the country, but of course you can use any country iso code
var ctry = 'US';
var exampleNumber = i18n.phonenumbers.PhoneNumberUtil.getInstance()
.getExampleNumberForType(ctry, i18n.phonenumbers.PhoneNumberType.MOBILE); // returns PhoneNumber instance