Skip to content

Instantly share code, notes, and snippets.

/*
* Regular expression implementation.
* Supports only ( | ) * + ?. No escapes.
* Compiles to NFA and then simulates NFA
* using Thompson's algorithm.
*
* See also http://swtch.com/~rsc/regexp/ and
* Thompson, Ken. Regular Expression Search Algorithm,
* Communications of the ACM 11(6) (June 1968), pp. 419-422.
*
2ad1beab45ce98581a887fb55941c3d4ca25c7e8
常用的工具如下:
1. jd-gui: 查看 jar 包,Java 工具
2. dex-tools: dex 与 jar 包之间的转换工具,以及 dex 和 smali 之间的转换工具;smali/baksmali 支持从 smali 到 dex 之间的转换,dex2jar 可把 dex 转换为 jar
3. apktool: 解包 apk 的工具,解包后可以得到 smali 文件
4. ClassyShark : google 出的转换工具,可直接从 apk 转换成 class 文件,但没有搜索,编辑等功能
一般的逆向步骤如下:
1. apktool 生成 smali 文件
2. 如果对 smali 文件熟悉,可以直接修改 smali 文件
3. 使用 apktool 重新打包
test
https://codelabs.developers.google.com/codelabs/android-testing/index.html?index=..%2F..%2Findex#0
http://peirr.com/writing-android-tests-with-espresso-test-recorder/
@emanonwzy
emanonwzy / Makefile
Created March 14, 2016 17:02 — forked from cstratton/Makefile
A Makefile for building adb outside of a full AOSP tools build, motivated by a need to get a security-enabled ADB onto the Raspberry Pi
#ADB tool for the Raspberry Pi and similar environments not supported by the Android SDK.
#based on https://gist.github.com/splhack/958335
#This is a very simple hack for building adb on its own, using a lot of stock Linux libraries (libssl, libcrypt)
#in place of the versions shipped with AOSP, in order to avoid having to pull down a lot of code.
#git clone https://android.googlesource.com/platform/system/core system/core
#The method below does not work with the most recent version (you will see const char* conversion errors
#as a C file has been changed to a CPP one where that is more strict). However, it _can_ be made to work
#!/usr/bin/perl
#
# Wrapper around sqlite3 & strace that prints the number of bytes read
# and number of read() system calls at the end.
#
# Useful for testing hypotheses around sqlite3 index selection.
#
# Author: [email protected]
#
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This script helps removing Git branches.
# Run it from a git repo dir. It will open the Git branches list
# in your favorite editor. Delete some branches from the list.
# Save and close the file. The script applies the changes to the repo.
from subprocess import call, Popen, PIPE
from os import getenv
import android.content.Context;
import android.util.AttributeSet;
import android.widget.ImageView;
/**
* Created by zeyiwu on 1/5/15.
*/
public class SquareImageView extends ImageView {
@emanonwzy
emanonwzy / HeaderGridView
Created January 10, 2015 08:36
Android Grid view support add header view
/*
* Copyright (C) 2013 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