├── app ├── .gitignore ├── release │ ├── app-release.apk │ └── output.json ├── src │ └── main │ │ ├── res │ │ ├── drawable │ │ │ ├── vip.png │ │ │ ├── close.png │ │ │ ├── play.png │ │ │ ├── splash.jpg │ │ │ ├── download_qrcode.png │ │ │ ├── filled_green_circle.png │ │ │ ├── button_textview.xml │ │ │ └── ic_launcher_background.xml │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ ├── values │ │ │ ├── dimens.xml │ │ │ ├── colors.xml │ │ │ ├── adurls.xml │ │ │ ├── strings.xml │ │ │ ├── styles.xml │ │ │ └── attrs.xml │ │ ├── menu │ │ │ └── menu_setting.xml │ │ ├── layout │ │ │ ├── vip_code_dialog.xml │ │ │ ├── vparser_dialog.xml │ │ │ ├── activity_player.xml │ │ │ ├── activity_web_play.xml │ │ │ ├── activity_start.xml │ │ │ ├── icon_text_view.xml │ │ │ ├── fragment_main.xml │ │ │ ├── setting_item_view.xml │ │ │ ├── activity_main.xml │ │ │ ├── activity_web_view.xml │ │ │ ├── activity_registe.xml │ │ │ ├── fragment_mine.xml │ │ │ ├── activity_login.xml │ │ │ └── activity_change_password.xml │ │ └── drawable-v24 │ │ │ └── ic_launcher_foreground.xml │ │ ├── java │ │ └── com │ │ │ └── novip │ │ │ ├── model │ │ │ ├── VipCode.java │ │ │ ├── AdUrl.java │ │ │ ├── BaseResponse.java │ │ │ ├── Ad.java │ │ │ ├── User.java │ │ │ ├── Platform.java │ │ │ ├── Version.java │ │ │ ├── Novip.java │ │ │ └── VParser.java │ │ │ ├── view │ │ │ ├── VParserDialog.java │ │ │ ├── SettingItemView.java │ │ │ ├── IconTextView.java │ │ │ ├── VipCodeDialog.java │ │ │ └── CountDownView.java │ │ │ ├── app │ │ │ ├── VipChannel.java │ │ │ ├── BaseActivity.java │ │ │ ├── OnFragmentInteractionListener.java │ │ │ ├── BannerADImageLoader.java │ │ │ ├── RegisteActivity.java │ │ │ ├── ChangePasswordActivity.java │ │ │ ├── StartActivity.java │ │ │ ├── MainActivity.java │ │ │ ├── LoginActivity.java │ │ │ ├── MainFragment.java │ │ │ └── MineFragment.java │ │ │ ├── utils │ │ │ ├── LogUtils.java │ │ │ ├── PlatformUtil.java │ │ │ ├── DensityUtils.java │ │ │ ├── SharedPrefernceUtils.java │ │ │ ├── ShareUtils.java │ │ │ └── DeviceUtils.java │ │ │ ├── web │ │ │ ├── NoADWebViewClent.java │ │ │ ├── AdFilterTool.java │ │ │ ├── JSInterface.java │ │ │ ├── WebPlayActivity.java │ │ │ └── WebViewActivity.java │ │ │ ├── VipCheck.java │ │ │ ├── AppApplication.java │ │ │ ├── Http.java │ │ │ └── AppPrepare.java │ │ ├── cpp │ │ └── com_novip_novip_Native.h │ │ └── AndroidManifest.xml ├── build.gradle ├── CMakeLists.txt └── proguard-rules.pro ├── settings.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .idea ├── caches │ └── build_file_checksums.ser ├── markdown-navigator │ └── profiles_settings.xml ├── vcs.xml ├── runConfigurations.xml ├── gradle.xml ├── codeStyles │ └── Project.xml ├── misc.xml └── markdown-navigator.xml ├── .gitignore ├── gradle.properties ├── gradlew.bat ├── README.md ├── gradlew └── LICENSE /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /app/release/app-release.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JefferyBoy/NoVIP/HEAD/app/release/app-release.apk -------------------------------------------------------------------------------- /app/src/main/res/drawable/vip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JefferyBoy/NoVIP/HEAD/app/src/main/res/drawable/vip.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JefferyBoy/NoVIP/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/java/com/novip/model/VipCode.java: -------------------------------------------------------------------------------- 1 | package com.novip.model; 2 | 3 | 4 | 5 | public class VipCode { 6 | } 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JefferyBoy/NoVIP/HEAD/app/src/main/res/drawable/close.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JefferyBoy/NoVIP/HEAD/app/src/main/res/drawable/play.png -------------------------------------------------------------------------------- /.idea/caches/build_file_checksums.ser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JefferyBoy/NoVIP/HEAD/.idea/caches/build_file_checksums.ser -------------------------------------------------------------------------------- /app/src/main/res/drawable/splash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JefferyBoy/NoVIP/HEAD/app/src/main/res/drawable/splash.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable/download_qrcode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JefferyBoy/NoVIP/HEAD/app/src/main/res/drawable/download_qrcode.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JefferyBoy/NoVIP/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/filled_green_circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JefferyBoy/NoVIP/HEAD/app/src/main/res/drawable/filled_green_circle.png -------------------------------------------------------------------------------- /.idea/markdown-navigator/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JefferyBoy/NoVIP/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/libraries 5 | /.idea/modules.xml 6 | /.idea/workspace.xml 7 | .DS_Store 8 | /build 9 | /captures 10 | .externalNativeBuild 11 | *.jks 12 | -------------------------------------------------------------------------------- /app/release/output.json: -------------------------------------------------------------------------------- 1 | [{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":8,"versionName":"1.7","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}] -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_setting.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Sep 19 16:25:08 CST 2018 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-4.4-all.zip 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | #7d7d7d 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/java/com/novip/view/VParserDialog.java: -------------------------------------------------------------------------------- 1 | package com.novip.view; 2 | 3 | import android.app.Dialog; 4 | import android.content.Context; 5 | import android.support.annotation.NonNull; 6 | 7 | public class VParserDialog extends Dialog { 8 | 9 | public VParserDialog(@NonNull Context context) { 10 | super(context); 11 | setCancelable(true); 12 | 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/button_textview.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/java/com/novip/app/VipChannel.java: -------------------------------------------------------------------------------- 1 | package com.novip.app; 2 | 3 | import android.content.Context; 4 | 5 | import com.novip.AppApplication; 6 | import com.novip.R; 7 | 8 | public class VipChannel { 9 | 10 | public static String getVipChannel(Context context,int channel_id){ 11 | 12 | // return context.getResources().getStringArray(R.array.decode_channel_url)[channel_id]; 13 | return AppApplication.getInstance().getvParsers().get(channel_id).getUrl(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /app/src/main/res/values/adurls.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | t.2d-c.cn 6 | t.yunsoka.com 7 | 8 | 1d1a.com 9 | 52fanyin.com 10 | 11 | 12 | e.gsycdb.com 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/java/com/novip/app/BaseActivity.java: -------------------------------------------------------------------------------- 1 | package com.novip.app; 2 | 3 | import android.support.v7.app.AppCompatActivity; 4 | 5 | import com.umeng.analytics.MobclickAgent; 6 | 7 | public class BaseActivity extends AppCompatActivity { 8 | 9 | @Override 10 | protected void onResume() { 11 | super.onResume(); 12 | MobclickAgent.onResume(this); 13 | } 14 | 15 | @Override 16 | protected void onPause() { 17 | super.onPause(); 18 | MobclickAgent.onPause(this); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/src/main/java/com/novip/model/AdUrl.java: -------------------------------------------------------------------------------- 1 | package com.novip.model; 2 | 3 | public class AdUrl { 4 | 5 | private String url; 6 | private String description; 7 | 8 | public String getUrl() { 9 | return url; 10 | } 11 | 12 | public void setUrl(String url) { 13 | this.url = url; 14 | } 15 | 16 | public String getDescription() { 17 | return description; 18 | } 19 | 20 | public void setDescription(String description) { 21 | this.description = description; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /app/src/main/java/com/novip/utils/LogUtils.java: -------------------------------------------------------------------------------- 1 | package com.novip.utils; 2 | 3 | import android.util.Log; 4 | 5 | import com.novip.AppApplication; 6 | 7 | public class LogUtils { 8 | 9 | public static final String TAG = "com.novip"; 10 | 11 | 12 | public static void D(String str){ 13 | if(AppApplication.DEBUG){ 14 | Log.d(TAG,str); 15 | } 16 | } 17 | 18 | public static void D(String tag,String str){ 19 | if(AppApplication.DEBUG){ 20 | Log.d(tag,str); 21 | } 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/res/layout/vip_code_dialog.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | NoVIP 3 | 4 | 5 | Hello blank fragment 6 | 7 | 优酷视频 8 | 爱奇艺 9 | 搜狐视频 10 | 芒果TV 11 | 腾讯视频 12 | 乐视视频 13 | Sign in 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/cpp/com_novip_novip_Native.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | #include 3 | /* Header for class com_novip_novip_Native */ 4 | 5 | #ifndef _Included_com_novip_novip_Native 6 | #define _Included_com_novip_novip_Native 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | /* 11 | * Class: com_novip_novip_Native 12 | * Method: verifyVip 13 | * Signature: (Ljava/lang/String;)Z 14 | */ 15 | JNIEXPORT jboolean JNICALL Java_com_novip_novip_Native_verifyVip 16 | (JNIEnv *, jobject, jstring); 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | #endif 22 | -------------------------------------------------------------------------------- /app/src/main/res/layout/vparser_dialog.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 13 | 14 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_player.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | -------------------------------------------------------------------------------- /app/src/main/java/com/novip/model/BaseResponse.java: -------------------------------------------------------------------------------- 1 | package com.novip.model; 2 | 3 | public class BaseResponse { 4 | 5 | private boolean success = true; 6 | private String note = "success"; 7 | 8 | public BaseResponse() { 9 | 10 | } 11 | public BaseResponse(boolean success,String note) { 12 | this.success = success; 13 | this.note = note; 14 | } 15 | 16 | public boolean isSuccess() { 17 | return success; 18 | } 19 | public void setSuccess(boolean success) { 20 | this.success = success; 21 | } 22 | public String getNote() { 23 | return note; 24 | } 25 | public void setNote(String note) { 26 | this.note = note; 27 | } 28 | 29 | 30 | } 31 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | -------------------------------------------------------------------------------- /app/src/main/java/com/novip/app/OnFragmentInteractionListener.java: -------------------------------------------------------------------------------- 1 | package com.novip.app; 2 | 3 | import android.net.Uri; 4 | 5 | /** 6 | * This interface must be implemented by activities that contain this 7 | * fragment to allow an interaction in this fragment to be communicated 8 | * to the activity and potentially other fragments contained in that 9 | * activity. 10 | *

11 | * See the Android Training lesson Communicating with Other Fragments for more information. 14 | */ 15 | public interface OnFragmentInteractionListener { 16 | // TODO: Cloud argument type and name 17 | void onFragmentInteraction(Uri uri); 18 | } -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx1536m 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | -------------------------------------------------------------------------------- /app/src/main/java/com/novip/web/NoADWebViewClent.java: -------------------------------------------------------------------------------- 1 | package com.novip.web; 2 | 3 | import android.support.annotation.Nullable; 4 | import android.webkit.WebResourceRequest; 5 | import android.webkit.WebResourceResponse; 6 | import android.webkit.WebView; 7 | import android.webkit.WebViewClient; 8 | 9 | public class NoADWebViewClent extends WebViewClient{ 10 | @Nullable 11 | @Override 12 | public WebResourceResponse shouldInterceptRequest(WebView view, WebResourceRequest request) { 13 | //判断是否是广告相关的资源链接 14 | if (!AdFilterTool.isAd(view.getContext(), request.getUrl().toString())) { 15 | //这里是不做处理的数据 16 | return super.shouldInterceptRequest(view, request); 17 | } else { 18 | //有广告的请求数据,我们直接返回空数据,注:不能直接返回null 19 | return new WebResourceResponse(null, null, null); 20 | } 21 | 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_web_play.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 15 | 21 | -------------------------------------------------------------------------------- /app/src/main/java/com/novip/model/Ad.java: -------------------------------------------------------------------------------- 1 | package com.novip.model; 2 | 3 | public class Ad { 4 | private int id; 5 | private String picture_url; 6 | private String action_url; 7 | private String name; 8 | 9 | public int getId() { 10 | return id; 11 | } 12 | 13 | public void setId(int id) { 14 | this.id = id; 15 | } 16 | 17 | public String getPicture_url() { 18 | return picture_url; 19 | } 20 | 21 | public void setPicture_url(String picture_url) { 22 | this.picture_url = picture_url; 23 | } 24 | 25 | public String getAction_url() { 26 | return action_url; 27 | } 28 | 29 | public void setAction_url(String action_url) { 30 | this.action_url = action_url; 31 | } 32 | 33 | public String getName() { 34 | return name; 35 | } 36 | 37 | public void setName(String name) { 38 | this.name = name; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/java/com/novip/model/User.java: -------------------------------------------------------------------------------- 1 | package com.novip.model; 2 | 3 | import java.util.Date; 4 | 5 | public class User{ 6 | 7 | private String phone; 8 | private String password; 9 | private Date vip_end; 10 | private int id; 11 | 12 | public String getPhone() { 13 | return phone; 14 | } 15 | 16 | public void setPhone(String phone) { 17 | this.phone = phone; 18 | } 19 | 20 | public String getPassword() { 21 | return password; 22 | } 23 | 24 | public void setPassword(String password) { 25 | this.password = password; 26 | } 27 | 28 | public Date getVip_end() { 29 | return vip_end; 30 | } 31 | 32 | public void setVip_end(Date vip_end) { 33 | this.vip_end = vip_end; 34 | } 35 | 36 | public int getId() { 37 | return id; 38 | } 39 | 40 | public void setId(int id) { 41 | this.id = id; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_start.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 14 | 23 | -------------------------------------------------------------------------------- /app/src/main/java/com/novip/model/Platform.java: -------------------------------------------------------------------------------- 1 | package com.novip.model; 2 | 3 | import java.util.List; 4 | 5 | public class Platform { 6 | 7 | private int id; 8 | private String picture_url; 9 | private String action_url; 10 | private String name; 11 | 12 | public int getId() { 13 | return id; 14 | } 15 | 16 | public void setId(int id) { 17 | this.id = id; 18 | } 19 | 20 | public String getPicture_url() { 21 | return picture_url; 22 | } 23 | 24 | public void setPicture_url(String picture_url) { 25 | this.picture_url = picture_url; 26 | } 27 | 28 | public String getAction_url() { 29 | return action_url; 30 | } 31 | 32 | public void setAction_url(String action_url) { 33 | this.action_url = action_url; 34 | } 35 | 36 | public String getName() { 37 | return name; 38 | } 39 | 40 | public void setName(String name) { 41 | this.name = name; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /app/src/main/java/com/novip/model/Version.java: -------------------------------------------------------------------------------- 1 | package com.novip.model; 2 | 3 | 4 | import org.jsoup.helper.StringUtil; 5 | 6 | public class Version { 7 | private int version_code; 8 | private String version_name; 9 | private String note; 10 | private String url; 11 | 12 | public String getUrl() { 13 | return url; 14 | } 15 | 16 | public void setUrl(String url) { 17 | this.url = url; 18 | } 19 | 20 | public int getVersion_code() { 21 | return version_code; 22 | } 23 | 24 | public void setVersion_code(int version_code) { 25 | this.version_code = version_code; 26 | } 27 | 28 | public String getVersion_name() { 29 | return version_name; 30 | } 31 | 32 | public void setVersion_name(String version_name) { 33 | this.version_name = version_name; 34 | } 35 | 36 | public String getNote() { 37 | return note; 38 | } 39 | 40 | public void setNote(String note) { 41 | this.note = note; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /app/src/main/java/com/novip/web/AdFilterTool.java: -------------------------------------------------------------------------------- 1 | package com.novip.web; 2 | 3 | import android.content.Context; 4 | import android.content.res.Resources; 5 | 6 | import com.alibaba.fastjson.JSON; 7 | import com.novip.AppApplication; 8 | import com.novip.Http; 9 | import com.novip.R; 10 | import com.novip.model.AdUrl; 11 | import com.novip.model.Platform; 12 | 13 | import java.io.IOException; 14 | import java.util.List; 15 | 16 | import okhttp3.Call; 17 | import okhttp3.Callback; 18 | import okhttp3.Response; 19 | 20 | /* 21 | * 广告过滤规则,参考360过滤:http://rules.wd.360.cn/ 22 | * */ 23 | public class AdFilterTool { 24 | 25 | public static boolean isAd(Context context, String url) { 26 | if(AppApplication.getInstance().getFilterUrls() != null && AppApplication.getInstance().getFilterUrls().length>0){ 27 | for (String adUrl : AppApplication.getInstance().getFilterUrls() ) { 28 | if (url.contains(adUrl)) { 29 | return true; 30 | } 31 | } 32 | } 33 | return false; 34 | } 35 | } -------------------------------------------------------------------------------- /app/src/main/java/com/novip/app/BannerADImageLoader.java: -------------------------------------------------------------------------------- 1 | package com.novip.app; 2 | 3 | import android.content.Context; 4 | import android.widget.ImageView; 5 | 6 | import com.bumptech.glide.Glide; 7 | import com.youth.banner.loader.ImageLoader; 8 | 9 | public class BannerADImageLoader extends ImageLoader { 10 | @Override 11 | public void displayImage(Context context, Object path, ImageView imageView) { 12 | /** 13 | 注意: 14 | 1.图片加载器由自己选择,这里不限制,只是提供几种使用方法 15 | 2.返回的图片路径为Object类型,由于不能确定你到底使用的那种图片加载器, 16 | 传输的到的是什么格式,那么这种就使用Object接收和返回,你只需要强转成你传输的类型就行, 17 | 切记不要胡乱强转! 18 | */ 19 | //Glide 加载图片简单用法 20 | Glide.with(context).load(path).into(imageView); 21 | } 22 | 23 | //提供createImageView 方法,如果不用可以不重写这个方法,主要是方便自定义ImageView的创建 24 | @Override 25 | public ImageView createImageView(Context context) { 26 | //使用fresco,需要创建它提供的ImageView,当然你也可以用自己自定义的具有图片加载功能的ImageView 27 | ImageView simpleDraweeView=new ImageView(context); 28 | return simpleDraweeView; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/src/main/res/layout/icon_text_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 17 | 26 | -------------------------------------------------------------------------------- /app/src/main/java/com/novip/utils/PlatformUtil.java: -------------------------------------------------------------------------------- 1 | package com.novip.utils; 2 | 3 | import android.content.Context; 4 | import android.content.pm.PackageInfo; 5 | import android.content.pm.PackageManager; 6 | 7 | import java.util.List; 8 | 9 | public class PlatformUtil { 10 | public static final String PACKAGE_WECHAT = "com.tencent.mm"; 11 | public static final String PACKAGE_MOBILE_QQ = "com.tencent.mobileqq"; 12 | public static final String PACKAGE_QZONE = "com.qzone"; 13 | public static final String PACKAGE_SINA = "com.sina.weibo"; 14 | 15 | // 判断是否安装指定app 16 | public static boolean isInstallApp(Context context, String app_package){ 17 | final PackageManager packageManager = context.getPackageManager(); 18 | List pInfo = packageManager.getInstalledPackages(0); 19 | if (pInfo != null) { 20 | for (int i = 0; i < pInfo.size(); i++) { 21 | String pn = pInfo.get(i).packageName; 22 | if (app_package.equals(pn)) { 23 | return true; 24 | } 25 | } 26 | } 27 | return false; 28 | } 29 | } -------------------------------------------------------------------------------- /app/src/main/java/com/novip/model/Novip.java: -------------------------------------------------------------------------------- 1 | package com.novip.model; 2 | 3 | public class Novip { 4 | 5 | private String host; 6 | private int port; 7 | private String admin_qq; 8 | private String qq_group; 9 | private String buy_url; 10 | 11 | public String getHost() { 12 | return host; 13 | } 14 | 15 | public void setHost(String host) { 16 | this.host = host; 17 | } 18 | 19 | public int getPort() { 20 | return port; 21 | } 22 | 23 | public void setPort(int port) { 24 | this.port = port; 25 | } 26 | 27 | public String getAdmin_qq() { 28 | return admin_qq; 29 | } 30 | 31 | public void setAdmin_qq(String admin_qq) { 32 | this.admin_qq = admin_qq; 33 | } 34 | 35 | public String getQq_group() { 36 | return qq_group; 37 | } 38 | 39 | public void setQq_group(String qq_group) { 40 | this.qq_group = qq_group; 41 | } 42 | 43 | public String getBuy_url() { 44 | return buy_url; 45 | } 46 | 47 | public void setBuy_url(String buy_url) { 48 | this.buy_url = buy_url; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 18 | 22 | 28 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /app/src/main/res/layout/setting_item_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 17 | 25 | 34 | -------------------------------------------------------------------------------- /app/src/main/java/com/novip/model/VParser.java: -------------------------------------------------------------------------------- 1 | package com.novip.model; 2 | 3 | 4 | import java.util.Date; 5 | import java.util.List; 6 | 7 | public class VParser { 8 | private String name; 9 | private String nick_name; 10 | private String url; 11 | private String note; 12 | private Date date; 13 | private String platform_ids; 14 | 15 | public String getNick_name() { 16 | return nick_name; 17 | } 18 | 19 | public void setNick_name(String nick_name) { 20 | this.nick_name = nick_name; 21 | } 22 | 23 | public String getName() { 24 | return name; 25 | } 26 | 27 | public void setName(String name) { 28 | this.name = name; 29 | } 30 | 31 | public String getUrl() { 32 | return url; 33 | } 34 | 35 | public void setUrl(String url) { 36 | this.url = url; 37 | } 38 | 39 | public String getNote() { 40 | return note; 41 | } 42 | 43 | public void setNote(String note) { 44 | this.note = note; 45 | } 46 | 47 | public Date getDate() { 48 | return date; 49 | } 50 | 51 | public void setDate(Date date) { 52 | this.date = date; 53 | } 54 | 55 | public String getPlatform_ids() { 56 | return platform_ids; 57 | } 58 | 59 | public void setPlatform_ids(String platform_ids) { 60 | this.platform_ids = platform_ids; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /app/src/main/java/com/novip/view/SettingItemView.java: -------------------------------------------------------------------------------- 1 | package com.novip.view; 2 | 3 | import android.content.Context; 4 | import android.support.annotation.NonNull; 5 | import android.support.annotation.Nullable; 6 | import android.util.AttributeSet; 7 | import android.view.LayoutInflater; 8 | import android.view.View; 9 | import android.widget.FrameLayout; 10 | import android.widget.TextView; 11 | 12 | import com.novip.R; 13 | 14 | public class SettingItemView extends FrameLayout { 15 | 16 | private TextView title,sub; 17 | 18 | 19 | public SettingItemView(@NonNull Context context) { 20 | this(context,null); 21 | } 22 | 23 | public SettingItemView(@NonNull Context context, @Nullable AttributeSet attrs) { 24 | this(context, attrs,0); 25 | } 26 | 27 | public SettingItemView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) { 28 | this(context, attrs, defStyleAttr,0); 29 | } 30 | 31 | public SettingItemView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes) { 32 | super(context, attrs, defStyleAttr, defStyleRes); 33 | View view = LayoutInflater.from(context).inflate(R.layout.setting_item_view,this,false); 34 | title = view.findViewById(R.id.title); 35 | sub = view.findViewById(R.id.sub); 36 | addView(view); 37 | } 38 | 39 | public void setText(CharSequence title,CharSequence sub){ 40 | this.title.setText(title); 41 | this.sub.setText(sub); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 28 5 | defaultConfig { 6 | applicationId "com.novip" 7 | minSdkVersion 21 8 | targetSdkVersion 28 9 | versionCode 8 10 | versionName "1.7" 11 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 12 | } 13 | buildTypes { 14 | release { 15 | minifyEnabled false 16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 17 | } 18 | } 19 | } 20 | 21 | dependencies { 22 | implementation fileTree(include: ['*.jar'], dir: 'libs') 23 | implementation 'com.android.support:appcompat-v7:28.0.0-rc02' 24 | implementation 'com.android.support.constraint:constraint-layout:1.1.3' 25 | implementation 'com.android.support:design:28.0.0' 26 | testImplementation 'junit:junit:4.12' 27 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 28 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 29 | implementation 'com.android.support:support-v4:28.0.0-rc02' 30 | implementation 'com.github.bumptech.glide:glide:4.8.0' 31 | implementation 'com.squareup.okhttp3:okhttp:3.11.0' 32 | implementation 'com.alibaba:fastjson:1.2.49' 33 | implementation 'com.youth.banner:banner:1.4.10' 34 | //implementation 'cn.jzvd:jiaozivideoplayer:6.3.1' 35 | implementation 'org.jsoup:jsoup:1.11.3' 36 | 37 | implementation 'com.umeng.sdk:common:1.5.0' 38 | implementation 'com.umeng.sdk:analytics:7.5.0' 39 | } 40 | -------------------------------------------------------------------------------- /app/src/main/java/com/novip/utils/DensityUtils.java: -------------------------------------------------------------------------------- 1 | package com.novip.utils; 2 | 3 | import android.content.Context; 4 | import android.util.TypedValue; 5 | 6 | /** 7 | * 常用单位转换的辅助类 8 | */ 9 | public class DensityUtils { 10 | private DensityUtils() { 11 | /* cannot be instantiated */ 12 | throw new UnsupportedOperationException("cannot be instantiated"); 13 | } 14 | 15 | /** 16 | * dp转px 17 | * 18 | * @param context 19 | * @return 20 | */ 21 | public static int dp2px(Context context, float dpVal) { 22 | return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 23 | dpVal, context.getResources().getDisplayMetrics()); 24 | } 25 | 26 | /** 27 | * sp转px 28 | * 29 | * @param context 30 | * @return 31 | */ 32 | public static int sp2px(Context context, float spVal) { 33 | return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, 34 | spVal, context.getResources().getDisplayMetrics()); 35 | } 36 | 37 | /** 38 | * px转dp 39 | * 40 | * @param context 41 | * @param pxVal 42 | * @return 43 | */ 44 | public static float px2dp(Context context, float pxVal) { 45 | final float scale = context.getResources().getDisplayMetrics().density; 46 | return (pxVal / scale); 47 | } 48 | 49 | /** 50 | * px转sp 51 | * 52 | * @param pxVal 53 | * @return 54 | */ 55 | public static float px2sp(Context context, float pxVal) { 56 | return (pxVal / context.getResources().getDisplayMetrics().scaledDensity); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /app/src/main/java/com/novip/web/JSInterface.java: -------------------------------------------------------------------------------- 1 | package com.novip.web; 2 | 3 | import android.util.Log; 4 | import android.webkit.JavascriptInterface; 5 | 6 | import com.novip.utils.FileUtils; 7 | 8 | import org.jsoup.Jsoup; 9 | import org.jsoup.nodes.DataNode; 10 | import org.jsoup.nodes.Element; 11 | import org.jsoup.select.Elements; 12 | 13 | public class JSInterface { 14 | 15 | @JavascriptInterface 16 | public void showSource(String html) { 17 | Log.d("HTML", html); 18 | Element body = Jsoup.parse(html).body(); 19 | Elements elements = body.getElementsByAttribute("src"); 20 | for(Element e: elements){ 21 | if(e.tagName().equals("video")){ 22 | for(DataNode node : e.dataNodes()){ 23 | if(node.nodeName().equals("src")){ 24 | 25 | Log.d("JSInterface",node.getWholeData()); 26 | } 27 | } 28 | } 29 | Log.d("JSInterface",e.toString()); 30 | } 31 | /*Elements elements = body.getElementsByTag("body"); 32 | if(elements != null && !elements.isEmpty()){ 33 | elements = elements.get(0).getElementsByTag("video"); 34 | if(elements != null && !elements.isEmpty()){ 35 | Log.d("JSInterface",elements.get(0).toString()); 36 | elements = elements.get(0).getElementsByAttribute("src"); 37 | if(elements != null && !elements.isEmpty()){ 38 | Log.d("JSInterface",elements.get(0).toString()); 39 | } 40 | } 41 | }else { 42 | Log.d("JSInterface","没有Video"); 43 | }*/ 44 | FileUtils.saveFile("video.html",html); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 15 | 16 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /app/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 线路1 6 | 线路2 7 | 线路3 8 | 线路4 9 | 线路5 10 | 线路6 11 | 线路7 12 | 线路8 13 | 线路9 14 | 线路10 15 | 线路11 16 | 线路13 17 | 线路14 18 | 线路15 19 | 线路16 20 | 线路17 21 | 线路18 22 | 线路19 23 | 24 | 25 | 26 | http://jx.618g.com/?url= 27 | http://api.baiyug.vip/index.php?url= 28 | http://www.wocao.xyz/index.php?url= 29 | https://vip.hackmg.com/jx/index.php?url= 30 | http://www.lan8888.cn/jx.php?url= 31 | http://jiexi.92fz.cn/player/vip.php?url= 32 | http://api.xcq91.top/?url= 33 | http://aikan-tv.com/?url= 34 | http://jx.jfysz.cn/jx.php/?url= 35 | http://api.bbbbbb.me/yunjx/?url= 36 | https://jiexi.071811.cc/jx.php?url= 37 | http://yun.baiyug.cn/vip/index.php?url= 38 | http://aikan-tv.com/?url= 39 | http://api.pucms.com/?url= 40 | http://xlyy100.com/xlyy.php?url= 41 | http://www.a305.org/flv.php?url= 42 | http://000o.cc/jx/ty.php?url= 43 | http://www.82190555.com/video.php?url= 44 | http://jx.598110.com/zuida.php?url= 45 | 46 | -------------------------------------------------------------------------------- /app/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # For more information about using CMake with Android Studio, read the 2 | # documentation: https://d.android.com/studio/projects/add-native-code.html 3 | 4 | # Sets the minimum version of CMake required to build the native library. 5 | 6 | cmake_minimum_required(VERSION 3.4.1) 7 | 8 | # Creates and names a library, sets it as either STATIC 9 | # or SHARED, and provides the relative paths to its source code. 10 | # You can define multiple libraries, and CMake builds them for you. 11 | # Gradle automatically packages shared libraries with your APK. 12 | 13 | add_library( # Sets the name of the library. 14 | native-lib 15 | 16 | # Sets the library as a shared library. 17 | SHARED 18 | 19 | # Provides a relative path to your source file(s). 20 | src/main/cpp/native-lib.cpp ) 21 | 22 | # Searches for a specified prebuilt library and stores the path as a 23 | # variable. Because CMake includes system libraries in the search path by 24 | # default, you only need to specify the name of the public NDK library 25 | # you want to add. CMake verifies that the library exists before 26 | # completing its build. 27 | 28 | find_library( # Sets the name of the path variable. 29 | log-lib 30 | 31 | # Specifies the name of the NDK library that 32 | # you want CMake to locate. 33 | log ) 34 | 35 | # Specifies libraries CMake should link to your target library. You 36 | # can link multiple libraries, such as libraries you define in this 37 | # build script, prebuilt third-party libraries, or system libraries. 38 | 39 | target_link_libraries( # Specifies the target library. 40 | native-lib 41 | 42 | # Links the target library to the log library 43 | # included in the NDK. 44 | ${log-lib} ) -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 31 | 32 | 33 | 34 | 35 | 36 | 38 | -------------------------------------------------------------------------------- /app/src/main/java/com/novip/utils/SharedPrefernceUtils.java: -------------------------------------------------------------------------------- 1 | package com.novip.utils; 2 | 3 | import android.content.Context; 4 | import android.content.SharedPreferences; 5 | 6 | public class SharedPrefernceUtils { 7 | 8 | private static SharedPrefernceUtils sp; 9 | 10 | private static SharedPreferences sharedPreferences; 11 | 12 | public static final String KEY_CHANNEL = "channel"; 13 | 14 | public static final String TEST = "test"; 15 | 16 | public static final String VIP_CODE = "VIP_CODE"; 17 | 18 | public static final String PHONE = "phone"; 19 | public static final String PS = "ps"; 20 | 21 | private SharedPrefernceUtils(){} 22 | 23 | public static SharedPrefernceUtils getInstance(Context context){ 24 | if(sp == null){ 25 | sp = new SharedPrefernceUtils(); 26 | sharedPreferences = context.getSharedPreferences("novip",Context.MODE_PRIVATE); 27 | } 28 | return sp; 29 | } 30 | 31 | public void putInt(String key,int value){ 32 | SharedPreferences.Editor editor = sharedPreferences.edit(); 33 | editor.putInt(key,value); 34 | editor.commit(); 35 | } 36 | 37 | public int getInt(String key){ 38 | return sharedPreferences.getInt(key,0); 39 | } 40 | 41 | public void putBoolean(String key,boolean value){ 42 | SharedPreferences.Editor editor = sharedPreferences.edit(); 43 | editor.putBoolean(key,value); 44 | editor.commit(); 45 | } 46 | 47 | public boolean getBoolean(String key){ 48 | return sharedPreferences.getBoolean(key,false); 49 | } 50 | 51 | public void putString(String key,String value){ 52 | SharedPreferences.Editor editor = sharedPreferences.edit(); 53 | editor.putString(key,value); 54 | editor.commit(); 55 | } 56 | 57 | public String getString(String key){ 58 | return sharedPreferences.getString(key,""); 59 | } 60 | 61 | public void putLong(String key,long value){ 62 | SharedPreferences.Editor editor = sharedPreferences.edit(); 63 | editor.putLong(key,value); 64 | editor.commit(); 65 | } 66 | 67 | public long getLong(String key){ 68 | return sharedPreferences.getLong(key,0l); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /app/src/main/java/com/novip/app/RegisteActivity.java: -------------------------------------------------------------------------------- 1 | package com.novip.app; 2 | 3 | import android.content.Intent; 4 | import android.support.v7.app.AppCompatActivity; 5 | import android.os.Bundle; 6 | import android.util.Log; 7 | import android.view.View; 8 | import android.widget.Button; 9 | import android.widget.EditText; 10 | import android.widget.Toast; 11 | 12 | import com.novip.Http; 13 | import com.novip.R; 14 | import com.novip.utils.DeviceUtils; 15 | 16 | import java.io.IOException; 17 | 18 | import okhttp3.Call; 19 | import okhttp3.Callback; 20 | import okhttp3.Response; 21 | 22 | public class RegisteActivity extends BaseActivity implements View.OnClickListener { 23 | 24 | private EditText phone,password; 25 | 26 | @Override 27 | protected void onCreate(Bundle savedInstanceState) { 28 | super.onCreate(savedInstanceState); 29 | setContentView(R.layout.activity_registe); 30 | phone = findViewById(R.id.email); 31 | password = findViewById(R.id.password); 32 | findViewById(R.id.email_sign_in_button).setOnClickListener(this); 33 | } 34 | 35 | @Override 36 | public void onClick(View v) { 37 | String ph = phone.getText().toString().trim(); 38 | String pass = password.getText().toString().trim(); 39 | if(ph.length() != 11){ 40 | Toast.makeText(this,"手机号格式不对",Toast.LENGTH_SHORT).show(); 41 | return; 42 | } 43 | if(pass.length() < 4){ 44 | Toast.makeText(this,"密码长度要大于4",Toast.LENGTH_SHORT).show(); 45 | return; 46 | } 47 | 48 | Http.registe(ph, pass,DeviceUtils.getUniqueId(this), new Callback() { 49 | @Override 50 | public void onFailure(Call call, IOException e) { 51 | 52 | } 53 | 54 | @Override 55 | public void onResponse(Call call, final Response response) throws IOException { 56 | runOnUiThread(new Runnable() { 57 | @Override 58 | public void run() { 59 | if(response.code() == 200){ 60 | Toast.makeText(RegisteActivity.this,"注册成功",Toast.LENGTH_SHORT).show(); 61 | startActivity(new Intent(RegisteActivity.this, LoginActivity.class)); 62 | finish(); 63 | } 64 | } 65 | }); 66 | 67 | } 68 | }); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 26 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 38 | 39 | 43 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /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 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 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 Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /app/src/main/java/com/novip/app/ChangePasswordActivity.java: -------------------------------------------------------------------------------- 1 | package com.novip.app; 2 | 3 | import android.content.Intent; 4 | import android.support.v7.app.AppCompatActivity; 5 | import android.os.Bundle; 6 | import android.view.View; 7 | import android.widget.EditText; 8 | import android.widget.Toast; 9 | 10 | import com.novip.Http; 11 | import com.novip.R; 12 | 13 | import org.jsoup.helper.StringUtil; 14 | 15 | import java.io.IOException; 16 | 17 | import okhttp3.Call; 18 | import okhttp3.Callback; 19 | import okhttp3.Response; 20 | 21 | public class ChangePasswordActivity extends AppCompatActivity implements View.OnClickListener { 22 | 23 | private EditText phone,password,new_password; 24 | @Override 25 | protected void onCreate(Bundle savedInstanceState) { 26 | super.onCreate(savedInstanceState); 27 | setContentView(R.layout.activity_change_password); 28 | phone = findViewById(R.id.email); 29 | password = findViewById(R.id.password); 30 | new_password = findViewById(R.id.new_password); 31 | findViewById(R.id.email_sign_in_button).setOnClickListener(this); 32 | } 33 | 34 | @Override 35 | public void onClick(View v) { 36 | String phone_s = phone.getText().toString().trim(); 37 | String password_s = password.getText().toString().trim(); 38 | String newPassword_s = new_password.getText().toString().trim(); 39 | if(StringUtil.isBlank(phone_s) || StringUtil.isBlank(password_s)||StringUtil.isBlank(newPassword_s)){ 40 | Toast.makeText(this,"输入内容不能为空",Toast.LENGTH_SHORT).show(); 41 | }else { 42 | Http.changePassword(phone_s, password_s, newPassword_s, new Callback() { 43 | @Override 44 | public void onFailure(Call call, IOException e) { 45 | 46 | } 47 | 48 | @Override 49 | public void onResponse(Call call, Response response) throws IOException { 50 | if(response.code() == 200){ 51 | runOnUiThread(new Runnable() { 52 | @Override 53 | public void run() { 54 | Toast.makeText(ChangePasswordActivity.this,"成功",Toast.LENGTH_SHORT).show(); 55 | startActivity(new Intent(ChangePasswordActivity.this,LoginActivity.class)); 56 | finish(); 57 | } 58 | }); 59 | } 60 | } 61 | }); 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /app/src/main/java/com/novip/VipCheck.java: -------------------------------------------------------------------------------- 1 | package com.novip; 2 | 3 | import android.content.Context; 4 | 5 | import com.novip.utils.SharedPrefernceUtils; 6 | 7 | public class VipCheck { 8 | 9 | public static long getVipEnd(Context context){ 10 | long v = SharedPrefernceUtils.getInstance(context).getLong("v_end"); 11 | if(v == 0){ 12 | long d = System.currentTimeMillis()+24*60*60*1000l; 13 | SharedPrefernceUtils.getInstance(context).putLong("v_end",d); 14 | return d; 15 | }else { 16 | return v; 17 | } 18 | } 19 | 20 | public static void addVipEnd(Context context,int days){ 21 | long d = System.currentTimeMillis()+days*24*60*60*1000l; 22 | SharedPrefernceUtils.getInstance(context).putLong("v_end",d); 23 | } 24 | 25 | //14个字符长度,13个是时间戳,还有一个是VIP时间(1一周,2一个月,3永久) 26 | public static String encode(String str) { 27 | char[] data = str.toCharArray(); 28 | int len = data.length; 29 | for(int i=0;i out_t){ 52 | //过期了 53 | state = false; 54 | }else { 55 | switch (p){ 56 | case 1: 57 | addVipEnd(context,7); 58 | state = true; 59 | break; 60 | case 2: 61 | addVipEnd(context,30); 62 | state = true; 63 | break; 64 | case 3: 65 | addVipEnd(context,9999); 66 | state = true; 67 | break; 68 | } 69 | } 70 | 71 | }catch (Exception e){ 72 | return false; 73 | } 74 | 75 | return state; 76 | } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /app/src/main/java/com/novip/view/IconTextView.java: -------------------------------------------------------------------------------- 1 | package com.novip.view; 2 | 3 | import android.content.Context; 4 | import android.support.annotation.DrawableRes; 5 | import android.support.annotation.NonNull; 6 | import android.support.annotation.Nullable; 7 | import android.support.annotation.StringRes; 8 | import android.util.AttributeSet; 9 | import android.view.LayoutInflater; 10 | import android.view.View; 11 | import android.widget.FrameLayout; 12 | import android.widget.ImageView; 13 | import android.widget.TextView; 14 | 15 | import com.bumptech.glide.Glide; 16 | import com.bumptech.glide.load.engine.DiskCacheStrategy; 17 | import com.bumptech.glide.request.RequestOptions; 18 | import com.novip.R; 19 | 20 | public class IconTextView extends FrameLayout { 21 | 22 | private ImageView imageView; 23 | private TextView textView; 24 | public IconTextView(@NonNull Context context) { 25 | this(context,null); 26 | } 27 | 28 | public IconTextView(@NonNull Context context, @Nullable AttributeSet attrs) { 29 | this(context, attrs,0); 30 | } 31 | 32 | public IconTextView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) { 33 | this(context, attrs, defStyleAttr,0); 34 | } 35 | 36 | public IconTextView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes) { 37 | super(context, attrs, defStyleAttr, defStyleRes); 38 | View view = LayoutInflater.from(context).inflate(R.layout.icon_text_view,this,false); 39 | imageView = view.findViewById(R.id.image); 40 | textView = view.findViewById(R.id.text); 41 | addView(view); 42 | } 43 | 44 | public void setImage(@DrawableRes int id){ 45 | 46 | RequestOptions mRequestOptions = RequestOptions.circleCropTransform() 47 | .diskCacheStrategy(DiskCacheStrategy.AUTOMATIC)//磁盘缓存 48 | .skipMemoryCache(true); 49 | Glide.with(this).load(id).apply(mRequestOptions).into(imageView); 50 | } 51 | 52 | public void setText(@StringRes int sid){ 53 | textView.setText(sid); 54 | } 55 | 56 | public void setImageText(@DrawableRes int id, @StringRes int sid){ 57 | setImage(id); 58 | setText(sid); 59 | } 60 | 61 | public void setImageText(CharSequence imgUrl,CharSequence text){ 62 | RequestOptions mRequestOptions = RequestOptions.circleCropTransform() 63 | .diskCacheStrategy(DiskCacheStrategy.AUTOMATIC)//磁盘缓存 64 | .skipMemoryCache(true); 65 | Glide.with(this).load(imgUrl).apply(mRequestOptions).into(imageView); 66 | textView.setText(text); 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 38 | 48 | 58 | 59 | 65 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_web_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 15 | 22 | 32 | 33 | 34 | 40 | 49 | 56 | 62 | 63 | 64 | 70 | -------------------------------------------------------------------------------- /app/src/main/java/com/novip/view/VipCodeDialog.java: -------------------------------------------------------------------------------- 1 | package com.novip.view; 2 | 3 | import android.content.Context; 4 | import android.content.DialogInterface; 5 | import android.content.Intent; 6 | import android.support.annotation.NonNull; 7 | import android.support.v7.app.AlertDialog; 8 | import android.view.Gravity; 9 | import android.view.ViewGroup; 10 | import android.widget.EditText; 11 | import android.widget.Toast; 12 | 13 | import com.novip.AppApplication; 14 | import com.novip.Http; 15 | import com.novip.VipCheck; 16 | import com.novip.app.ChangePasswordActivity; 17 | 18 | import java.io.IOException; 19 | 20 | import okhttp3.Call; 21 | import okhttp3.Callback; 22 | import okhttp3.Response; 23 | 24 | public class VipCodeDialog implements Callback { 25 | private AlertDialog dialog; 26 | private VerifyListener listener; 27 | public VipCodeDialog(@NonNull final Context context, final VerifyListener listener) { 28 | final EditText editText = new EditText(context); 29 | this.listener = listener; 30 | editText.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)); 31 | editText.setHint("授权码"); 32 | editText.setGravity(Gravity.CENTER_HORIZONTAL); 33 | editText.setPadding(0,30,0,30); 34 | dialog = new AlertDialog.Builder(context) 35 | .setTitle("输入授权码") 36 | .setView(editText) 37 | .setPositiveButton("确定", new DialogInterface.OnClickListener() { 38 | @Override 39 | public void onClick(DialogInterface dialog, int which) { 40 | if(AppApplication.getInstance().getUser() == null){ 41 | Toast.makeText(context,"请登陆后操作",Toast.LENGTH_SHORT).show(); 42 | }else { 43 | Http.checkCode(AppApplication.getInstance().getUser().getPhone(),editText.getText().toString().trim(),VipCodeDialog.this); 44 | } 45 | } 46 | }) 47 | .setNegativeButton("取消",null) 48 | .create(); 49 | } 50 | 51 | public void show(){ 52 | if(dialog != null){ 53 | dialog.show(); 54 | } 55 | } 56 | 57 | @Override 58 | public void onFailure(Call call, IOException e) { 59 | 60 | if(listener != null){ 61 | listener.verify(false); 62 | } 63 | } 64 | 65 | @Override 66 | public void onResponse(Call call, Response response) throws IOException { 67 | if(response.code() == 200){ 68 | if(listener != null){ 69 | listener.verify(true); 70 | } 71 | }else { 72 | if(listener != null){ 73 | listener.verify(false); 74 | } 75 | } 76 | } 77 | 78 | public interface VerifyListener{ 79 | void verify(boolean b); 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /app/src/main/java/com/novip/app/StartActivity.java: -------------------------------------------------------------------------------- 1 | package com.novip.app; 2 | 3 | import android.app.AlertDialog; 4 | import android.content.DialogInterface; 5 | import android.content.Intent; 6 | import android.net.Uri; 7 | import android.os.Process; 8 | import android.support.v7.app.AppCompatActivity; 9 | import android.os.Bundle; 10 | import android.widget.Toast; 11 | 12 | import com.alibaba.fastjson.JSON; 13 | import com.novip.AppApplication; 14 | import com.novip.AppPrepare; 15 | import com.novip.Http; 16 | import com.novip.R; 17 | import com.novip.model.Novip; 18 | import com.novip.model.Platform; 19 | import com.novip.model.User; 20 | import com.novip.model.VParser; 21 | import com.novip.model.Version; 22 | import com.novip.utils.DeviceUtils; 23 | import com.novip.utils.LogUtils; 24 | import com.novip.utils.SharedPrefernceUtils; 25 | import com.novip.view.CountDownView; 26 | import com.umeng.analytics.MobclickAgent; 27 | 28 | import org.jsoup.Connection; 29 | import org.jsoup.Jsoup; 30 | import org.jsoup.helper.StringUtil; 31 | 32 | import java.io.IOException; 33 | import java.util.List; 34 | 35 | import okhttp3.Call; 36 | import okhttp3.Callback; 37 | import okhttp3.Response; 38 | 39 | /* 40 | * APP准备工作: 41 | * 1.获取主机IP,端口等基本信息 42 | * 2.检查更新(有更新时强制更新,无更新时到第3步) 43 | * 3.登陆(成功到4,失败到登陆界面) 44 | * 4.获取APP中需要使用到的数据(平台信息、解析线路等) 45 | * 46 | * */ 47 | public class StartActivity extends AppCompatActivity implements CountDownView.OnCountDownFinishListener, AppPrepare.AppPrepareCallback { 48 | 49 | private CountDownView countDownView; 50 | private boolean appPrepared = false; 51 | private boolean countDownFinished =false; 52 | @Override 53 | protected void onCreate(Bundle savedInstanceState) { 54 | super.onCreate(savedInstanceState); 55 | setContentView(R.layout.activity_start); 56 | countDownView = findViewById(R.id.cdv); 57 | countDownView.setAddCountDownListener(this); 58 | countDownView.startCountDown(); 59 | } 60 | 61 | private void toast(){ 62 | runOnUiThread(new Runnable() { 63 | @Override 64 | public void run() { 65 | Toast.makeText(getBaseContext(),"无法连接到服务器",Toast.LENGTH_SHORT).show(); 66 | //finish(); 67 | } 68 | }); 69 | 70 | } 71 | @Override 72 | protected void onStart() { 73 | super.onStart(); 74 | new AppPrepare().start(this,this); 75 | } 76 | 77 | @Override 78 | public void countDownFinished() { 79 | countDownFinished = true; 80 | if(appPrepared && countDownFinished){ 81 | startActivity(new Intent(this,MainActivity.class)); 82 | finish(); 83 | } 84 | } 85 | 86 | @Override 87 | public void onPrepared() { 88 | appPrepared = true; 89 | if(appPrepared && countDownFinished){ 90 | startActivity(new Intent(this,MainActivity.class)); 91 | finish(); 92 | } 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /app/src/main/java/com/novip/utils/ShareUtils.java: -------------------------------------------------------------------------------- 1 | package com.novip.utils; 2 | 3 | import android.content.Context; 4 | import android.content.Intent; 5 | import android.net.Uri; 6 | import android.os.Environment; 7 | import android.view.View; 8 | 9 | import java.io.File; 10 | import java.util.ArrayList; 11 | 12 | public class ShareUtils { 13 | /** 14 | * 分享文字内容 15 | * 16 | * @param dlgTitle 17 | * 分享对话框标题 18 | * @param subject 19 | * 主题 20 | * @param content 21 | * 分享内容(文字) 22 | */ 23 | public static void shareText(Context context,String dlgTitle, String subject, String content) { 24 | if (content == null || "".equals(content)) { 25 | return; 26 | } 27 | Intent intent = new Intent(Intent.ACTION_SEND); 28 | intent.setType("text/plain"); 29 | if (subject != null && !"".equals(subject)) { 30 | intent.putExtra(Intent.EXTRA_SUBJECT, subject); 31 | } 32 | 33 | intent.putExtra(Intent.EXTRA_TEXT, content); 34 | 35 | // 设置弹出框标题 36 | if (dlgTitle != null && !"".equals(dlgTitle)) { // 自定义标题 37 | context.startActivity(Intent.createChooser(intent, dlgTitle)); 38 | } else { // 系统默认标题 39 | context.startActivity(intent); 40 | } 41 | } 42 | 43 | /** 44 | * 分享图片和文字内容 45 | * 46 | * @param dlgTitle 47 | * 分享对话框标题 48 | * @param subject 49 | * 主题 50 | * @param content 51 | * 分享内容(文字) 52 | * @param uri 53 | * 图片资源URI 54 | */ 55 | public static void shareImg(Context context,String dlgTitle, String subject, String content, 56 | Uri uri) { 57 | if (uri == null) { 58 | return; 59 | } 60 | Intent intent = new Intent(Intent.ACTION_SEND); 61 | intent.setType("image/*"); 62 | intent.putExtra(Intent.EXTRA_STREAM, uri); 63 | if (subject != null && !"".equals(subject)) { 64 | intent.putExtra(Intent.EXTRA_SUBJECT, subject); 65 | } 66 | if (content != null && !"".equals(content)) { 67 | intent.putExtra(Intent.EXTRA_TEXT, content); 68 | } 69 | 70 | // 设置弹出框标题 71 | if (dlgTitle != null && !"".equals(dlgTitle)) { // 自定义标题 72 | context.startActivity(Intent.createChooser(intent, dlgTitle)); 73 | } else { // 系统默认标题 74 | context.startActivity(intent); 75 | } 76 | } 77 | 78 | //分享多张图片 79 | public static void shareMultipleImage(Context context,View view) { 80 | ArrayList uriList = new ArrayList<>(); 81 | 82 | String path = Environment.getExternalStorageDirectory() + File.separator; 83 | uriList.add(Uri.fromFile(new File(path+"australia_1.jpg"))); 84 | uriList.add(Uri.fromFile(new File(path+"australia_2.jpg"))); 85 | uriList.add(Uri.fromFile(new File(path+"australia_3.jpg"))); 86 | 87 | Intent shareIntent = new Intent(); 88 | shareIntent.setAction(Intent.ACTION_SEND_MULTIPLE); 89 | shareIntent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uriList); 90 | shareIntent.setType("image/*"); 91 | context.startActivity(Intent.createChooser(shareIntent, "分享到")); 92 | } 93 | 94 | 95 | } 96 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | @[TOC](Android的NoVIP视频解析APP开发完整过程) 2 | 3 | # 开发灵感 4 | 国内现在视频类知名网站主要有:爱奇艺、优酷、腾讯视频、搜狐视频、乐视视频、芒果TV、Bilibili等。这些网站都有各自的付费VIP视频,我虽然很少去看这些视频啦,我主要是看一些新闻类的,这些都是免费的。但是,生活中很多同事、朋友都在追剧,在办公室在学校经常会听到某某有没有XX视频的VIP账号?生活中其实很多人都开通了这些视频网站的VIP。然而,依旧问题严重,因为很多电影&电视剧是版权独家的,只有某个视频站才能观看,那么买的其他站的VIP那不就是无效了吗?当然,对于开发者来说,网上很多浏览器插件可以解决这个问题,比如**Greasy Fork**插件就牛的一逼,各种VIP视频、网盘资源等都不在话下。对于某部分人来说,上班偷偷看看手机不方便看电脑、回家路上看手机,但是手机端并没有这些插件呀。于是,笔者想设计一个APP,让手机端可以方便的查看各种视频,正式这个原因,着手开发了,花了两天时间把APP做出来了,测试能够播放各个站点的VIP视频。下面是APP的源码: 5 | 6 | [Github源代码](https://github.com/JafferLei/NoVIP) 7 | 8 | # 功能需求设计 9 | 1. 解析播放各大站点的VIP视频是核心,对于视频解析来说,整个过程是比较复杂的,笔者查看很多相关资料,各大战点都做了多层的视频链接加密,还做了视频分段处理。笔者也就懒得去做了,直接调用了其他站点的解析地址。 10 | ![实现了6个站点的VIP视频解析](https://img-blog.csdn.net/2018092113095778?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3UwMTIxODQ1Mzk=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70) 11 | 下面是视频解析播放的方法,在进入视频播放也后选择播放线路(部分播放线路可能被和谐了播放不了,可以选择其他的线路),然后点击右下角播放图片按钮会跳转到视频解析播放的页面(笔者就偷懒了,自己不做这部分了,调用的别人现成的)。 12 | ![视频解析播放方式](https://img-blog.csdn.net/20180921131258942?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3UwMTIxODQ1Mzk=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70) 13 | 2. 界面设计优雅整洁,设计APP时间脚本,各种的图片资源都是网上直接找的,界面设计也用了第三方库,可以加快开发过程。下面两个Material Design资源的网站,大家可以去找到各种精美的界面、图标设计等。 14 | [Material Design图标](https://www.flaticon.com/packs/material-design) 15 | [Material Design综合大站](https://www.uplabs.com/posts/c/android/resources) 16 | 3. 为了丰富功能,添加了广告投放和APP授权功能。另外、还有加入QQ群、分析APP等功能。当然,APP是免费给大家用的,授权码只是给开发者有兴趣的去改进而已。授权码:**1234** 17 | ![其他功能](https://img-blog.csdn.net/20180921132318859?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3UwMTIxODQ1Mzk=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70) 18 | 19 | # 代码编写 20 | APP功能需求准备好了,下面就要开始着手编程实现了。 21 | ## 框架搭建 22 | 对于一个APP来说,框架设计占有极其重要的部分,一个APP的编程框架设计好了,以后的开发可以避免很多弯路,也能节省很多的开发时间。很多程序员之所以会是程序猿就是因为在走很多弯路,浪费了大量的时间,导致经常加班加点的工作。在我看来,程序是用来设计的,不是用来干苦力的。在本APP中,为了节省开发周期,很多的工作都没有做,比如网络请求、注解、MVP、MVVM等。只用简单的原生API快速完成功能,代码中的字符串也都是写死的,没有使用xml去配置,在企业的APP是不能这么写的。所以本APP基本是没有框架的,整个APP的代码文件也不超过十个,总代码量不超过2000行,实在是精简的不能再说了。 23 | ## 第三方库引入 24 | 程序中使用部分第三方库,都是行业比较成熟的,经过市场的认证,不用担心出什么问题。下面是gradle中的配置: 25 | 26 | ``` 27 | dependencies { 28 | implementation fileTree(include: ['*.jar'], dir: 'libs') 29 | implementation 'com.android.support:appcompat-v7:28.0.0-rc02' 30 | implementation 'com.android.support.constraint:constraint-layout:1.1.3' 31 | testImplementation 'junit:junit:4.12' 32 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 33 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 34 | implementation 'com.android.support:support-v4:28.0.0-rc02' 35 | implementation 'com.github.bumptech.glide:glide:4.8.0' 36 | implementation 'com.squareup.okhttp3:okhttp:3.11.0' 37 | implementation 'eu.the4thfloor.volley:com.android.volley:2015.05.28' 38 | implementation 'com.alibaba:fastjson:1.2.49' 39 | implementation 'com.youth.banner:banner:1.4.10' 40 | } 41 | ``` 42 | 43 | ## 代码编写 44 | 编程过程就不说了,太简单了,Android开发入门的人都能很清晰的看懂代码。这里说一下,对于授权码部分,调用了一个native层函数,用C++编写的,只是为了说明为了安全,部分重要的数据是需要放到C++中做的,不说了,太简单了。下面是所有代码文件: 45 | ![代码文件](https://img-blog.csdn.net/20180921134044656?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3UwMTIxODQ1Mzk=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70) 46 | 47 | 48 | # 开源与总结 49 | 整个开发过程耗时2天,刚好这周学校的学生军训,笔者一天也就两节课,可以有大量的时间写这个APP。笔者除了现在学校的课程外,还在准备线上课程,时间比较忙,写这个APP花了两天,周末又要加班准备课程内容了。源代码通过git托管到了github上,有兴趣或者想二次开发的朋友可以去下载。 50 | 1. [github源代码](https://github.com/JafferLei/NoVIP) 51 | 2. [APP下载](https://pan.baidu.com/s/1341k5za08_A0OaqHqW_5RA) -------------------------------------------------------------------------------- /app/src/main/java/com/novip/AppApplication.java: -------------------------------------------------------------------------------- 1 | package com.novip; 2 | 3 | import android.app.Application; 4 | import android.util.Log; 5 | 6 | import com.novip.model.Novip; 7 | import com.novip.model.Platform; 8 | import com.novip.model.User; 9 | import com.novip.model.VParser; 10 | import com.novip.model.Version; 11 | import com.novip.utils.DeviceUtils; 12 | import com.novip.utils.LogUtils; 13 | import com.novip.utils.SharedPrefernceUtils; 14 | import com.umeng.commonsdk.UMConfigure; 15 | 16 | import java.lang.reflect.Field; 17 | import java.util.List; 18 | 19 | public class AppApplication extends Application { 20 | public static final boolean DEBUG = false; 21 | private User user; 22 | private List vParsers; 23 | private Version version; 24 | private static AppApplication instance; 25 | private Novip novip; 26 | private List platforms; 27 | private String[] filterUrls; 28 | 29 | @Override 30 | public void onCreate() { 31 | super.onCreate(); 32 | instance = this; 33 | //SP初始化 34 | SharedPrefernceUtils.getInstance(this); 35 | 36 | //设置LOG开关,默认为false 37 | UMConfigure.setLogEnabled(true); 38 | try { 39 | Class aClass = Class.forName("com.umeng.commonsdk.UMConfigure"); 40 | Field[] fs = aClass.getDeclaredFields(); 41 | for (Field f:fs){ 42 | Log.e("xxxxxx","ff="+f.getName()+" "+f.getType().getName()); 43 | } 44 | } catch (ClassNotFoundException e) { 45 | e.printStackTrace(); 46 | } 47 | //初始化组件化基础库, 统计SDK/推送SDK/分享SDK都必须调用此初始化接口 48 | UMConfigure.init(this, "5bc58c00b465f50c1700035e", "常规推广", UMConfigure.DEVICE_TYPE_PHONE, 49 | null); 50 | 51 | } 52 | 53 | public static AppApplication getInstance(){ 54 | return instance; 55 | } 56 | 57 | public User getUser() { 58 | return user; 59 | } 60 | 61 | public void setUser(User user) { 62 | if(user!=null){ 63 | SharedPrefernceUtils.getInstance(getBaseContext()).putString( 64 | SharedPrefernceUtils.PHONE,user.getPhone() 65 | ); 66 | SharedPrefernceUtils.getInstance(getBaseContext()).putString( 67 | SharedPrefernceUtils.PS,user.getPassword() 68 | ); 69 | } 70 | this.user = user; 71 | } 72 | 73 | public List getvParsers() { 74 | return vParsers; 75 | } 76 | 77 | public void setvParsers(List vParsers) { 78 | this.vParsers = vParsers; 79 | } 80 | 81 | public Version getVersion() { 82 | return version; 83 | } 84 | 85 | public void setVersion(Version version) { 86 | this.version = version; 87 | } 88 | 89 | public Novip getNovip() { 90 | return novip; 91 | } 92 | 93 | public void setNovip(Novip novip) { 94 | this.novip = novip; 95 | Http.setHost(novip.getHost()); 96 | Http.setPort(novip.getPort()); 97 | } 98 | 99 | public List getPlatforms() { 100 | return platforms; 101 | } 102 | 103 | public void setPlatforms(List platforms) { 104 | this.platforms = platforms; 105 | } 106 | 107 | public String[] getFilterUrls() { 108 | return filterUrls; 109 | } 110 | 111 | public void setFilterUrls(String[] filterUrls) { 112 | this.filterUrls = filterUrls; 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_registe.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 17 | 18 | 25 | 26 | 35 | 36 | 41 | 42 | 45 | 46 | 54 | 55 | 56 | 57 | 60 | 61 | 72 | 73 | 74 | 75 |