├── .gitignore ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── com │ └── malangstudio │ └── avoidsmartmanager │ ├── AvoidSmartManagerActivity.java │ └── AvoidSmartManagerReceiver.java ├── build.gradle ├── gradle.properties └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .idea/ 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AvoidSmartManager 2 | 3 | Add it to your build.gradle with: 4 | ```gradle 5 | repositories { 6 | maven { url "https://jitpack.io" } 7 | } 8 | ``` 9 | and: 10 | 11 | ```gradle 12 | dependencies { 13 | compile 'com.github.malangstudio:AvoidSmartManager:0.9.2' 14 | } 15 | ``` 16 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion 23 5 | buildToolsVersion "23.0.1" 6 | 7 | defaultConfig { 8 | minSdkVersion 10 9 | targetSdkVersion 23 10 | versionCode 1 11 | versionName "1.0" 12 | } 13 | buildTypes { 14 | release { 15 | minifyEnabled false 16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 17 | } 18 | } 19 | } 20 | 21 | dependencies { 22 | compile fileTree(dir: 'libs', include: ['*.jar']) 23 | compile 'com.android.support:appcompat-v7:23.1.1' 24 | compile 'com.android.support:design:23.1.1' 25 | } 26 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in C:\Android\sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /app/src/main/java/com/malangstudio/avoidsmartmanager/AvoidSmartManagerActivity.java: -------------------------------------------------------------------------------- 1 | package com.malangstudio.avoidsmartmanager; 2 | 3 | import android.app.Activity; 4 | import android.os.Bundle; 5 | 6 | /** 7 | * Created by god on 15. 12. 29.. 8 | */ 9 | public class AvoidSmartManagerActivity extends Activity { 10 | @Override 11 | protected void onCreate(Bundle savedInstanceState) { 12 | super.onCreate(savedInstanceState); 13 | 14 | finish(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /app/src/main/java/com/malangstudio/avoidsmartmanager/AvoidSmartManagerReceiver.java: -------------------------------------------------------------------------------- 1 | package com.malangstudio.avoidsmartmanager; 2 | 3 | import android.content.BroadcastReceiver; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.content.pm.PackageManager; 7 | import android.os.Handler; 8 | 9 | import java.util.Random; 10 | 11 | /** 12 | * Created by Chiung Choi on 2015-12-20. 13 | */ 14 | public class AvoidSmartManagerReceiver extends BroadcastReceiver { 15 | private final static String SMART_MANAGER_PACKAGE_NAME = "com.samsung.android.sm"; 16 | 17 | @Override 18 | public void onReceive(final Context context, Intent intent) { 19 | if(Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction()) 20 | || Intent.ACTION_POWER_CONNECTED.equals(intent.getAction()) 21 | || Intent.ACTION_POWER_DISCONNECTED.equals(intent.getAction())) { 22 | boolean isSmartManagerExist = false; 23 | 24 | try { 25 | context.getPackageManager().getPackageInfo(SMART_MANAGER_PACKAGE_NAME, PackageManager.GET_META_DATA); 26 | isSmartManagerExist = true; 27 | } catch (PackageManager.NameNotFoundException e) { 28 | } 29 | 30 | if(isSmartManagerExist) { 31 | new Handler().postDelayed(new Runnable() { 32 | @Override 33 | public void run() { 34 | Intent serviceIntent = new Intent(context, AvoidSmartManagerActivity.class); 35 | serviceIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 36 | context.startActivity(serviceIntent); 37 | } 38 | }, new Random().nextInt(3000)); 39 | } 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:1.5.0' 9 | 10 | // NOTE: Do not place your application dependencies here; they belong 11 | // in the individual module build.gradle files 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | jcenter() 18 | } 19 | } 20 | 21 | task clean(type: Delete) { 22 | delete rootProject.buildDir 23 | } 24 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | --------------------------------------------------------------------------------