Skip to content

Commit

Permalink
2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
75py committed Jan 4, 2015
1 parent ead38e7 commit bac188e
Show file tree
Hide file tree
Showing 206 changed files with 5,377 additions and 37,577 deletions.
32 changes: 24 additions & 8 deletions .gitignore
@@ -1,22 +1,38 @@
# built application files
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
uiautomator/output/

# Built application files
*.apk
*.ap_

# files for the dex VM
# Files for the Dalvik VM
*.dex

# Java class files
*.class

# generated files
# Generated files
bin/
gen/

# Gradle files
.gradle/
build/

# Local configuration file (sdk path, etc)
local.properties

# Eclipse project files
.classpath
.project
/build.xml
/proguard
# Proguard folder generated by Eclipse
proguard/

# Log Files
*.log

.idea/
out/
/app/manifest-merger-release-report.txt
*.iml
Empty file.
4 changes: 0 additions & 4 deletions .settings/org.eclipse.jdt.core.prefs

This file was deleted.

35 changes: 0 additions & 35 deletions AndroidManifest.xml

This file was deleted.

81 changes: 6 additions & 75 deletions README.md
@@ -1,49 +1,17 @@
# 無効化アプリ一覧
# Disable Manager

##どんなアプリ?
<p>プリインストールアプリの無効化を補助するアプリです。</p>
Disable Manager assists the disabling of pre-installed apps.
You can show lists of apps that is disabled, disablable and undisablable.
Please do at your own risk.

##機能
- 無効化されたアプリの一覧を表示する<br>一通り無効化したら、このリストを共有すると良い
- 無効化が可能で、まだ無効化されていないアプリの一覧を表示する<br>無効化作業をサポート
- 無効化が不可能なシステムアプリの一覧を表示する<br>残念ながら無効化できない子たち
- ユーザーがインストールした一般アプリの一覧を表示する<br>おまけ機能
- 表示中のアプリ一覧をメーラーなどに共有する
- 一覧画面でアプリをタップすると設定画面に飛ぶ<br>「無効にする」を押しに行けます。
- 各アプリにコメントをつける<br>「無効化による弊害」などを書いておき、共有すると良いかも。要カスタムフォーマット
- 実行中のプロセスのみ表示機能<br>無効化を検討する際の基準に使えます。
- 変更日で表示・ソートする
- 除外リストのインポート・エクスポート
- 無効化済みリストを無効化推奨リストとしてエクスポート、そのファイルを別端末でインポートし無効化済み・無効化可能に分類して表示

##諸注意

<p>このアプリは非rootユーザー向けです。アプリの無効化はAndroid(ICS以上)のOS標準機能です。</p>

<p>アプリの無効化は自己責任で行ってください。無効化可能アプリの中にも、無効化すべきでないアプリは存在します。</p>

<p>無効化が可能かどうかの判定は、Androidのソースをもとにそれっぽい処理をしているだけなので、端末によっては正常に動作しないかもしれません。<br>
(SH-02Eにおいて、一部のドコモのアプリが無効化できないにも関わらず一覧に表示されるのを確認しています。)<br>
無効化できない子たちはリストに並ばれると邪魔なので、手動にて「長押し→除外リストに追加」で除外してください。</p>

##要求パーミッション
- 外部ストレージの読み書き<br>インポート・エクスポート機能で使用します。

##動作環境
4.0.3、4.1.2、4.2のエミュレーターで動作確認済み。OS4.0.3以上で動作可能です。

##ダウンロード

https://play.google.com/store/apps/details?id=com.nagopy.android.disablemanager
DOESN'T REQUIRE ROOT
This app's features is based on basic feature of Android OS (ICS or greater).

##License

EXCEPT icon resources, this source and related resources are available under Apache License 2.0.
Unauthorized copying and replication of the icon files are strictly prohibited. All Rights Reserved.

アイコンファイルを除いて、このソースコードや関連リソースはApache License 2.0とします。
アイコンファイルの無断転載を禁止します。

<pre>
Copyright (C) 2013 75py

Expand All @@ -59,40 +27,3 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
</pre>

無効化できるアプリを判定する際に、Androidのソースコードの一部を利用しています。
該当するクラスとライセンスは以下の通りです。

###android.app.admin.DevicePolicyManager
<pre>
Copyright (C) 2010 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
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
</pre>

###com.android.settings.applications.InstalledAppDetails
<pre>
Copyright (C) 2007 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
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations
under the License.
</pre>
1 change: 1 addition & 0 deletions app/.gitignore
@@ -0,0 +1 @@
/build
48 changes: 48 additions & 0 deletions app/build.gradle
@@ -0,0 +1,48 @@
import java.text.SimpleDateFormat

apply plugin: 'com.android.application'

// バージョン名
// versionCodeに使用するため、「{0-99}.{0-99}.{0-99}」で指定すること。
def verName = "2.0.0"

android {
compileSdkVersion 21
buildToolsVersion "21.1.2"

defaultConfig {
applicationId "com.nagopy.android.disablemanager2"
minSdkVersion 15
targetSdkVersion 21
versionName verName
versionCode Integer.parseInt(verName.split("\\.")[0]) * 10000 + Integer.parseInt(verName.split("\\.")[1]) * 100 + Integer.parseInt(verName.split("\\.")[2])
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}

packagingOptions {
exclude 'LICENSE.txt'
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.android.support:support-annotations:21.0.3'
compile 'com.viewpagerindicator:library:2.4.1@aar'

androidTestCompile 'com.android.support:support-annotations:21.0.3'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.0'
androidTestCompile 'com.android.support.test:testing-support-lib:0.1'
androidTestCompile 'org.mockito:mockito-core:1.9.5'
androidTestCompile "com.google.dexmaker:dexmaker-mockito:1.2"
}
11 changes: 11 additions & 0 deletions app/proguard-rules.pro
@@ -0,0 +1,11 @@
-assumenosideeffects public class android.util.Log {
public static *** v(...);
public static *** d(...);
public static *** i(...);
public static *** w(...);
public static *** e(...);
public static *** wtf(...);
}
-assumenosideeffects class com.nagopy.android.disablemanager2.support.DebugUtil {
<methods>;
}
@@ -0,0 +1,120 @@
package com.nagopy.android.disablemanager2;


import org.junit.Test;
import org.mockito.Mockito;

import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertTrue;

public class FilterTypeTest {

@Test
public void test_indexOf() throws Exception {
assertEquals(FilterType.DISABLABLE, FilterType.indexOf(0));
assertEquals(FilterType.DISABLED, FilterType.indexOf(1));
assertEquals(FilterType.UNDISABLABLE, FilterType.indexOf(2));
assertEquals(FilterType.USER, FilterType.indexOf(3));
}

@Test
public void test_filter() throws Exception {
{
// 無効になっているユーザーアプリ(rootedならありうる)
AppData appData = Mockito.mock(AppData.class);
appData.isEnabled = false;
appData.isSystem = false;
appData.canDisable = false;

assertFalse(FilterType.DISABLABLE.isTarget(appData));
assertFalse(FilterType.DISABLED.isTarget(appData));
assertFalse(FilterType.UNDISABLABLE.isTarget(appData));
assertTrue(FilterType.USER.isTarget(appData));
}
{
// ユーザーアプリ
AppData appData = Mockito.mock(AppData.class);
appData.isEnabled = true;
appData.isSystem = false;
appData.canDisable = false;

assertFalse(FilterType.DISABLABLE.isTarget(appData));
assertFalse(FilterType.DISABLED.isTarget(appData));
assertFalse(FilterType.UNDISABLABLE.isTarget(appData));
assertTrue(FilterType.USER.isTarget(appData));
}
{
// 無効にできないはずだけど無効になっているシステムアプリ(rootedなど?)
AppData appData = Mockito.mock(AppData.class);
appData.isEnabled = false;
appData.isSystem = true;
appData.canDisable = false;

assertFalse(FilterType.DISABLABLE.isTarget(appData));
assertTrue(FilterType.DISABLED.isTarget(appData));
assertFalse(FilterType.UNDISABLABLE.isTarget(appData));
assertFalse(FilterType.USER.isTarget(appData));
}
{
// 無効にできるけどシステムアプリではない(通常ありえない)
AppData appData = Mockito.mock(AppData.class);
appData.isEnabled = false;
appData.isSystem = false;
appData.canDisable = true;

assertFalse(FilterType.DISABLABLE.isTarget(appData));
assertFalse(FilterType.DISABLED.isTarget(appData));
assertFalse(FilterType.UNDISABLABLE.isTarget(appData));
assertTrue(FilterType.USER.isTarget(appData));
}
{
//無効化できないシステムアプリ
AppData appData = Mockito.mock(AppData.class);
appData.isEnabled = true;
appData.isSystem = true;
appData.canDisable = false;

assertFalse(FilterType.DISABLABLE.isTarget(appData));
assertFalse(FilterType.DISABLED.isTarget(appData));
assertTrue(FilterType.UNDISABLABLE.isTarget(appData));
assertFalse(FilterType.USER.isTarget(appData));
}
{
// 無効化できる非システムアプリ(通常ありえない)
AppData appData = Mockito.mock(AppData.class);
appData.isEnabled = true;
appData.isSystem = false;
appData.canDisable = true;

assertFalse(FilterType.DISABLABLE.isTarget(appData));
assertFalse(FilterType.DISABLED.isTarget(appData));
assertFalse(FilterType.UNDISABLABLE.isTarget(appData));
assertTrue(FilterType.USER.isTarget(appData));
}
{
// 無効化されたアプリ
AppData appData = Mockito.mock(AppData.class);
appData.isEnabled = false;
appData.isSystem = true;
appData.canDisable = true;

assertFalse(FilterType.DISABLABLE.isTarget(appData));
assertTrue(FilterType.DISABLED.isTarget(appData));
assertFalse(FilterType.UNDISABLABLE.isTarget(appData));
assertFalse(FilterType.USER.isTarget(appData));
}
{
// 無効化可能アプリ
AppData appData = Mockito.mock(AppData.class);
appData.isEnabled = true;
appData.isSystem = true;
appData.canDisable = true;

assertTrue(FilterType.DISABLABLE.isTarget(appData));
assertFalse(FilterType.DISABLED.isTarget(appData));
assertFalse(FilterType.UNDISABLABLE.isTarget(appData));
assertFalse(FilterType.USER.isTarget(appData));
}
}
}

0 comments on commit bac188e

Please sign in to comment.