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.app.Application; | |
import android.arch.lifecycle.LiveData; | |
import android.content.Context; | |
import android.database.ContentObserver; | |
import android.database.Cursor; | |
import android.net.Uri; | |
import android.os.AsyncTask; | |
import android.os.Handler; | |
import android.support.annotation.NonNull; | |
import android.support.annotation.Nullable; |
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
Uri uri = Uri.parse("http://WTF") | |
Intent intent = new Intent(Intent.ACTION_VIEW, uri); | |
List<ResolveInfo> resolveInfos = getActivity().getPackageManager().queryIntentActivities(intent, 0); | |
if (!resolveInfos.isEmpty()) { | |
ArrayList<Intent> intents = new ArrayList<Intent>(resolveInfos.size() - 1); | |
for (ResolveInfo resolveInfo : resolveInfos) { | |
String packageName = resolveInfo.activityInfo.packageName; | |
if (TextUtils.equals(packageName, BuildConfig.PACKAGE_NAME)) { | |
continue; | |
} |
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 GameActivity extends BaseGameActivity { | |
... | |
private static void updateLeaderboards(final GoogleApiClient googleApiClient, final String leaderboardId) { | |
Games.Leaderboards.loadCurrentPlayerLeaderboardScore( | |
googleApiClient, | |
leaderboardId, | |
LeaderboardVariant.TIME_SPAN_ALL_TIME, | |
LeaderboardVariant.COLLECTION_PUBLIC |
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
Hello, | |
If you previously used the In-app billing sample code to build your in-app billing system, please use the recently-updated sample code as it addresses an exploitable flaw we recently discovered (note that this only affects the helper sample code; the core system and in-app billing service itself was not affected). | |
The affected applications are those that use the in-app billing sample library (specifically, the IabHelper and the Security classes in the util directory of the in-app billing V3 sample) and do not perform server-side verification. | |
An update to the sample and library that fixes this vulnerability is now available at code.google.com/p/marketbilling and also through the Android SDK Manager. | |
To apply the security update: |
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 static void screenshot(View view, String path) throws Exception { | |
Bitmap bitmap = Bitmap.createBitmap(view.getWidth(), view.getHeight(), Bitmap.Config.ARGB_8888); | |
Canvas canvas = new Canvas(bitmap); | |
view.draw(canvas); | |
File file = new File(path); | |
file.mkdirs(); | |
file = new File(path, "screenshot_" + System.currentTimeMillis() + ".png"); | |
FileOutputStream fileOutputStream = new FileOutputStream(file); |
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
#!/bin/bash | |
adb=`which adb` | |
$adb shell am start -a android.settings.SETTINGS --es :android:show_fragment com.android.settings.NotificationStation |
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
#!/bin/bash | |
adb=`which adb` | |
#$adb shell am start -a android.settings.APP_OPS_SETTINGS | |
$adb shell am start -a android.settings.SETTINGS -e ":android:show_fragment" "com.android.settings.applications.AppOpsSummary" |
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
#!/bin/bash | |
adb shell "run-as $1 cat databases/$2 > /sdcard/$2" | |
sleep 1 | |
adb shell "ls -l /sdcard/$2" | |
sleep 1 | |
adb pull /sdcard/$2 . |
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
[color] | |
ui = auto | |
[alias] | |
graph1 = log --graph --all --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(bold white)— %an%C(reset)%C(bold yellow)%d%C(reset)' --abbrev-commit --date=relative | |
graph2 = log --graph --all --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(bold white)— %an%C(reset)' --abbrev-commit | |
graph = !"git graph2" |