├── app ├── .gitignore ├── app-release.apk ├── src │ ├── main │ │ ├── res │ │ │ ├── drawable │ │ │ │ ├── hololo.png │ │ │ │ ├── ic_launcher.png │ │ │ │ ├── dns_changer_top_bg.png │ │ │ │ ├── dns_changer_ico_inverse.png │ │ │ │ ├── divider.xml │ │ │ │ ├── button_blue.xml │ │ │ │ ├── button.xml │ │ │ │ ├── button_red.xml │ │ │ │ ├── edittext_border.xml │ │ │ │ ├── ic_vpn_key_black_24dp.xml │ │ │ │ └── splash.xml │ │ │ ├── values │ │ │ │ ├── dimens.xml │ │ │ │ ├── colors.xml │ │ │ │ ├── attrs.xml │ │ │ │ ├── styles.xml │ │ │ │ └── strings.xml │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── values-w820dp │ │ │ │ └── dimens.xml │ │ │ ├── menu │ │ │ │ └── menu_main.xml │ │ │ ├── xml │ │ │ │ └── preference_layout.xml │ │ │ ├── layout │ │ │ │ ├── activity_settings.xml │ │ │ │ ├── activity_about.xml │ │ │ │ └── activity_main.xml │ │ │ └── values-tr │ │ │ │ └── strings.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── hololo │ │ │ │ └── app │ │ │ │ └── dnschanger │ │ │ │ ├── utils │ │ │ │ ├── event │ │ │ │ │ ├── StartEvent.java │ │ │ │ │ ├── StopEvent.java │ │ │ │ │ ├── GetServiceInfo.java │ │ │ │ │ └── ServiceInfo.java │ │ │ │ ├── RxBus.java │ │ │ │ ├── MoveUpBehavior.java │ │ │ │ └── ui │ │ │ │ │ ├── BehaviorScrollView.java │ │ │ │ │ └── MaskedEditText.java │ │ │ │ ├── dnschanger │ │ │ │ ├── IDNSView.java │ │ │ │ ├── DNSComponent.java │ │ │ │ ├── DNSModule.java │ │ │ │ ├── BootReceiver.java │ │ │ │ ├── DNSPresenter.java │ │ │ │ ├── DNSService.java │ │ │ │ └── MainActivity.java │ │ │ │ ├── di │ │ │ │ ├── scope │ │ │ │ │ └── ActivityScope.java │ │ │ │ ├── component │ │ │ │ │ └── ApplicationComponent.java │ │ │ │ └── module │ │ │ │ │ └── ApplicationModule.java │ │ │ │ ├── model │ │ │ │ ├── DNSModelJSON.java │ │ │ │ └── DNSModel.java │ │ │ │ ├── DNSChangerApp.java │ │ │ │ ├── settings │ │ │ │ └── SettingsActivity.java │ │ │ │ └── about │ │ │ │ └── AboutActivity.java │ │ ├── AndroidManifest.xml │ │ └── assets │ │ │ └── dns_servers.json │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── hololo │ │ │ └── app │ │ │ └── dnschanger │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── hololo │ │ └── app │ │ └── dnschanger │ │ └── ExampleInstrumentedTest.java ├── signing.properties ├── build.gradle └── proguard-rules.pro ├── settings.gradle ├── images ├── 1.png ├── 2.png ├── 3.png └── 4.png ├── .idea ├── copyright │ └── profiles_settings.xml ├── markdown-navigator │ └── profiles_settings.xml ├── vcs.xml ├── modules.xml ├── runConfigurations.xml ├── compiler.xml ├── gradle.xml ├── misc.xml └── markdown-navigator.xml ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── gradle.properties ├── LICENSE ├── README.md ├── gradlew.bat └── gradlew /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /images/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msayan/star-dns-changer/HEAD/images/1.png -------------------------------------------------------------------------------- /images/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msayan/star-dns-changer/HEAD/images/2.png -------------------------------------------------------------------------------- /images/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msayan/star-dns-changer/HEAD/images/3.png -------------------------------------------------------------------------------- /images/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msayan/star-dns-changer/HEAD/images/4.png -------------------------------------------------------------------------------- /app/app-release.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msayan/star-dns-changer/HEAD/app/app-release.apk -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msayan/star-dns-changer/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/drawable/hololo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msayan/star-dns-changer/HEAD/app/src/main/res/drawable/hololo.png -------------------------------------------------------------------------------- /app/signing.properties: -------------------------------------------------------------------------------- 1 | KEYSTORE_FILE=your/keystorefile/path.jks 2 | KEYSTORE_PASSWORD=pass 3 | KEY_ALIAS=alias 4 | KEY_PASSWORD=key_pass -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msayan/star-dns-changer/HEAD/app/src/main/res/drawable/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msayan/star-dns-changer/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msayan/star-dns-changer/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msayan/star-dns-changer/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msayan/star-dns-changer/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msayan/star-dns-changer/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /.idea/markdown-navigator/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/dns_changer_top_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msayan/star-dns-changer/HEAD/app/src/main/res/drawable/dns_changer_top_bg.png -------------------------------------------------------------------------------- /app/src/main/java/com/hololo/app/dnschanger/utils/event/StartEvent.java: -------------------------------------------------------------------------------- 1 | package com.hololo.app.dnschanger.utils.event; 2 | 3 | public class StartEvent { 4 | } 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/dns_changer_ico_inverse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msayan/star-dns-changer/HEAD/app/src/main/res/drawable/dns_changer_ico_inverse.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | ./idea 11 | -------------------------------------------------------------------------------- /app/src/main/java/com/hololo/app/dnschanger/utils/event/StopEvent.java: -------------------------------------------------------------------------------- 1 | package com.hololo.app.dnschanger.utils.event; 2 | 3 | public class StopEvent { 4 | 5 | public StopEvent() { 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/java/com/hololo/app/dnschanger/utils/event/GetServiceInfo.java: -------------------------------------------------------------------------------- 1 | package com.hololo.app.dnschanger.utils.event; 2 | 3 | /** 4 | * Created by android on 23.02.2017. 5 | */ 6 | 7 | public class GetServiceInfo { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/divider.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Dec 28 10:00:20 PST 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/button_blue.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/button.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/java/com/hololo/app/dnschanger/dnschanger/IDNSView.java: -------------------------------------------------------------------------------- 1 | package com.hololo.app.dnschanger.dnschanger; 2 | 3 | import com.hololo.app.dnschanger.model.DNSModel; 4 | 5 | public interface IDNSView { 6 | void changeStatus(int serviceStatus); 7 | 8 | void setServiceInfo(DNSModel model); 9 | } 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/button_red.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #5ea8cf 4 | #222 5 | #222 6 | #FFF 7 | #c42f27 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/java/com/hololo/app/dnschanger/di/scope/ActivityScope.java: -------------------------------------------------------------------------------- 1 | package com.hololo.app.dnschanger.di.scope; 2 | 3 | import java.lang.annotation.Retention; 4 | import java.lang.annotation.RetentionPolicy; 5 | 6 | import javax.inject.Scope; 7 | 8 | @Scope 9 | @Retention(RetentionPolicy.RUNTIME) 10 | public @interface ActivityScope { 11 | } 12 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/edittext_border.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/xml/preference_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/java/com/hololo/app/dnschanger/utils/event/ServiceInfo.java: -------------------------------------------------------------------------------- 1 | package com.hololo.app.dnschanger.utils.event; 2 | 3 | import com.hololo.app.dnschanger.model.DNSModel; 4 | 5 | public class ServiceInfo { 6 | private DNSModel model; 7 | 8 | public ServiceInfo(DNSModel model) { 9 | this.model = model; 10 | } 11 | 12 | public DNSModel getModel() { 13 | return model; 14 | } 15 | 16 | public void setModel(DNSModel model) { 17 | this.model = model; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /app/src/main/java/com/hololo/app/dnschanger/dnschanger/DNSComponent.java: -------------------------------------------------------------------------------- 1 | package com.hololo.app.dnschanger.dnschanger; 2 | 3 | import com.hololo.app.dnschanger.di.component.ApplicationComponent; 4 | import com.hololo.app.dnschanger.di.scope.ActivityScope; 5 | 6 | import dagger.Component; 7 | 8 | @Component(modules = {DNSModule.class}, dependencies = {ApplicationComponent.class}) 9 | @ActivityScope 10 | public interface DNSComponent { 11 | 12 | IDNSView view(); 13 | 14 | void inject(MainActivity activity); 15 | } 16 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_vpn_key_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/test/java/com/hololo/app/dnschanger/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.hololo.app.dnschanger; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hololo/app/dnschanger/dnschanger/DNSModule.java: -------------------------------------------------------------------------------- 1 | package com.hololo.app.dnschanger.dnschanger; 2 | 3 | import com.hololo.app.dnschanger.di.scope.ActivityScope; 4 | 5 | import dagger.Module; 6 | import dagger.Provides; 7 | 8 | @Module 9 | @ActivityScope 10 | public class DNSModule { 11 | 12 | private IDNSView idnsView; 13 | 14 | public DNSModule(IDNSView idnsView) { 15 | this.idnsView = idnsView; 16 | } 17 | 18 | @Provides 19 | @ActivityScope 20 | IDNSView idnsView() { 21 | return idnsView; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/java/com/hololo/app/dnschanger/model/DNSModelJSON.java: -------------------------------------------------------------------------------- 1 | package com.hololo.app.dnschanger.model; 2 | 3 | import com.google.gson.annotations.Expose; 4 | import com.google.gson.annotations.SerializedName; 5 | 6 | import java.util.List; 7 | 8 | public class DNSModelJSON { 9 | 10 | @SerializedName("modelList") 11 | @Expose 12 | private List modelList; 13 | 14 | public List getModelList() { 15 | return modelList; 16 | } 17 | 18 | public void setModelList(List modelList) { 19 | this.modelList = modelList; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/splash.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 13 | 14 | 15 | 16 | 19 | 20 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 19 | -------------------------------------------------------------------------------- /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 | org.gradle.jvmargs=-Xmx1536m 13 | 14 | # When configured, Gradle will run in incubating parallel mode. 15 | # This option should only be used with decoupled projects. More details, visit 16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 17 | # org.gradle.parallel=true 18 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 15 | 16 | 17 | 21 | -------------------------------------------------------------------------------- /app/src/main/java/com/hololo/app/dnschanger/di/component/ApplicationComponent.java: -------------------------------------------------------------------------------- 1 | package com.hololo.app.dnschanger.di.component; 2 | 3 | import android.content.Context; 4 | import android.content.SharedPreferences; 5 | 6 | import com.google.gson.Gson; 7 | import com.hololo.app.dnschanger.DNSChangerApp; 8 | import com.hololo.app.dnschanger.di.module.ApplicationModule; 9 | import com.hololo.app.dnschanger.dnschanger.DNSService; 10 | import com.hololo.app.dnschanger.utils.RxBus; 11 | 12 | import javax.inject.Singleton; 13 | 14 | import dagger.Component; 15 | 16 | @Singleton 17 | @Component(modules = {ApplicationModule.class}) 18 | public interface ApplicationComponent { 19 | 20 | DNSChangerApp dnsChangerApp(); 21 | 22 | RxBus rxBus(); 23 | 24 | Context appContext(); 25 | 26 | SharedPreferences pref(); 27 | 28 | Gson gson(); 29 | 30 | void inject(DNSService service); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/java/com/hololo/app/dnschanger/utils/RxBus.java: -------------------------------------------------------------------------------- 1 | package com.hololo.app.dnschanger.utils; 2 | 3 | import io.reactivex.Observable; 4 | import io.reactivex.subjects.PublishSubject; 5 | 6 | public class RxBus { 7 | private static RxBus instance; 8 | 9 | private PublishSubject subject = PublishSubject.create(); 10 | 11 | public static RxBus instanceOf() { 12 | if (instance == null) { 13 | instance = new RxBus(); 14 | } 15 | return instance; 16 | } 17 | 18 | /** 19 | * Pass any event down to event listeners. 20 | */ 21 | public void sendEvent(Object object) { 22 | subject.onNext(object); 23 | } 24 | 25 | /** 26 | * Subscribe to this Observable. On event, do something 27 | * e.g. replace a fragment 28 | */ 29 | public Observable getEvents() { 30 | return subject; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/hololo/app/dnschanger/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.hololo.app.dnschanger; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.hololo.app.dnschanger", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 | 13 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /app/src/main/java/com/hololo/app/dnschanger/DNSChangerApp.java: -------------------------------------------------------------------------------- 1 | package com.hololo.app.dnschanger; 2 | 3 | import android.app.Application; 4 | 5 | import com.hololo.app.dnschanger.di.component.ApplicationComponent; 6 | import com.hololo.app.dnschanger.di.component.DaggerApplicationComponent; 7 | import com.hololo.app.dnschanger.di.module.ApplicationModule; 8 | 9 | import timber.log.Timber; 10 | 11 | public class DNSChangerApp extends Application { 12 | private static ApplicationComponent applicationComponent; 13 | 14 | public static ApplicationComponent getApplicationComponent() { 15 | return applicationComponent; 16 | } 17 | 18 | @Override 19 | public void onCreate() { 20 | super.onCreate(); 21 | 22 | //di 23 | applicationComponent = DaggerApplicationComponent.builder() 24 | .applicationModule(new ApplicationModule(this)) 25 | .build(); 26 | 27 | 28 | if (BuildConfig.DEBUG) { 29 | Timber.plant(new Timber.DebugTree()); 30 | } else { 31 | //TODO: Add your release log tree 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/src/main/java/com/hololo/app/dnschanger/utils/MoveUpBehavior.java: -------------------------------------------------------------------------------- 1 | package com.hololo.app.dnschanger.utils; 2 | 3 | import android.os.Build; 4 | import android.support.design.widget.CoordinatorLayout; 5 | import android.support.design.widget.Snackbar; 6 | import android.view.View; 7 | 8 | @CoordinatorLayout.DefaultBehavior(MoveUpBehavior.class) 9 | public class MoveUpBehavior extends CoordinatorLayout.Behavior { 10 | private static final boolean SNACKBAR_BEHAVIOR_ENABLED; 11 | 12 | static { 13 | SNACKBAR_BEHAVIOR_ENABLED = Build.VERSION.SDK_INT >= 11; 14 | } 15 | 16 | @Override 17 | public boolean layoutDependsOn(CoordinatorLayout parent, View child, View dependency) { 18 | return SNACKBAR_BEHAVIOR_ENABLED && dependency instanceof Snackbar.SnackbarLayout; 19 | } 20 | 21 | @Override 22 | public boolean onDependentViewChanged(CoordinatorLayout parent, View child, View dependency) { 23 | float translationY = Math.min(0, dependency.getTranslationY() - dependency.getHeight()); 24 | child.setTranslationY(translationY); 25 | return true; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/java/com/hololo/app/dnschanger/utils/ui/BehaviorScrollView.java: -------------------------------------------------------------------------------- 1 | package com.hololo.app.dnschanger.utils.ui; 2 | 3 | import android.content.Context; 4 | import android.os.Build; 5 | import android.support.annotation.RequiresApi; 6 | import android.support.design.widget.CoordinatorLayout; 7 | import android.util.AttributeSet; 8 | import android.widget.ScrollView; 9 | 10 | import com.hololo.app.dnschanger.utils.MoveUpBehavior; 11 | 12 | @CoordinatorLayout.DefaultBehavior(MoveUpBehavior.class) 13 | public class BehaviorScrollView extends ScrollView { 14 | public BehaviorScrollView(Context context) { 15 | super(context); 16 | } 17 | 18 | public BehaviorScrollView(Context context, AttributeSet attrs) { 19 | super(context, attrs); 20 | } 21 | 22 | public BehaviorScrollView(Context context, AttributeSet attrs, int defStyleAttr) { 23 | super(context, attrs, defStyleAttr); 24 | } 25 | 26 | @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) 27 | public BehaviorScrollView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { 28 | super(context, attrs, defStyleAttr, defStyleRes); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017 Mehmet Salim Ayan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /app/src/main/res/values-tr/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Hakkında 4 | Star DNS Değiştirici Hakkında 5 | Star DNS Değiştirici 6 | DNS Sunucusu Seçiniz.. 7 | Özel DNS Sunucusu 8 | Lütfen geçerli bir DNS sunucusu giriniz. 9 | Geri Bildirim Gönderin 10 | Mail Gönder 11 | DNS Servisi başladı 12 | DNS Servisi durdu 13 | Değiştir! 14 | Durdur 15 | Neler düşündüğünü bize söyle. 16 | Versiyon %1$s 17 | İptal 18 | Başlangıçta otomatik çalıştır 19 | Ayarlar 20 | DNS başlat 21 | DNS servisi hazır 22 | DNS başlatılıyor. 23 | Genel Ayarlar 24 | -------------------------------------------------------------------------------- /app/src/main/java/com/hololo/app/dnschanger/di/module/ApplicationModule.java: -------------------------------------------------------------------------------- 1 | package com.hololo.app.dnschanger.di.module; 2 | 3 | import android.content.Context; 4 | import android.content.SharedPreferences; 5 | import android.preference.PreferenceManager; 6 | 7 | import com.google.gson.Gson; 8 | import com.google.gson.GsonBuilder; 9 | import com.hololo.app.dnschanger.DNSChangerApp; 10 | import com.hololo.app.dnschanger.utils.RxBus; 11 | 12 | import javax.inject.Singleton; 13 | 14 | import dagger.Module; 15 | import dagger.Provides; 16 | 17 | @Module 18 | @Singleton 19 | public class ApplicationModule { 20 | private DNSChangerApp application; 21 | 22 | public ApplicationModule(DNSChangerApp application) { 23 | this.application = application; 24 | } 25 | 26 | @Provides 27 | @Singleton 28 | DNSChangerApp provideApplication() { 29 | return this.application; 30 | } 31 | 32 | @Provides 33 | @Singleton 34 | RxBus rxBus() { 35 | return new RxBus(); 36 | } 37 | 38 | @Provides 39 | @Singleton 40 | SharedPreferences providesSharedPreferences(DNSChangerApp application) { 41 | return PreferenceManager.getDefaultSharedPreferences(application); 42 | } 43 | 44 | @Provides 45 | @Singleton 46 | Gson gson() { 47 | return new GsonBuilder().create(); 48 | } 49 | 50 | @Provides 51 | @Singleton 52 | Context provideApplicationContext() { 53 | return application.getApplicationContext(); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Star DNS Changer 3 | Change It! 4 | Stop 5 | Enter valid DNS Server please. 6 | 0.0.0.0 7 | 0.0.0.0 8 | DNS service stopped 9 | DNS service started 10 | Choose DNS Server.. 11 | Custom DNS Server 12 | About 13 | Tell us what you think 14 | Send Feedback 15 | \@2017 Hololo Inc. 16 | Version %1$s 17 | About Star DNS Changer 18 | Send mail… 19 | Cancel 20 | Settings 21 | Auto start on boot 22 | DNS service ready for start 23 | Turn On DNS 24 | DNS starting. 25 | General Settings 26 | 27 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 28 | 29 | 30 | 31 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /app/src/main/java/com/hololo/app/dnschanger/settings/SettingsActivity.java: -------------------------------------------------------------------------------- 1 | package com.hololo.app.dnschanger.settings; 2 | 3 | import android.os.Bundle; 4 | import android.preference.PreferenceFragment; 5 | import android.support.v7.app.AppCompatActivity; 6 | import android.support.v7.widget.Toolbar; 7 | import android.view.MenuItem; 8 | import android.widget.FrameLayout; 9 | 10 | import com.hololo.app.dnschanger.R; 11 | 12 | import butterknife.BindView; 13 | import butterknife.ButterKnife; 14 | 15 | 16 | public class SettingsActivity extends AppCompatActivity { 17 | 18 | @BindView(R.id.toolbar) 19 | Toolbar toolbar; 20 | @BindView(R.id.fragment_container) 21 | FrameLayout fragmentContainer; 22 | 23 | @Override 24 | protected void onCreate(Bundle savedInstanceState) { 25 | super.onCreate(savedInstanceState); 26 | setContentView(R.layout.activity_settings); 27 | ButterKnife.bind(this); 28 | 29 | setSupportActionBar(toolbar); 30 | if (getSupportActionBar() != null) { 31 | getSupportActionBar().setTitle(R.string.settings); 32 | getSupportActionBar().setDisplayHomeAsUpEnabled(true); 33 | } 34 | 35 | getFragmentManager().beginTransaction() 36 | .replace(R.id.fragment_container, new SettingsFragment()) 37 | .commit(); 38 | } 39 | 40 | @Override 41 | public boolean onOptionsItemSelected(MenuItem item) { 42 | switch (item.getItemId()) { 43 | case android.R.id.home: 44 | finish(); 45 | break; 46 | } 47 | return super.onOptionsItemSelected(item); 48 | } 49 | 50 | 51 | public static class SettingsFragment extends PreferenceFragment { 52 | @Override 53 | public void onCreate(Bundle savedInstanceState) { 54 | super.onCreate(savedInstanceState); 55 | 56 | addPreferencesFromResource(R.xml.preference_layout); 57 | } 58 | } 59 | 60 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hololo/app/dnschanger/model/DNSModel.java: -------------------------------------------------------------------------------- 1 | package com.hololo.app.dnschanger.model; 2 | 3 | import android.os.Parcel; 4 | import android.os.Parcelable; 5 | 6 | import com.google.gson.annotations.SerializedName; 7 | 8 | public class DNSModel implements Parcelable { 9 | @SerializedName("name") 10 | private String name; 11 | @SerializedName("firstDNS") 12 | private String firstDns; 13 | @SerializedName("secondDNS") 14 | private String secondDns; 15 | 16 | public String getName() { 17 | return name; 18 | } 19 | 20 | public void setName(String name) { 21 | this.name = name; 22 | } 23 | 24 | public String getFirstDns() { 25 | return firstDns; 26 | } 27 | 28 | public void setFirstDns(String firstDns) { 29 | this.firstDns = firstDns; 30 | } 31 | 32 | public String getSecondDns() { 33 | return secondDns; 34 | } 35 | 36 | public void setSecondDns(String secondDns) { 37 | this.secondDns = secondDns; 38 | } 39 | 40 | 41 | @Override 42 | public int describeContents() { 43 | return 0; 44 | } 45 | 46 | @Override 47 | public void writeToParcel(Parcel dest, int flags) { 48 | dest.writeString(this.name); 49 | dest.writeString(this.firstDns); 50 | dest.writeString(this.secondDns); 51 | } 52 | 53 | public DNSModel() { 54 | } 55 | 56 | protected DNSModel(Parcel in) { 57 | this.name = in.readString(); 58 | this.firstDns = in.readString(); 59 | this.secondDns = in.readString(); 60 | } 61 | 62 | public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { 63 | @Override 64 | public DNSModel createFromParcel(Parcel source) { 65 | return new DNSModel(source); 66 | } 67 | 68 | @Override 69 | public DNSModel[] newArray(int size) { 70 | return new DNSModel[size]; 71 | } 72 | }; 73 | } 74 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Star DNS Changer Android Application 2 | 3 | ### Introdution 4 | Star DNS Changer is a DNS Changer application. 5 | 6 | 7 | Get it on Google Play 8 | 9 | ### Screenshots 10 | ![screenshots](images/1.png) ![screenshots](images/2.png) ![screenshots](images/3.png) ![screenshots](images/4.png) 11 | 12 | ### Libraries 13 | - [RxJava2](https://github.com/ReactiveX/RxJava) and [RxAndroid](https://github.com/ReactiveX/RxAndroid) 14 | - [Dagger 2](http://google.github.io/dagger/) 15 | - [Butterknife](https://github.com/JakeWharton/butterknife) 16 | - [Timber](https://github.com/JakeWharton/timber) 17 | 18 | ## Build 19 | 20 | ```shell 21 | ./gradlew assembleDebug 22 | ``` 23 | 24 | ### Contact Me 25 | 26 | - Github: github.com/msayan 27 | - Email: m.salimayan@gmail.com 28 | 29 | ### License 30 | 31 | The MIT License (MIT) 32 | 33 | Copyright (c) 2017 Mehmet Salim Ayan 34 | 35 | Permission is hereby granted, free of charge, to any person obtaining a copy 36 | of this software and associated documentation files (the "Software"), to deal 37 | in the Software without restriction, including without limitation the rights 38 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 39 | copies of the Software, and to permit persons to whom the Software is 40 | furnished to do so, subject to the following conditions: 41 | 42 | The above copyright notice and this permission notice shall be included in all 43 | copies or substantial portions of the Software. 44 | 45 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 46 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 47 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 48 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 49 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 50 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 51 | SOFTWARE. -------------------------------------------------------------------------------- /app/src/main/assets/dns_servers.json: -------------------------------------------------------------------------------- 1 | { 2 | "modelList": [ 3 | { 4 | "name": "Google DNS", 5 | "firstDNS": "8.8.8.8", 6 | "secondDNS": "8.8.4.4" 7 | }, 8 | { 9 | "name": "Open DNS", 10 | "firstDNS": "208.67.222.222", 11 | "secondDNS": "208.67.220.220" 12 | }, 13 | { 14 | "name": "Level3", 15 | "firstDNS": "209.244.0.3", 16 | "secondDNS": "209.244.0.4" 17 | }, 18 | { 19 | "name": "Verisign", 20 | "firstDNS": "64.6.64.6", 21 | "secondDNS": "64.6.65.6" 22 | }, 23 | { 24 | "name": "DNS.WATCH", 25 | "firstDNS": "84.200.69.80", 26 | "secondDNS": "84.200.70.40" 27 | }, 28 | { 29 | "name": "Comodo Secure DNS", 30 | "firstDNS": "8.26.56.26", 31 | "secondDNS": "8.20.247.20" 32 | }, 33 | { 34 | "name": "DNS Advantage", 35 | "firstDNS": "156.154.70.1", 36 | "secondDNS": "156.154.71.1" 37 | }, 38 | { 39 | "name": "Norton ConnectSafe", 40 | "firstDNS": "199.85.126.10", 41 | "secondDNS": "199.85.127.10" 42 | }, 43 | { 44 | "name": "GreenTeamDNS", 45 | "firstDNS": "81.218.119.11", 46 | "secondDNS": "209.88.198.133" 47 | }, 48 | { 49 | "name": "SafeDNS", 50 | "firstDNS": "195.46.39.39", 51 | "secondDNS": "195.46.39.40" 52 | }, 53 | { 54 | "name": "OpenNIC", 55 | "firstDNS": "96.90.175.167", 56 | "secondDNS": "193.183.98.154" 57 | }, 58 | { 59 | "name": "SmartViper", 60 | "firstDNS": "208.76.50.50", 61 | "secondDNS": "208.76.51.51" 62 | }, 63 | { 64 | "name": "Dyn", 65 | "firstDNS": "216.146.35.35", 66 | "secondDNS": "216.146.36.36" 67 | }, 68 | { 69 | "name": "FreeDNS", 70 | "firstDNS": "37.235.1.174", 71 | "secondDNS": "37.235.1.177" 72 | }, 73 | { 74 | "name": "Alternate DNS", 75 | "firstDNS": "198.101.242.72", 76 | "secondDNS": "23.253.163.53" 77 | }, 78 | { 79 | "name": "Yandex.DNS", 80 | "firstDNS": "77.88.8.8", 81 | "secondDNS": "77.88.8.1" 82 | }, 83 | { 84 | "name": "censurfridns.dk", 85 | "firstDNS": "91.239.100.100", 86 | "secondDNS": "89.233.43.71" 87 | } 88 | ] 89 | } -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_about.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 17 | 18 | 19 | 26 | 27 | 35 | 36 | 37 | 42 | 43 | 47 | 48 | 55 | 56 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 19 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 46 | -------------------------------------------------------------------------------- /app/src/main/java/com/hololo/app/dnschanger/dnschanger/BootReceiver.java: -------------------------------------------------------------------------------- 1 | package com.hololo.app.dnschanger.dnschanger; 2 | 3 | import android.app.Notification; 4 | import android.app.NotificationManager; 5 | import android.app.PendingIntent; 6 | import android.content.BroadcastReceiver; 7 | import android.content.Context; 8 | import android.content.Intent; 9 | import android.content.SharedPreferences; 10 | import android.preference.PreferenceManager; 11 | import android.support.v4.app.NotificationCompat; 12 | 13 | import com.hololo.app.dnschanger.R; 14 | 15 | 16 | public class BootReceiver extends BroadcastReceiver { 17 | private NotificationManager notificationManager; 18 | private NotificationCompat.Builder notificationBuilder; 19 | 20 | @Override 21 | public void onReceive(Context context, Intent intent) { 22 | if (intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED)) { 23 | SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context); 24 | boolean autoStart = preferences.getBoolean("startBoot", true); 25 | boolean isStarted = preferences.getBoolean("isStarted", false); 26 | String dnsModelJSON = preferences.getString("dnsModel", ""); 27 | 28 | if (autoStart && isStarted && !dnsModelJSON.isEmpty()) { 29 | notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); 30 | sendNotification(context, dnsModelJSON); 31 | } 32 | } 33 | } 34 | 35 | private void sendNotification(Context context, String dnsModel) { 36 | Intent intentAction = new Intent(context, MainActivity.class); 37 | 38 | intentAction.putExtra("dnsModel", dnsModel); 39 | 40 | PendingIntent pendingIntent = PendingIntent.getActivity(context, 1, intentAction, PendingIntent.FLAG_ONE_SHOT); 41 | 42 | notificationBuilder = new NotificationCompat.Builder(context) 43 | .setSmallIcon(R.drawable.dns_changer_ico_inverse) 44 | .setContentTitle(context.getString(R.string.service_ready)) 45 | .setContentIntent(pendingIntent) 46 | .addAction(R.drawable.ic_vpn_key_black_24dp, context.getString(R.string.turn_on), pendingIntent) 47 | .setAutoCancel(true); 48 | 49 | Notification notification = notificationBuilder.build(); 50 | 51 | notificationManager.notify(1903, notification); 52 | 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /app/src/main/java/com/hololo/app/dnschanger/about/AboutActivity.java: -------------------------------------------------------------------------------- 1 | package com.hololo.app.dnschanger.about; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | import android.support.v4.content.ContextCompat; 6 | import android.support.v7.app.AppCompatActivity; 7 | import android.support.v7.widget.Toolbar; 8 | import android.view.MenuItem; 9 | import android.widget.LinearLayout; 10 | import android.widget.TextView; 11 | 12 | import com.hololo.app.dnschanger.BuildConfig; 13 | import com.hololo.app.dnschanger.R; 14 | 15 | import butterknife.BindView; 16 | import butterknife.ButterKnife; 17 | import butterknife.OnClick; 18 | 19 | public class AboutActivity extends AppCompatActivity { 20 | 21 | @BindView(R.id.toolbar) 22 | Toolbar toolbar; 23 | @BindView(R.id.versionText) 24 | TextView versionText; 25 | @BindView(R.id.sendFeedback) 26 | TextView sendFeedback; 27 | @BindView(R.id.activity_about) 28 | LinearLayout activityAbout; 29 | 30 | @Override 31 | protected void onCreate(Bundle savedInstanceState) { 32 | super.onCreate(savedInstanceState); 33 | setContentView(R.layout.activity_about); 34 | ButterKnife.bind(this); 35 | 36 | setSupportActionBar(toolbar); 37 | toolbar.setTitleTextColor(ContextCompat.getColor(this, R.color.colorWhite)); 38 | getSupportActionBar().setTitle(R.string.about); 39 | getSupportActionBar().setDisplayHomeAsUpEnabled(true); 40 | 41 | versionText.setText(getString(R.string.version, BuildConfig.VERSION_NAME)); 42 | 43 | } 44 | 45 | @Override 46 | public boolean onOptionsItemSelected(MenuItem item) { 47 | switch (item.getItemId()) { 48 | case android.R.id.home: 49 | finish(); 50 | break; 51 | } 52 | return super.onOptionsItemSelected(item); 53 | } 54 | 55 | @OnClick(R.id.sendFeedback) 56 | public void onClick() { 57 | final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); 58 | 59 | emailIntent.setType("plain/text"); 60 | emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{"hololo.dev@gmail.com"}); 61 | emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, getString(R.string.about_app)); 62 | emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, getString(R.string.tell_us_what_you_think)); 63 | 64 | startActivity(Intent.createChooser(emailIntent, getString(R.string.send_mail))); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /app/src/main/java/com/hololo/app/dnschanger/dnschanger/DNSPresenter.java: -------------------------------------------------------------------------------- 1 | package com.hololo.app.dnschanger.dnschanger; 2 | 3 | import android.app.ActivityManager; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | 7 | import com.hololo.app.dnschanger.model.DNSModel; 8 | import com.hololo.app.dnschanger.utils.RxBus; 9 | import com.hololo.app.dnschanger.utils.event.GetServiceInfo; 10 | import com.hololo.app.dnschanger.utils.event.ServiceInfo; 11 | import com.hololo.app.dnschanger.utils.event.StartEvent; 12 | import com.hololo.app.dnschanger.utils.event.StopEvent; 13 | 14 | import javax.inject.Inject; 15 | 16 | import io.reactivex.functions.Consumer; 17 | 18 | import static com.hololo.app.dnschanger.dnschanger.DNSService.DNS_MODEL; 19 | 20 | class DNSPresenter { 21 | 22 | static final int SERVICE_OPEN = 1; 23 | static final int SERVICE_CLOSE = 0; 24 | 25 | private IDNSView view; 26 | private RxBus rxBus; 27 | private Context context; 28 | 29 | @Inject 30 | public DNSPresenter(IDNSView view, RxBus rxBus, Context context) { 31 | this.view = view; 32 | this.rxBus = rxBus; 33 | this.context = context; 34 | 35 | subscribe(); 36 | } 37 | 38 | private void subscribe() { 39 | rxBus.getEvents().subscribe(new Consumer() { 40 | @Override 41 | public void accept(Object o) throws Exception { 42 | if (o instanceof StartEvent) { 43 | view.changeStatus(SERVICE_OPEN); 44 | } else if (o instanceof StopEvent) { 45 | view.changeStatus(SERVICE_CLOSE); 46 | } else if (o instanceof ServiceInfo) { 47 | view.setServiceInfo(((ServiceInfo) o).getModel()); 48 | } 49 | } 50 | }); 51 | } 52 | 53 | void stopService() { 54 | rxBus.sendEvent(new StopEvent()); 55 | } 56 | 57 | void startService(DNSModel dnsModel) { 58 | Intent intent = new Intent(context, DNSService.class); 59 | intent.putExtra(DNS_MODEL, dnsModel); 60 | 61 | view.setServiceInfo(dnsModel); 62 | context.startService(intent); 63 | } 64 | 65 | public boolean isWorking() { 66 | ActivityManager manager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); 67 | String serviceName = DNSService.class.getName(); 68 | for (ActivityManager.RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) { 69 | if (serviceName.equals(service.service.getClassName())) { 70 | return true; 71 | } 72 | } 73 | return false; 74 | } 75 | 76 | void getServiceStatus() { 77 | if (isWorking()) { 78 | getServiceInfo(); 79 | view.changeStatus(SERVICE_OPEN); 80 | } else { 81 | view.changeStatus(SERVICE_CLOSE); 82 | } 83 | } 84 | 85 | public void getServiceInfo() { 86 | rxBus.sendEvent(new GetServiceInfo()); 87 | } 88 | } -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'android-apt' 3 | 4 | 5 | android { 6 | compileSdkVersion 25 7 | buildToolsVersion "25.0.2" 8 | defaultConfig { 9 | applicationId "com.hololo.app.dnschanger" 10 | minSdkVersion 16 11 | targetSdkVersion 25 12 | versionCode 1 13 | versionName "1.0.0" 14 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 15 | } 16 | signingConfigs { 17 | release 18 | } 19 | 20 | buildTypes { 21 | release { 22 | minifyEnabled true 23 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 24 | signingConfig signingConfigs.release 25 | } 26 | } 27 | } 28 | 29 | def Properties props = new Properties() 30 | def propFile = new File("${project.rootDir}/app/signing.properties") 31 | if (propFile.canRead()) { 32 | props.load(new FileInputStream(propFile)) 33 | 34 | if (props != null 35 | && props.containsKey("KEYSTORE_FILE") 36 | && props.containsKey("KEYSTORE_PASSWORD") 37 | && props.containsKey("KEY_ALIAS") 38 | && props.containsKey("KEY_PASSWORD")) { 39 | 40 | def keystoreFilePath = "${project.rootDir}" + props["KEYSTORE_FILE"] 41 | def keystoreFile = new File(keystoreFilePath) 42 | if (keystoreFile.canRead()) { 43 | android.signingConfigs.release.storeFile = keystoreFile 44 | android.signingConfigs.release.storePassword = props["KEYSTORE_PASSWORD"] 45 | android.signingConfigs.release.keyAlias = props["KEY_ALIAS"] 46 | android.signingConfigs.release.keyPassword = props["KEY_PASSWORD"] 47 | } else { 48 | println("keystore file not found: " + keystoreFilePath) 49 | android.buildTypes.release.signingConfig = null 50 | } 51 | } else { 52 | println("signing.properties found but some entries missing") 53 | android.buildTypes.release.signingConfig = null 54 | } 55 | } else { 56 | println("signing.properties not found") 57 | android.buildTypes.release.signingConfig = null 58 | } 59 | 60 | dependencies { 61 | compile fileTree(dir: 'libs', include: ['*.jar']) 62 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 63 | exclude group: 'com.android.support', module: 'support-annotations' 64 | }) 65 | compile 'com.android.support:appcompat-v7:25.1.0' 66 | 67 | 68 | //Rx 69 | compile 'io.reactivex.rxjava2:rxandroid:2.0.1' 70 | compile 'io.reactivex.rxjava2:rxjava:2.0.1' 71 | 72 | //Dagger 73 | compile 'com.google.dagger:dagger:2.9' 74 | apt 'com.google.dagger:dagger-compiler:2.9' 75 | provided 'javax.annotation:jsr250-api:1.0' 76 | 77 | //gson 78 | compile 'com.google.code.gson:gson:2.7' 79 | 80 | //Log 81 | compile 'com.jakewharton.timber:timber:4.5.1' 82 | 83 | 84 | //Butterknife 85 | compile 'com.jakewharton:butterknife:8.2.1' 86 | apt 'com.jakewharton:butterknife-compiler:8.2.1' 87 | 88 | testCompile 'junit:junit:4.12' 89 | compile 'com.android.support:design:25.1.1' 90 | compile 'com.android.support:cardview-v7:25.1.1' 91 | } -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | -keepattributes *Annotation* 2 | -keepattributes SourceFile,LineNumberTable 3 | -printmapping mapping.txt 4 | -dontoptimize 5 | 6 | -dontusemixedcaseclassnames 7 | -dontskipnonpubliclibraryclasses 8 | -verbose 9 | -dontpreverify 10 | 11 | -keepattributes RuntimeVisibleAnnotations 12 | -keepattributes RuntimeInvisibleAnnotations 13 | -keepattributes RuntimeVisibleParameterAnnotations 14 | -keepattributes RuntimeInvisibleParameterAnnotations 15 | -keepattributes *Annotation* 16 | -keepattributes Signature 17 | -keepattributes Exceptions 18 | -keep public class com.google.vending.licensing.ILicensingService 19 | -keep public class com.android.vending.licensing.ILicensingService 20 | 21 | 22 | 23 | -keepclasseswithmembernames class * { 24 | native ; 25 | } 26 | -keepclassmembers public class * extends android.view.View { 27 | void set*(***); 28 | *** get*(); 29 | } 30 | -keepclassmembers class * extends android.app.Activity { 31 | public void *(android.view.View); 32 | } 33 | -keepclassmembers enum * { 34 | public static **[] values(); 35 | public static ** valueOf(java.lang.String); 36 | } 37 | -keepclassmembers class * implements android.os.Parcelable { 38 | public static final android.os.Parcelable$Creator CREATOR; 39 | } 40 | -keepclassmembers class **.R$* { 41 | public static ; 42 | } 43 | 44 | -keep class **$Properties 45 | 46 | -dontwarn android.support.** 47 | 48 | -keep public class * extends java.lang.Exception 49 | 50 | #Butterknife 51 | -keep class butterknife.* 52 | -keepclasseswithmembernames class * { @butterknife.* ; } 53 | -keepclasseswithmembernames class * { @butterknife.* ; } 54 | 55 | #GreenDao 56 | -keepclassmembers class * extends org.greenrobot.greendao.AbstractDao { 57 | public static java.lang.String TABLENAME; 58 | } 59 | -dontwarn org.greenrobot.greendao.database.** 60 | 61 | 62 | #Google 63 | -keep class com.google.** { *;} 64 | -keep interface com.google.** { *;} 65 | -dontwarn com.google.** 66 | -dontwarn android.support.** 67 | -dontnote android.support.** 68 | 69 | #Picasso 70 | -dontwarn com.squareup.okhttp.** 71 | 72 | #Retrofit 73 | -dontwarn retrofit2.** 74 | -keep class retrofit2.** { *; } 75 | -keepattributes Signature 76 | -keepattributes Exceptions 77 | -dontwarn okio.** 78 | 79 | -keepclasseswithmembers class * { 80 | @retrofit2.http.* ; 81 | } 82 | 83 | # rxjava 84 | -keep class rx.schedulers.Schedulers { 85 | public static ; 86 | } 87 | -keep class rx.schedulers.ImmediateScheduler { 88 | public ; 89 | } 90 | -keep class rx.schedulers.TestScheduler { 91 | public ; 92 | } 93 | -keep class rx.schedulers.Schedulers { 94 | public static ** test(); 95 | } 96 | -keepclassmembers class rx.internal.util.unsafe.*ArrayQueue*Field* { 97 | long producerIndex; 98 | long consumerIndex; 99 | } 100 | -keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueProducerNodeRef { 101 | long producerNode; 102 | long consumerNode; 103 | } 104 | 105 | -dontwarn sun.misc.Unsafe 106 | -dontwarn org.w3c.dom.bootstrap.DOMImplementationRegistry 107 | 108 | #apache 109 | -keep class org.apache.** { *; } 110 | -keep interface org.apache.** { *; } 111 | -dontwarn org.apache.** 112 | 113 | #myid3 114 | -keep interface org.cmc.music.** { *; } 115 | -keep class org.cmc.music** { *; } 116 | -dontwarn org.cmc.music.** -------------------------------------------------------------------------------- /.idea/markdown-navigator.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 34 | 35 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /app/src/main/java/com/hololo/app/dnschanger/dnschanger/DNSService.java: -------------------------------------------------------------------------------- 1 | package com.hololo.app.dnschanger.dnschanger; 2 | 3 | import android.app.Service; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.content.SharedPreferences; 7 | import android.net.VpnService; 8 | import android.os.ParcelFileDescriptor; 9 | import android.preference.PreferenceManager; 10 | 11 | import com.google.gson.Gson; 12 | import com.hololo.app.dnschanger.DNSChangerApp; 13 | import com.hololo.app.dnschanger.R; 14 | import com.hololo.app.dnschanger.model.DNSModel; 15 | import com.hololo.app.dnschanger.utils.RxBus; 16 | import com.hololo.app.dnschanger.utils.event.GetServiceInfo; 17 | import com.hololo.app.dnschanger.utils.event.ServiceInfo; 18 | import com.hololo.app.dnschanger.utils.event.StartEvent; 19 | import com.hololo.app.dnschanger.utils.event.StopEvent; 20 | 21 | import java.io.IOException; 22 | import java.net.InetSocketAddress; 23 | import java.nio.channels.DatagramChannel; 24 | 25 | import javax.inject.Inject; 26 | 27 | import io.reactivex.disposables.Disposable; 28 | import io.reactivex.functions.Consumer; 29 | import timber.log.Timber; 30 | 31 | public class DNSService extends VpnService { 32 | public final static String DNS_MODEL = "DNSModelIntent"; 33 | 34 | @Inject 35 | RxBus rxBus; 36 | @Inject 37 | Context context; 38 | @Inject 39 | Gson gson; 40 | 41 | private VpnService.Builder builder = new VpnService.Builder(); 42 | private ParcelFileDescriptor fileDescriptor; 43 | private Thread mThread; 44 | private boolean shouldRun = true; 45 | private DatagramChannel tunnel; 46 | private DNSModel dnsModel; 47 | private SharedPreferences preferences; 48 | 49 | private Disposable subscriber; 50 | 51 | private void stopThisService() { 52 | this.shouldRun = false; 53 | stopSelf(); 54 | } 55 | 56 | @Override 57 | public void onDestroy() { 58 | super.onDestroy(); 59 | preferences.edit().putBoolean("isStarted", false).apply(); 60 | preferences.edit().remove("dnsModel").apply(); 61 | Timber.e("Servis kapandı."); 62 | subscriber.dispose(); 63 | } 64 | 65 | @Override 66 | public void onCreate() { 67 | super.onCreate(); 68 | preferences = PreferenceManager.getDefaultSharedPreferences(this); 69 | DNSChangerApp.getApplicationComponent().inject(this); 70 | subscribe(); 71 | } 72 | 73 | private void subscribe() { 74 | subscriber = rxBus.getEvents().subscribe(new Consumer() { 75 | @Override 76 | public void accept(Object o) throws Exception { 77 | if (o instanceof StopEvent) { 78 | stopThisService(); 79 | } else if (o instanceof GetServiceInfo) { 80 | rxBus.sendEvent(new ServiceInfo(dnsModel)); 81 | } 82 | } 83 | }); 84 | } 85 | 86 | private void setTunnel(DatagramChannel tunnel) { 87 | this.tunnel = tunnel; 88 | } 89 | 90 | private void setFileDescriptor(ParcelFileDescriptor fileDescriptor) { 91 | this.fileDescriptor = fileDescriptor; 92 | } 93 | 94 | @Override 95 | public int onStartCommand(final Intent paramIntent, int p1, int p2) { 96 | mThread = new Thread(new Runnable() { 97 | public void run() { 98 | try { 99 | dnsModel = paramIntent.getParcelableExtra(DNS_MODEL); 100 | 101 | String modelJSON = gson.toJson(dnsModel); 102 | preferences.edit().putString("dnsModel", modelJSON).apply(); 103 | 104 | setFileDescriptor(builder.setSession(DNSService.this.getText(R.string.app_name).toString()). 105 | addAddress("192.168.0.1", 24).addDnsServer(dnsModel.getFirstDns()).addDnsServer(dnsModel.getSecondDns()).establish()); 106 | setTunnel(DatagramChannel.open()); 107 | tunnel.connect(new InetSocketAddress("127.0.0.1", 8087)); 108 | protect(tunnel.socket()); 109 | while (shouldRun) 110 | Thread.sleep(100L); 111 | } catch (Exception exception) { 112 | Timber.e(exception); 113 | } finally { 114 | if (fileDescriptor != null) { 115 | try { 116 | fileDescriptor.close(); 117 | setFileDescriptor(null); 118 | } catch (IOException e) { 119 | Timber.d(e); 120 | } 121 | } 122 | } 123 | } 124 | } 125 | , "DNS Changer"); 126 | mThread.start(); 127 | rxBus.sendEvent(new StartEvent()); 128 | preferences.edit().putBoolean("isStarted", true).apply(); 129 | return Service.START_STICKY; 130 | } 131 | } 132 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 18 | 19 | 25 | 26 | 32 | 33 | 37 | 38 | 39 | 40 | 41 | 42 | 48 | 49 | 54 | 55 | 66 | 67 |