├── UtilSetInstrumentationTest ├── .gitignore ├── lint.xml ├── ic_launcher-web.png ├── libs │ ├── android-support-v4.jar │ └── robotium-solo-4.3.jar ├── lib │ └── utilset-0.0.1-SNAPSHOT.jar ├── repo │ └── utilset-0.0.1-SNAPSHOT.jar ├── res │ ├── drawable-hdpi │ │ └── ic_launcher.png │ ├── drawable-mdpi │ │ └── ic_launcher.png │ ├── drawable-xhdpi │ │ └── ic_launcher.png │ ├── drawable-xxhdpi │ │ └── ic_launcher.png │ ├── values-sw600dp │ │ └── dimens.xml │ ├── values │ │ ├── dimens.xml │ │ ├── strings.xml │ │ ├── styles.xml │ │ └── description.xml │ ├── menu │ │ └── main.xml │ ├── values-sw720dp-land │ │ └── dimens.xml │ ├── values-v11 │ │ └── styles.xml │ └── values-v14 │ │ └── styles.xml ├── .checkstyle ├── project.properties ├── AndroidManifest.xml ├── proguard-project.txt ├── .project ├── src │ └── com │ │ └── navercorp │ │ └── utilsettest │ │ ├── test │ │ ├── KeyboardUtilsTestCase.java │ │ ├── NetworkListenerTestCase.java │ │ ├── CipherUtilsTestCase.java │ │ ├── VolumeUpDownTestCase.java │ │ ├── ScreenUtilsTestCase.java │ │ └── StringUtilsTestCase.java │ │ └── introduction │ │ └── Introduction.java ├── .classpath └── pom.xml ├── UtilSetSampleApp ├── .gitignore ├── lint.xml ├── ic_launcher-web.png ├── libs │ ├── android-support-v4.jar │ └── robotium-solo-4.3.jar ├── lib │ └── utilset-0.0.1-SNAPSHOT.jar ├── repo │ └── utilset-0.0.1-SNAPSHOT.jar ├── res │ ├── drawable-hdpi │ │ ├── close_button.png │ │ ├── ic_launcher.png │ │ ├── progress_bg_holo_dark.9.png │ │ ├── progress_primary_holo_dark.9.png │ │ ├── progress_secondary_holo_dark.9.png │ │ ├── rounded_background.xml │ │ └── progress_horizontal_holo_dark.xml │ ├── drawable-mdpi │ │ └── ic_launcher.png │ ├── drawable-xhdpi │ │ └── ic_launcher.png │ ├── drawable-xxhdpi │ │ └── ic_launcher.png │ ├── values-sw600dp │ │ └── dimens.xml │ ├── values │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ ├── menu │ │ └── main.xml │ ├── layout │ │ ├── activity_activityutils.xml │ │ ├── activity_diskutils.xml │ │ ├── activity_networkutils.xml │ │ ├── activity_systemutils.xml │ │ ├── activity_deviceutils.xml │ │ ├── fragment_reset_screen_on.xml │ │ ├── fragment_keep_screen_on.xml │ │ ├── activity_keyboardutils.xml │ │ ├── activity_network_listener.xml │ │ ├── acitivty_volumeutils.xml │ │ ├── dialog_introduction.xml │ │ ├── activity_cipher.xml │ │ ├── activity_stringutils.xml │ │ └── activity_main.xml │ ├── values-sw720dp-land │ │ └── dimens.xml │ ├── values-v11 │ │ └── styles.xml │ └── values-v14 │ │ └── styles.xml ├── src │ └── com │ │ └── navercorp │ │ └── utilsettest │ │ ├── ui │ │ ├── ActivityUtilsConstants.java │ │ ├── ActivityUtilsClearScreenOnFragment.java │ │ ├── ActivityUtilsPagerAdapter.java │ │ ├── ActivityUtilsTestActivity.java │ │ └── ActivityUtilsKeepScreenOnFragment.java │ │ ├── dialog │ │ ├── IntroductionDialogFactory.java │ │ ├── IntroductionDialogController.java │ │ └── IntroductionDialogFragment.java │ │ ├── ButtonColor.java │ │ ├── ButtonColorList.java │ │ ├── string │ │ └── StringUtilsTestActivity.java │ │ ├── system │ │ └── SystemUtilsTestActivity.java │ │ ├── audio │ │ └── VolumeUtilsTestActivity.java │ │ ├── input │ │ └── KeyboardUtilsTestActivity.java │ │ ├── device │ │ └── DeviceUtilsTestActivity.java │ │ ├── storage │ │ └── DiskUtilsTestAcitivity.java │ │ ├── cipher │ │ └── CipherTestActivity.java │ │ ├── network │ │ ├── NetworkMonitorTestActivity.java │ │ └── NetworkListenerTestActivity.java │ │ └── MainActivity.java ├── .checkstyle ├── project.properties ├── proguard-project.txt ├── .project ├── .classpath ├── pom.xml └── AndroidManifest.xml ├── .gitignore ├── UtilSet ├── .gitignore ├── src │ └── com │ │ └── navercorp │ │ └── utilset │ │ ├── cipher │ │ ├── CipherMode.java │ │ ├── CipherObject.java │ │ ├── CipherObjectFactory.java │ │ ├── CipherUtils.java │ │ └── AesCipher.java │ │ ├── device │ │ ├── DeviceType.java │ │ ├── PhoneNumberUtils.java │ │ ├── LauncherInfo.java │ │ ├── LauncherTypeDetector.java │ │ ├── LauncherType.java │ │ ├── DeviceTypeDetector.java │ │ └── DeviceUtils.java │ │ ├── string │ │ ├── CompressUtils.java │ │ └── StringCompressor.java │ │ ├── ui │ │ ├── ScreenUtils.java │ │ ├── PixelUtils.java │ │ └── ActivityUtils.java │ │ ├── system │ │ ├── SystemUtils.java │ │ ├── ProcessorUtils.java │ │ └── RootChecker.java │ │ ├── input │ │ ├── SoftwareKeyDetector.java │ │ └── KeyboardUtils.java │ │ ├── storage │ │ └── DiskUtils.java │ │ └── audio │ │ └── VolumeUtils.java ├── .checkstyle ├── project.properties ├── test │ └── com │ │ └── navercorp │ │ └── utilset │ │ ├── cipher │ │ ├── CipherObjectFactoryTest.java │ │ └── CipherUtilsTest.java │ │ ├── system │ │ └── SystemUtilsTest.java │ │ ├── ui │ │ ├── PixelUtilsTest.java │ │ ├── ScreenUtilsTest.java │ │ └── ActivityUtilsTest.java │ │ ├── storage │ │ └── DiskUtilsTest.java │ │ ├── string │ │ └── CompressUtilsTest.java │ │ └── audio │ │ └── VolumeUtilsTest.java ├── pom.xml └── LICENSE ├── repo └── utilset-0.0.1-SNAPSHOT.jar ├── .settings └── org.eclipse.m2e.core.prefs ├── .project ├── README.md └── LICENSE /UtilSetInstrumentationTest/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /UtilSetSampleApp/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | /target 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | bin 2 | gen 3 | target 4 | .settings 5 | .claspath 6 | .project 7 | -------------------------------------------------------------------------------- /UtilSetSampleApp/lint.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /UtilSet/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | /.classpath 3 | /.project 4 | /target 5 | /target 6 | /target 7 | -------------------------------------------------------------------------------- /UtilSetInstrumentationTest/lint.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /repo/utilset-0.0.1-SNAPSHOT.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/android-utilset/master/repo/utilset-0.0.1-SNAPSHOT.jar -------------------------------------------------------------------------------- /UtilSetSampleApp/ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/android-utilset/master/UtilSetSampleApp/ic_launcher-web.png -------------------------------------------------------------------------------- /.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /UtilSetSampleApp/libs/android-support-v4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/android-utilset/master/UtilSetSampleApp/libs/android-support-v4.jar -------------------------------------------------------------------------------- /UtilSetSampleApp/libs/robotium-solo-4.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/android-utilset/master/UtilSetSampleApp/libs/robotium-solo-4.3.jar -------------------------------------------------------------------------------- /UtilSetInstrumentationTest/ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/android-utilset/master/UtilSetInstrumentationTest/ic_launcher-web.png -------------------------------------------------------------------------------- /UtilSetSampleApp/lib/utilset-0.0.1-SNAPSHOT.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/android-utilset/master/UtilSetSampleApp/lib/utilset-0.0.1-SNAPSHOT.jar -------------------------------------------------------------------------------- /UtilSetSampleApp/repo/utilset-0.0.1-SNAPSHOT.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/android-utilset/master/UtilSetSampleApp/repo/utilset-0.0.1-SNAPSHOT.jar -------------------------------------------------------------------------------- /UtilSetSampleApp/res/drawable-hdpi/close_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/android-utilset/master/UtilSetSampleApp/res/drawable-hdpi/close_button.png -------------------------------------------------------------------------------- /UtilSetSampleApp/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/android-utilset/master/UtilSetSampleApp/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /UtilSetSampleApp/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/android-utilset/master/UtilSetSampleApp/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /UtilSetSampleApp/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/android-utilset/master/UtilSetSampleApp/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /UtilSetSampleApp/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/android-utilset/master/UtilSetSampleApp/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /UtilSetInstrumentationTest/libs/android-support-v4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/android-utilset/master/UtilSetInstrumentationTest/libs/android-support-v4.jar -------------------------------------------------------------------------------- /UtilSetInstrumentationTest/libs/robotium-solo-4.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/android-utilset/master/UtilSetInstrumentationTest/libs/robotium-solo-4.3.jar -------------------------------------------------------------------------------- /UtilSetInstrumentationTest/lib/utilset-0.0.1-SNAPSHOT.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/android-utilset/master/UtilSetInstrumentationTest/lib/utilset-0.0.1-SNAPSHOT.jar -------------------------------------------------------------------------------- /UtilSetInstrumentationTest/repo/utilset-0.0.1-SNAPSHOT.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/android-utilset/master/UtilSetInstrumentationTest/repo/utilset-0.0.1-SNAPSHOT.jar -------------------------------------------------------------------------------- /UtilSetInstrumentationTest/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/android-utilset/master/UtilSetInstrumentationTest/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /UtilSetInstrumentationTest/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/android-utilset/master/UtilSetInstrumentationTest/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /UtilSetInstrumentationTest/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/android-utilset/master/UtilSetInstrumentationTest/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /UtilSetInstrumentationTest/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/android-utilset/master/UtilSetInstrumentationTest/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /UtilSetSampleApp/res/drawable-hdpi/progress_bg_holo_dark.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/android-utilset/master/UtilSetSampleApp/res/drawable-hdpi/progress_bg_holo_dark.9.png -------------------------------------------------------------------------------- /UtilSetSampleApp/res/drawable-hdpi/progress_primary_holo_dark.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/android-utilset/master/UtilSetSampleApp/res/drawable-hdpi/progress_primary_holo_dark.9.png -------------------------------------------------------------------------------- /UtilSetSampleApp/res/drawable-hdpi/progress_secondary_holo_dark.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naver/android-utilset/master/UtilSetSampleApp/res/drawable-hdpi/progress_secondary_holo_dark.9.png -------------------------------------------------------------------------------- /UtilSetSampleApp/res/drawable-hdpi/rounded_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /UtilSetSampleApp/src/com/navercorp/utilsettest/ui/ActivityUtilsConstants.java: -------------------------------------------------------------------------------- 1 | package com.navercorp.utilsettest.ui; 2 | 3 | public class ActivityUtilsConstants { 4 | public static final int KEEP_SCREEN_ON = 0; 5 | public final int CLEAR_SCREEN_ON= 1; 6 | } 7 | -------------------------------------------------------------------------------- /UtilSetSampleApp/res/values-sw600dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /UtilSetSampleApp/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16dp 5 | 16dp 6 | 7 | 8 | -------------------------------------------------------------------------------- /UtilSetInstrumentationTest/res/values-sw600dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /UtilSetInstrumentationTest/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16dp 5 | 16dp 6 | 7 | 8 | -------------------------------------------------------------------------------- /UtilSetSampleApp/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | AndroidUtilSetTest 5 | Settings 6 | Hello world! 7 | 8 | -------------------------------------------------------------------------------- /UtilSetInstrumentationTest/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | AndroidUtilSetTest 5 | Settings 6 | Hello world! 7 | 8 | 9 | -------------------------------------------------------------------------------- /UtilSet/src/com/navercorp/utilset/cipher/CipherMode.java: -------------------------------------------------------------------------------- 1 | package com.navercorp.utilset.cipher; 2 | 3 | /** 4 | * Cipher mode to be used for encryption
5 | * Currently, default cipher algorithm, AES, is solely provided 6 | * 7 | * @author jaemin.woo 8 | */ 9 | public enum CipherMode { 10 | AES, 11 | } -------------------------------------------------------------------------------- /UtilSet/.checkstyle: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /UtilSet/src/com/navercorp/utilset/cipher/CipherObject.java: -------------------------------------------------------------------------------- 1 | package com.navercorp.utilset.cipher; 2 | 3 | 4 | /** 5 | * @author jaemin.woo 6 | */ 7 | interface CipherObject { 8 | 9 | public String encrypt(String seed, String plainText); 10 | 11 | 12 | public String decrypt(String seed, String cipherText); 13 | } 14 | -------------------------------------------------------------------------------- /UtilSetSampleApp/res/menu/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /UtilSetInstrumentationTest/res/menu/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /UtilSetSampleApp/.checkstyle: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /UtilSetInstrumentationTest/.checkstyle: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /UtilSetSampleApp/res/layout/activity_activityutils.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | -------------------------------------------------------------------------------- /UtilSet/src/com/navercorp/utilset/device/DeviceType.java: -------------------------------------------------------------------------------- 1 | package com.navercorp.utilset.device; 2 | 3 | /** 4 | * There are two types of android device, tablet and handset
5 | * In the near future, new type of devices such as glasses, watch and wearable stuff can be come up
6 | * 7 | */ 8 | public enum DeviceType { 9 | Tablet, Handset 10 | } -------------------------------------------------------------------------------- /UtilSetSampleApp/res/values-sw720dp-land/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 128dp 8 | 9 | 10 | -------------------------------------------------------------------------------- /UtilSetInstrumentationTest/res/values-sw720dp-land/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 128dp 8 | 9 | 10 | -------------------------------------------------------------------------------- /UtilSetSampleApp/res/values-v11/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /UtilSet/src/com/navercorp/utilset/cipher/CipherObjectFactory.java: -------------------------------------------------------------------------------- 1 | package com.navercorp.utilset.cipher; 2 | 3 | /** 4 | * @author jaemin.woo 5 | */ 6 | class CipherObjectFactory { 7 | private CipherObjectFactory() {} 8 | 9 | public static CipherObject getInstance(CipherMode mode) { 10 | if (CipherMode.AES == mode) { 11 | return new AesCipher(); 12 | } 13 | return new AesCipher(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /UtilSetInstrumentationTest/res/values-v11/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | utilset-parent 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.m2e.core.maven2Builder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.m2e.core.maven2Nature 16 | 17 | 18 | -------------------------------------------------------------------------------- /UtilSetSampleApp/src/com/navercorp/utilsettest/dialog/IntroductionDialogFactory.java: -------------------------------------------------------------------------------- 1 | package com.navercorp.utilsettest.dialog; 2 | 3 | import android.support.v4.app.FragmentActivity; 4 | 5 | public class IntroductionDialogFactory { 6 | public static IntroductionDialogController getInstance(FragmentActivity fa, String description, int time) { 7 | return new IntroductionDialogController(fa.getSupportFragmentManager(), description, time); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /UtilSetSampleApp/res/layout/activity_diskutils.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 11 | 12 | -------------------------------------------------------------------------------- /UtilSetSampleApp/res/values-v14/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /UtilSetSampleApp/res/layout/activity_networkutils.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 11 | 12 | -------------------------------------------------------------------------------- /UtilSetInstrumentationTest/res/values-v14/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /UtilSet/project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system edit 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | # 10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): 11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt 12 | 13 | # Project target. 14 | target=android-17 15 | -------------------------------------------------------------------------------- /UtilSetSampleApp/project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system edit 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | # 10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): 11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt 12 | 13 | # Project target. 14 | target=android-17 15 | -------------------------------------------------------------------------------- /UtilSetInstrumentationTest/project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system edit 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | # 10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): 11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt 12 | 13 | # Project target. 14 | target=android-17 15 | -------------------------------------------------------------------------------- /UtilSet/test/com/navercorp/utilset/cipher/CipherObjectFactoryTest.java: -------------------------------------------------------------------------------- 1 | package com.navercorp.utilset.cipher; 2 | 3 | import static org.junit.Assert.*; 4 | 5 | import org.junit.Before; 6 | import org.junit.Test; 7 | import org.junit.runner.RunWith; 8 | import org.robolectric.RobolectricTestRunner; 9 | import org.robolectric.annotation.Config; 10 | 11 | @RunWith(RobolectricTestRunner.class) 12 | @Config(manifest=Config.NONE) 13 | public class CipherObjectFactoryTest { 14 | 15 | @Before 16 | public void setUp() { 17 | } 18 | 19 | @Test 20 | public void testCipherObjectFactory() { 21 | CipherObject co = CipherObjectFactory.getInstance(CipherMode.AES); 22 | assertNotNull(co); 23 | assertTrue(co instanceof AesCipher); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /UtilSetSampleApp/src/com/navercorp/utilsettest/ui/ActivityUtilsClearScreenOnFragment.java: -------------------------------------------------------------------------------- 1 | package com.navercorp.utilsettest.ui; 2 | 3 | import android.os.Bundle; 4 | import android.support.v4.app.Fragment; 5 | import android.view.LayoutInflater; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | 9 | import com.navercorp.utilsettest.R; 10 | 11 | 12 | public class ActivityUtilsClearScreenOnFragment extends Fragment { 13 | 14 | @Override 15 | public View onCreateView(LayoutInflater inflater, ViewGroup container, 16 | Bundle savedInstanceState) { 17 | // TODO Auto-generated method stub 18 | View rootView = inflater.inflate(R.layout.fragment_keep_screen_on, container, false); 19 | 20 | return rootView; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /UtilSet/src/com/navercorp/utilset/device/PhoneNumberUtils.java: -------------------------------------------------------------------------------- 1 | package com.navercorp.utilset.device; 2 | 3 | import android.content.Context; 4 | import android.telephony.TelephonyManager; 5 | 6 | /** 7 | * 8 | * @author jaemin.woo 9 | * 10 | */ 11 | class PhoneNumberUtils { 12 | public String getMobilePhoneNumber(Context context) { 13 | TelephonyManager telManager = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE); 14 | return telManager.getLine1Number(); 15 | } 16 | 17 | public boolean isAbleToReceiveSms(Context context) { 18 | String phoneNumber = getMobilePhoneNumber(context); 19 | 20 | if (phoneNumber == null) 21 | return false; 22 | 23 | if (phoneNumber.length() != 0) 24 | return true; 25 | 26 | return false; 27 | } 28 | } -------------------------------------------------------------------------------- /UtilSet/src/com/navercorp/utilset/string/CompressUtils.java: -------------------------------------------------------------------------------- 1 | package com.navercorp.utilset.string; 2 | 3 | 4 | /** 5 | * StringUtils provides string related function
6 | * By using compressString and deompressString, string long and has repeated part can be shrunk 7 | * 8 | * @author jaemin.woo 9 | */ 10 | public class CompressUtils { 11 | private static StringCompressor stringCompressor; 12 | 13 | static { 14 | stringCompressor = new StringCompressor(); 15 | } 16 | 17 | public static String compressString(String stringToBeCompressed) { 18 | return stringCompressor.compress(stringToBeCompressed); 19 | } 20 | 21 | public static String decompressString(String stringToBeDecompressed) { 22 | return stringCompressor.decompress(stringToBeDecompressed); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /UtilSetInstrumentationTest/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 9 | 10 | 11 | 14 | 15 | 16 | 17 | 21 | 22 | -------------------------------------------------------------------------------- /UtilSetInstrumentationTest/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 14 | 15 | 16 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /UtilSetSampleApp/src/com/navercorp/utilsettest/dialog/IntroductionDialogController.java: -------------------------------------------------------------------------------- 1 | package com.navercorp.utilsettest.dialog; 2 | 3 | import android.support.v4.app.FragmentManager; 4 | 5 | public class IntroductionDialogController { 6 | private static final String TAG = "IntroductionDialogFragment"; 7 | private IntroductionDialogFragment idf; 8 | private FragmentManager fm; 9 | 10 | public IntroductionDialogController(FragmentManager fm, String description, int time) { 11 | this.idf = new IntroductionDialogFragment("What is this test for", description, time); 12 | this.fm = fm; 13 | } 14 | 15 | public void show() { 16 | idf.show(fm, TAG); 17 | } 18 | 19 | public boolean isShowing() { 20 | return idf.isShowing(); 21 | } 22 | 23 | public void dismiss() { 24 | idf.dismiss(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /UtilSetSampleApp/res/layout/activity_systemutils.xml: -------------------------------------------------------------------------------- 1 | 11 | 12 | 17 | 18 | -------------------------------------------------------------------------------- /UtilSetSampleApp/res/layout/activity_deviceutils.xml: -------------------------------------------------------------------------------- 1 | 11 | 12 | 17 | 18 | -------------------------------------------------------------------------------- /UtilSet/src/com/navercorp/utilset/device/LauncherInfo.java: -------------------------------------------------------------------------------- 1 | package com.navercorp.utilset.device; 2 | 3 | import android.content.Context; 4 | import android.content.Intent; 5 | import android.content.pm.PackageManager; 6 | import android.content.pm.ResolveInfo; 7 | 8 | class LauncherInfo { 9 | public static String getName(Context context) { 10 | PackageManager pm = context.getPackageManager(); 11 | final Intent mainIntent = new Intent(Intent.ACTION_MAIN, null); 12 | mainIntent.addCategory(Intent.CATEGORY_HOME); 13 | ResolveInfo resolveInfo = pm.resolveActivity(mainIntent, PackageManager.MATCH_DEFAULT_ONLY); 14 | if (resolveInfo.activityInfo.applicationInfo.className == null) { 15 | return "ANDROID"; 16 | } 17 | return resolveInfo.activityInfo.applicationInfo.packageName + resolveInfo.activityInfo.applicationInfo.className; 18 | } 19 | } -------------------------------------------------------------------------------- /UtilSet/test/com/navercorp/utilset/system/SystemUtilsTest.java: -------------------------------------------------------------------------------- 1 | package com.navercorp.utilset.system; 2 | 3 | import static org.hamcrest.MatcherAssert.*; 4 | import static org.hamcrest.Matchers.*; 5 | 6 | import org.junit.Before; 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | import org.robolectric.RobolectricTestRunner; 10 | import org.robolectric.annotation.Config; 11 | import org.robolectric.shadows.ShadowLog; 12 | 13 | /** 14 | * 15 | * @author jaemin.woo 16 | * 17 | */ 18 | @RunWith(RobolectricTestRunner.class) 19 | @Config(manifest = Config.NONE) 20 | public class SystemUtilsTest { 21 | @Before 22 | public void setUp() { 23 | ShadowLog.stream = System.out; 24 | } 25 | 26 | @Test 27 | public void shouldReturnAtLeastOneAsProcessorNumbers() { 28 | assertThat(SystemUtils.getProcessorNumbers(), is(greaterThanOrEqualTo(1))); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /UtilSetSampleApp/proguard-project.txt: -------------------------------------------------------------------------------- 1 | # To enable ProGuard in your project, edit project.properties 2 | # to define the proguard.config property as described in that file. 3 | # 4 | # Add project specific ProGuard rules here. 5 | # By default, the flags in this file are appended to flags specified 6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt 7 | # You can edit the include path and order by changing the ProGuard 8 | # include property in project.properties. 9 | # 10 | # For more details, see 11 | # http://developer.android.com/guide/developing/tools/proguard.html 12 | 13 | # Add any project specific keep options here: 14 | 15 | # If your project uses WebView with JS, uncomment the following 16 | # and specify the fully qualified class name to the JavaScript interface 17 | # class: 18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 19 | # public *; 20 | #} 21 | -------------------------------------------------------------------------------- /UtilSetInstrumentationTest/proguard-project.txt: -------------------------------------------------------------------------------- 1 | # To enable ProGuard in your project, edit project.properties 2 | # to define the proguard.config property as described in that file. 3 | # 4 | # Add project specific ProGuard rules here. 5 | # By default, the flags in this file are appended to flags specified 6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt 7 | # You can edit the include path and order by changing the ProGuard 8 | # include property in project.properties. 9 | # 10 | # For more details, see 11 | # http://developer.android.com/guide/developing/tools/proguard.html 12 | 13 | # Add any project specific keep options here: 14 | 15 | # If your project uses WebView with JS, uncomment the following 16 | # and specify the fully qualified class name to the JavaScript interface 17 | # class: 18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 19 | # public *; 20 | #} 21 | -------------------------------------------------------------------------------- /UtilSetSampleApp/src/com/navercorp/utilsettest/ButtonColor.java: -------------------------------------------------------------------------------- 1 | package com.navercorp.utilsettest; 2 | 3 | public class ButtonColor { 4 | private String name; 5 | private int c, e; 6 | private int textColor; 7 | 8 | ButtonColor(String name, int c, int e, int textColor) { 9 | this.name = name; 10 | this.c = c; 11 | this.e = e; 12 | this.textColor = textColor; 13 | } 14 | 15 | public String getName() { 16 | return name; 17 | } 18 | 19 | public void setName(String name) { 20 | this.name = name; 21 | } 22 | 23 | public int getC() { 24 | return c; 25 | } 26 | public void setC(int c) { 27 | this.c = c; 28 | } 29 | public int getE() { 30 | return e; 31 | } 32 | public void setE(int e) { 33 | this.e = e; 34 | } 35 | public int getTextColor() { 36 | return textColor; 37 | } 38 | 39 | public void setTextColor(int textColor) { 40 | this.textColor = textColor; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /UtilSetInstrumentationTest/res/values/description.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | This test simulates Media Volume Control. 5 | 6 | 7 | 8 | This test simulates simple AES based encryption and decryption. 9 | 10 | 11 | 12 | This test simulates simple AES based encryption and decryption. 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /UtilSetSampleApp/res/layout/fragment_reset_screen_on.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 20 | 21 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /UtilSetSampleApp/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | AndroidUtilSetSampleApp 4 | 5 | 6 | 7 | 8 | 9 | com.android.ide.eclipse.adt.ResourceManagerBuilder 10 | 11 | 12 | 13 | 14 | com.android.ide.eclipse.adt.PreCompilerBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | com.android.ide.eclipse.adt.ApkBuilder 25 | 26 | 27 | 28 | 29 | org.eclipse.m2e.core.maven2Builder 30 | 31 | 32 | 33 | 34 | 35 | org.eclipse.m2e.core.maven2Nature 36 | com.android.ide.eclipse.adt.AndroidNature 37 | org.eclipse.jdt.core.javanature 38 | 39 | 40 | -------------------------------------------------------------------------------- /UtilSetSampleApp/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 14 | 15 | 16 | 19 | 20 | 26 | -------------------------------------------------------------------------------- /UtilSetInstrumentationTest/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | AndroidUtilSetInstrumentationTest 4 | 5 | 6 | 7 | 8 | 9 | com.android.ide.eclipse.adt.ResourceManagerBuilder 10 | 11 | 12 | 13 | 14 | com.android.ide.eclipse.adt.PreCompilerBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | com.android.ide.eclipse.adt.ApkBuilder 25 | 26 | 27 | 28 | 29 | org.eclipse.m2e.core.maven2Builder 30 | 31 | 32 | 33 | 34 | 35 | org.eclipse.m2e.core.maven2Nature 36 | com.android.ide.eclipse.adt.AndroidNature 37 | org.eclipse.jdt.core.javanature 38 | 39 | 40 | -------------------------------------------------------------------------------- /UtilSet/test/com/navercorp/utilset/ui/PixelUtilsTest.java: -------------------------------------------------------------------------------- 1 | package com.navercorp.utilset.ui; 2 | 3 | import static org.hamcrest.CoreMatchers.*; 4 | import static org.junit.Assert.*; 5 | 6 | import org.junit.Before; 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | import org.robolectric.Robolectric; 10 | import org.robolectric.RobolectricTestRunner; 11 | import org.robolectric.annotation.Config; 12 | import org.robolectric.shadows.ShadowLog; 13 | 14 | import android.content.Context; 15 | 16 | /** 17 | * 18 | * @author sanghyuk.jung 19 | */ 20 | @RunWith(RobolectricTestRunner.class) 21 | @Config(manifest = Config.NONE) 22 | public class PixelUtilsTest { 23 | private Context context; 24 | 25 | @Before 26 | public void setUp() { 27 | ShadowLog.stream = System.out; 28 | this.context = Robolectric.application; 29 | } 30 | 31 | @Test 32 | public void shouldGetDpFromPixel(){ 33 | Robolectric.setDisplayMetricsDensity(1.5f); 34 | int dp = PixelUtils.getDpFromPixel(context, 50); 35 | assertThat(dp, is(33)); 36 | } 37 | 38 | @Test 39 | public void shouldPixelDpFromDp(){ 40 | Robolectric.setDisplayMetricsDensity(1.5f); 41 | int pixel = PixelUtils.getPixelFromDp(context, 33); 42 | assertThat(pixel, is(50)); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /UtilSet/src/com/navercorp/utilset/cipher/CipherUtils.java: -------------------------------------------------------------------------------- 1 | package com.navercorp.utilset.cipher; 2 | 3 | 4 | /** 5 | * Provides basic encryption and decryption methods
6 | * Default cipher algorithm is AES and currently algorithms other than AES are not provided 7 | * 8 | * @author jaemin.woo 9 | */ 10 | public class CipherUtils { 11 | CipherMode cipherMode; 12 | CipherObject cipherObject; 13 | 14 | public CipherUtils() { 15 | this(CipherMode.AES); 16 | } 17 | 18 | public CipherUtils(CipherMode cipherMode) { 19 | this.cipherMode = cipherMode; 20 | cipherObject = CipherObjectFactory.getInstance(this.cipherMode); 21 | } 22 | 23 | /** 24 | * 25 | * @param seed Seed string which is used for encryption and decryption 26 | * @param plainText String to be encrypted 27 | * @return encrypted text 28 | */ 29 | public String encrypt(String seed, String plainText) { 30 | return cipherObject.encrypt(seed, plainText); 31 | } 32 | 33 | /** 34 | * 35 | * @param seed Seed string which is used for encryption and decryption 36 | * @param cipherText String encrypted by encrypt method 37 | * @return plain text 38 | */ 39 | public String decrypt(String seed, String cipherText) { 40 | return cipherObject.decrypt(seed, cipherText); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /UtilSet/src/com/navercorp/utilset/device/LauncherTypeDetector.java: -------------------------------------------------------------------------------- 1 | package com.navercorp.utilset.device; 2 | import java.util.ArrayList; 3 | import java.util.List; 4 | 5 | import android.content.Context; 6 | import android.os.Build; 7 | 8 | /** 9 | * @author jaemin.woo 10 | */ 11 | class LauncherTypeDetector { 12 | private static List EXCEPT_DEVICES = new ArrayList(); 13 | 14 | static { 15 | // Galaxy S 16 | EXCEPT_DEVICES.add("SHW-M180S"); 17 | } 18 | 19 | private static boolean containExceptDevices() { 20 | String device = android.os.Build.DEVICE; 21 | return EXCEPT_DEVICES.contains(device); 22 | } 23 | 24 | public static LauncherType getType(Context context) { 25 | String packageName = LauncherInfo.getName(context); 26 | 27 | if (packageName.length() == 0) { 28 | return LauncherType.ANDROID; 29 | } 30 | 31 | if (containExceptDevices()) { 32 | return LauncherType.ANDROID; 33 | } 34 | 35 | for (LauncherType type : LauncherType.values()) { 36 | if (packageName.contains(type.packageName)) { 37 | if (type == LauncherType.ICS_JELLY_BEAN_DEFAULT 38 | && !(android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH)) { 39 | return LauncherType.GINGERBREAD_DEFAULT; 40 | } 41 | return type; 42 | } 43 | } 44 | return LauncherType.ANDROID; 45 | } 46 | } -------------------------------------------------------------------------------- /UtilSetSampleApp/src/com/navercorp/utilsettest/ButtonColorList.java: -------------------------------------------------------------------------------- 1 | package com.navercorp.utilsettest; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Collections; 5 | import java.util.List; 6 | 7 | public class ButtonColorList { 8 | @SuppressWarnings({"serial" }) 9 | private static final List list = Collections.unmodifiableList(new ArrayList() { 10 | { 11 | add(new ButtonColor("Indigo", 0xFF481884, 0xFF270059, 0xFFffffff)); 12 | add(new ButtonColor("Steel blue", 0xFF3983b6, 0xFF154b70, 0xFFffffff)); 13 | add(new ButtonColor("Carnation pink", 0xFFffaac9, 0xFF9c546f, 0xFFffffff)); 14 | add(new ButtonColor("Carmine", 0xFFff0038, 0xFF80001c, 0xFFffffff)); 15 | add(new ButtonColor("Sienna", 0xFF8c3611, 0xFF461a09, 0xFFffffff)); 16 | add(new ButtonColor("Lime", 0xFFc1f900, 0xFF7fb900, 0xFF156615)); 17 | add(new ButtonColor("Kelly green", 0xFF49b700, 0xFF255c00, 0xFFffffff)); 18 | add(new ButtonColor("Teal", 0xFF338594, 0xFF004d5b, 0xFFffffff)); 19 | add(new ButtonColor("Peace", 0xFF3794dd, 0xFF0b5794, 0xFFffffff)); 20 | add(new ButtonColor("Azure", 0xFF0085ff, 0xFF004b8f, 0xFFffffff)); 21 | } 22 | }); 23 | 24 | public static List getButtonColorList() { 25 | return list; 26 | } 27 | 28 | public static ButtonColor getButtonColor(int index) { 29 | return list.get(index); 30 | } 31 | } -------------------------------------------------------------------------------- /UtilSetSampleApp/res/layout/fragment_keep_screen_on.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 20 | 21 | 25 | 26 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /UtilSetSampleApp/src/com/navercorp/utilsettest/ui/ActivityUtilsPagerAdapter.java: -------------------------------------------------------------------------------- 1 | package com.navercorp.utilsettest.ui; 2 | 3 | import android.support.v4.app.Fragment; 4 | import android.support.v4.app.FragmentManager; 5 | import android.support.v4.app.FragmentPagerAdapter; 6 | import android.util.Log; 7 | 8 | public class ActivityUtilsPagerAdapter extends FragmentPagerAdapter { 9 | private static final int NUMBER_OF_FRAGMENTS = 2; 10 | private static final String TAG = "UtilSet"; 11 | 12 | 13 | public ActivityUtilsPagerAdapter(FragmentManager fm) { 14 | super(fm); 15 | // TODO Auto-generated constructor stub 16 | } 17 | 18 | @Override 19 | public Fragment getItem(int index) { 20 | // TODO Auto-generated method stub 21 | if (index == ActivityUtilsConstants.KEEP_SCREEN_ON) { 22 | Log.d(TAG, "getItem 0"); 23 | return new ActivityUtilsKeepScreenOnFragment(); 24 | } 25 | 26 | Log.d(TAG, "getItem 1"); 27 | return new ActivityUtilsKeepScreenOnFragment(); 28 | } 29 | 30 | @Override 31 | public int getCount() { 32 | // TODO Auto-generated method stub 33 | return NUMBER_OF_FRAGMENTS; 34 | } 35 | 36 | @Override 37 | public CharSequence getPageTitle(int position) { 38 | // TODO Auto-generated method stub 39 | if (position == ActivityUtilsConstants.KEEP_SCREEN_ON) { 40 | return "Keep Screen On"; 41 | } 42 | return "Clear Screen On"; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /UtilSetSampleApp/res/layout/activity_keyboardutils.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 11 | 12 | 13 | 14 | 18 | 19 |