Skip to content

Instantly share code, notes, and snippets.

View ibrahimsn98's full-sized avatar

İbrahim Süren ibrahimsn98

View GitHub Profile
@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
@nhtua
nhtua / 00.install-android-sdk.sh
Last active April 18, 2024 06:19
Run a Headless Android Device on Ubuntu server (no GUI)
#!/bin/bash -i
#using shebang with -i to enable interactive mode (auto load .bashrc)
set -e #stop immediately if any error happens
# Install Open SDK
apt update
apt install openjdk-8-jdk -y
update-java-alternatives --set java-1.8.0-openjdk-amd64
java -version
@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:
@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/
@soulmachine
soulmachine / jwt-expiration.md
Last active April 9, 2024 04:12
How to deal with JWT expiration?

First of all, please note that token expiration and revoking are two different things.

  1. Expiration only happens for web apps, not for native mobile apps, because native apps never expire.
  2. Revoking only happens when (1) uses click the logout button on the website or native Apps;(2) users reset their passwords; (3) users revoke their tokens explicitly in the administration panel.

1. How to hadle JWT expiration

A JWT token that never expires is dangerous if the token is stolen then someone can always access the user's data.

Quoted from JWT RFC:

/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@Pulimet
Pulimet / AdbCommands
Last active April 25, 2024 08:49
Adb useful commands list
adb help // List all comands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
@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)
@tetafro
tetafro / Django token auth backend
Last active April 5, 2023 17:25
Django token auth backend
Naming file
@legendtkl
legendtkl / proxy.go
Created August 18, 2016 11:49
simple golang tcp proxy (forward request)
package main
import (
"fmt"
"net"
"io"
)
func main() {
//http.HandleFunc("/", handler)