Skip to content

Instantly share code, notes, and snippets.

View rahulk11's full-sized avatar
🎯
Focusing

Rahul Kumar rahulk11

🎯
Focusing
View GitHub Profile
@rahulk11
rahulk11 / hmac_sha1.py
Created August 17, 2021 18:18 — forked from heskyji/hmac_sha1.py
Generate HMAC-SHA1 Signature using Python 3
import hashlib
import hmac
import base64
def make_digest(message, key):
key = bytes(key, 'UTF-8')
message = bytes(message, 'UTF-8')
@rahulk11
rahulk11 / WebViewServer.java
Last active November 7, 2019 13:56
A simple "java webview server" for handling intercepted WebView requests on Android and deliver local content. Translated into java from originally kotlin source - https://gist.github.com/ErikHellman/3d131596a8d6a10eb78c418a64281cf5
/*
MIT License
Copyright (c) 2019 Rahul Kumar
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
@rahulk11
rahulk11 / AndroidManifest.xml
Last active May 19, 2018 23:35
Add permissions to android project's manifest on build time
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="in.rahulkr.buildtimepermissions">
<!--Below commented tags are necessary because we are using regex to find and replace permissions-->
<!-- START:PERMISSIONS -->
<uses-permission android:name="android.permission.BATTERY_STATS"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<!-- END:PERMISSIONS -->
<application
android:allowBackup="true"