Skip to content

Instantly share code, notes, and snippets.

@tiiime
tiiime / __init__.py
Created January 26, 2017 13:51
AutoRemote with proxy
# -*- coding: utf-8 -*-
import eg
eg.RegisterPlugin(
name = "AutoRemote",
author = "joaomgcd",
version = "1.991006",
guid = "{C18A174E-71E3-4C74-9A2B-8653CE9991E1}",
private const val 多音字分隔符 = "'"
private const val 单字分隔符 = " "
private const val EMPTY_STRING = ""
private const val INIT_INDEX = 0
fun String.getPronounce(): Set<String> {
fun go(arr: List<String>, index: Int, wholePinyin: String, firstChar: String, set: MutableSet<String>) {
if (index < arr.size) {
arr[index].split(多音字分隔符).forEach {
val head = if (it.isNotEmpty()) it[0].toString() else ""
### 自定义 圣骑士2
# 职业:圣骑士
# 模式:狂野模式
#
# 2x (0) 活动假人
# 2x (1) 力量祝福
# 2x (1) 持盾卫士
# 2x (1) 智慧祝福
# 1x (1) 最后的水晶龙
# 2x (1) 适者生存
@tiiime
tiiime / frida-okhttp3.js
Last active May 6, 2022 06:41
frrida log okhttp request
// frida -U ${package} -l request.js
Java.perform(function () {
var OkHttpClient = Java.use("okhttp3.OkHttpClient");
var RealCall = Java.use("okhttp3.RealCall");
OkHttpClient.newCall.implementation = function (request) {
var result = this.newCall(request)
console.log(request.toString())
return result
@tiiime
tiiime / WeChatUtil.kt
Created May 24, 2018 05:40
微信分享图片压缩
private const val LIMIT_SIZE = 120 * 1024
private fun getBitmapForWeChat(bitmap: Bitmap): Bitmap = bitmap.takeIf {
bitmap.wechatSize() < LIMIT_SIZE
} ?: bitmap.scale(LIMIT_SIZE.toFloat() / bitmap.wechatSize())
private fun Bitmap.scale(scale: Float) = Bitmap.createScaledBitmap(this, (width * scale).toInt(), (height * scale).toInt(), true)
private fun Bitmap.wechatSize() = this.width * this.height
private fun Bitmap.toByteArray() = ByteArrayOutputStream().apply {
this@toByteArray.compress(Bitmap.CompressFormat.PNG, 100, this)
@tiiime
tiiime / Extension.kt
Created May 26, 2018 16:31
一些扩展
/**
* 链式判空
*/
inline fun <reified T> T?.ifNull(block: () -> Unit): T? {
if (this == null) block()
return this
}
@tiiime
tiiime / page.scala
Created July 6, 2018 08:05
http 分页
private def makePageResponse[T <: List[Any]](list: T, start: Int, max: Int, getNextUrl: Map[String, String] => String) = {
var nextUrl: Option[String] = None
var preUrl: Option[String] = None
if (list.nonEmpty && list.size == max) {
nextUrl = Some(getNextUrl(Map(
"start" -> (start + max).toString,
"max" -> max.toString
)))
}
@tiiime
tiiime / launch-frida-for-android.sh
Last active January 7, 2019 03:41
android network security config bypass with frida
curl -O https://build.frida.re/frida/android/arm/bin/frida-server
adb push frida-server /data/local/tmp/
adb shell "chmod 755 /data/local/tmp/frida-server"
adb shell "/data/local/tmp/frida-server &"
@tiiime
tiiime / styles.xml
Created March 29, 2019 08:21
全屏 DialogTheme
<style name="FullScreenDialogTheme" parent="android:Theme.Dialog">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">match_parent</item>
<item name="android:windowBackground">@drawable/black_mask_86</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">false</item>
</style>
@tiiime
tiiime / DynamicModeTabLayout.kt
Created July 5, 2019 17:55
DynamicModeTabLayout
class DynamicModeTabLayout : TabLayout {
constructor(context: Context?) : super(context)
constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs)
constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr)
override fun setupWithViewPager(viewPager: ViewPager?) {
super.setupWithViewPager(viewPager)