Skip to content

Instantly share code, notes, and snippets.

@chrislacy
chrislacy / private_fork.md
Created March 15, 2022 08:43 — forked from 0xjac/private_fork.md
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git

@chrislacy
chrislacy / action3_as_system_app_via_titanium_backup.md
Last active January 27, 2017 03:13
Installing Action Launcher 3 as a system app via Titanium Backup

DISCLAIMER: Follow these instructions entirely at your own risk. I, nor my company (Digital Ashes PTY LTD) take any responsibility whatsoever for any damage done to any device/property that occurs as a result of following these instructions.

The following steps describe how to install Action Launcher 3 on a rooted device as a system app, so that you will be able to enable Action Launcher 3's Google Now integration.

Prerequisites

  1. A rooted device (Google if you need help here).
  2. A copy of [Titanium Backup][0] installed on your device.
  3. A copy of [Action Launcher 3][1] installed on your device.
@chrislacy
chrislacy / action3_as_system_app.md
Last active April 24, 2021 16:34
Installing Action Launcher 3 as a system app via ADB

DISCLAIMER: Follow these instructions entirely at your own risk. I, nor my company (Digital Ashes PTY LTD) take any responsibility whatsoever for any damage done to any device/property that occurs as a result of following these instructions.

The following steps describe how to install Action Launcher 3 on a rooted device as a system app, so that you will be able to enable Action Launcher 3's Google Now integration.

Prerequisites

  1. A rooted device (Google if you need help here).
  2. A computer with [ADB][0] installed, and a working knowledge of ADB.
  3. A copy of an Action Launcher 3 APK on your computer. [APKMirror.com][1] is a good place to grab a copy from. All you're doing here is setting Action 3 as a system app, so any version of the app will work. From there, the Action 3 will update via the Play Store like a typical pre-installed app (such as Gmail or YouTube).
@chrislacy
chrislacy / gist:4e373420f1c1b74aa481
Created August 22, 2014 00:16
Disabling Activity (after verifying purchase)
try {
ComponentName componentName = new ComponentName(getPackageName(), YourActivity.class.getName());
PackageManager packageManager = getApplicationContext().getPackageManager();
if (licenseState == LICENSE_VALID) {
if (packageManager.getComponentEnabledSetting(componentName) != PackageManager.COMPONENT_ENABLED_STATE_DISABLED) {
packageManager.setComponentEnabledSetting(componentName, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);
}
} else if (licenseState == LICENSE_INVALID) {
packageManager.setComponentEnabledSetting(componentName, PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP);
}
@chrislacy
chrislacy / gist:6068493
Created July 24, 2013 06:42
So long as you pass in a valid View, and are using Jelly Bean or later, the animation should automatically apply.
@SuppressLint("NewApi")
public boolean startActivity(View v, Intent intent, Object tag) {
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
// Only launch using the new animation if the shortcut has not opted out (this is a
// private contract between launcher and may be ignored in the future).
boolean useLaunchAnimation = (v != null) &&
!intent.hasExtra(INTENT_EXTRA_IGNORE_LAUNCH_ANIMATION) &&
Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN;
@chrislacy
chrislacy / gist:5998644
Created July 15, 2013 09:30
FragmentStatePagerAdapter that allows you to specify a Fragment's tag.
/*
* Copyright (C) 2011 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
@chrislacy
chrislacy / gist:5646240
Last active April 23, 2018 13:57
Icon pack makers wanting to implement 'apply icon pack' functionality for Action Launcher should just include this snippet as appropriate.
Button actionLauncherButton = (Button) findViewById(R.id.action_launcher_button);
actionLauncherButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// Check Action Launcher is installed
Intent intent = getPackageManager().getLaunchIntentForPackage("com.actionlauncher.playstore");
if (intent != null) {
// TODO BY YOU: set this package name as appropriate. Eg "kov.theme.stark"
String yourPackageName = ;
@chrislacy
chrislacy / gist:5402950
Created April 17, 2013 09:18
Gist to use the system search to search for apps
SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
if (searchManager != null) {
List<SearchableInfo> searchables = searchManager.getSearchablesInGlobalSearch();
SearchableInfo info = searchManager.getSearchableInfo(getComponentName());
for (SearchableInfo inf : searchables) {
if (inf.getSuggestAuthority() != null
&& inf.getSuggestAuthority().startsWith("applications")) {
info = inf;
}
}