This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context; | |
import android.os.Debug; | |
import java.io.File; | |
public class OomExceptionHandler implements Thread.UncaughtExceptionHandler { | |
private static final String FILENAME = "out-of-memory.hprof"; | |
public static void install(Context context) { | |
Thread.UncaughtExceptionHandler defaultHandler = Thread.getDefaultUncaughtExceptionHandler(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 灰色保活 | |
*/ | |
public class KeepAliveService extends Service { | |
private static final int SERVICE_ID = 666; | |
public KeepAliveService() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.zip.ZipEntry | |
import java.util.zip.ZipFile | |
import java.util.List | |
apply plugin: 'com.android.application' | |
task checkJni <<{ | |
def dir = new File(project.buildDir.absolutePath+"/outputs/apk") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AppReceiver extends BroadcastReceiver{ | |
public static final String TAG = "AppReceiver"; | |
@Override | |
public void onReceive(Context context, Intent intent) { | |
String action = intent.getAction(); | |
if (action.equals(Intent.ACTION_PACKAGE_ADDED)) { | |
String packageName = intent.getData().getSchemeSpecificPart(); | |
Log.d(TAG, "ACTION_PACKAGE_ADDED:" + packageName); |