version:1.8.2
date:2021-11-09 10:09:21 fix: add:增加隐私政策和用户协议
This commit is contained in:
@@ -0,0 +1,90 @@
|
||||
package com.info.sn.activity;
|
||||
|
||||
import android.util.Log;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.webkit.WebSettings;
|
||||
import android.webkit.WebView;
|
||||
|
||||
import com.info.sn.R;
|
||||
import com.info.sn.base.BaseActivity;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
public class PrivacyPolicyActivity extends BaseActivity {
|
||||
private WebView webView;
|
||||
|
||||
@Override
|
||||
public int getLayoutId() {
|
||||
return R.layout.activity_privacypolicy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initView() {
|
||||
webView = findViewById(R.id.webView);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
initWebView();
|
||||
webView.loadDataWithBaseURL(null, readAsset("privacy_policy.html"), "text/html", "UTF-8", null);
|
||||
}
|
||||
|
||||
private void initWebView() {
|
||||
WebSettings webSettings = webView.getSettings();
|
||||
webSettings.setJavaScriptEnabled(true);
|
||||
webSettings.setBlockNetworkImage(false);
|
||||
//webSettings.setBuiltInZoomControls(true);
|
||||
//webSettings.setSupportZoom(true);
|
||||
webSettings.setUseWideViewPort(true);
|
||||
webSettings.setLoadWithOverviewMode(true);
|
||||
webSettings.setAllowFileAccess(true);
|
||||
webSettings.setSupportMultipleWindows(true);
|
||||
webSettings.setDomStorageEnabled(true);
|
||||
webSettings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN);
|
||||
webSettings.setTextZoom(100);
|
||||
webSettings.setDefaultFontSize(200); //设置显示字体的大小
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
|
||||
webSettings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
|
||||
}
|
||||
//控制webview不可点击
|
||||
// webView.setOnTouchListener(new View.OnTouchListener() {
|
||||
// @Override
|
||||
// public boolean onTouch(View v, MotionEvent event) {
|
||||
// return true;
|
||||
// }
|
||||
// });
|
||||
webView.setOnLongClickListener(new View.OnLongClickListener() {
|
||||
@Override
|
||||
public boolean onLongClick(View view) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public String readAsset(String fileName) {
|
||||
try {
|
||||
//获取文件中的字节
|
||||
InputStream inputStream = getResources().getAssets().open(fileName);
|
||||
//将字节转换为字符
|
||||
InputStreamReader isReader = new InputStreamReader(inputStream, StandardCharsets.UTF_8);
|
||||
//使用bufferReader去读取内容
|
||||
BufferedReader reader = new BufferedReader(isReader);
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
String out = "";
|
||||
while ((out = reader.readLine()) != null) {
|
||||
stringBuffer.append(out);
|
||||
Log.e("TAG", "readAsset: " + out);
|
||||
}
|
||||
return stringBuffer.toString();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
package com.info.sn.activity;
|
||||
|
||||
import android.util.Log;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.webkit.WebSettings;
|
||||
import android.webkit.WebView;
|
||||
|
||||
import com.info.sn.R;
|
||||
import com.info.sn.base.BaseActivity;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
public class UserAgreementActivity extends BaseActivity {
|
||||
private WebView webView;
|
||||
|
||||
@Override
|
||||
public int getLayoutId() {
|
||||
return R.layout.activity_useragreement;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initView() {
|
||||
webView = findViewById(R.id.webView);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
initWebView();
|
||||
webView.loadDataWithBaseURL(null, readAsset("user_agreement.html"), "text/html", "UTF-8", null);
|
||||
}
|
||||
|
||||
private void initWebView() {
|
||||
WebSettings webSettings = webView.getSettings();
|
||||
webSettings.setJavaScriptEnabled(true);
|
||||
webSettings.setBlockNetworkImage(false);
|
||||
//webSettings.setBuiltInZoomControls(true);
|
||||
//webSettings.setSupportZoom(true);
|
||||
webSettings.setUseWideViewPort(true);
|
||||
webSettings.setLoadWithOverviewMode(true);
|
||||
webSettings.setAllowFileAccess(true);
|
||||
webSettings.setSupportMultipleWindows(true);
|
||||
webSettings.setDomStorageEnabled(true);
|
||||
webSettings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN);
|
||||
webSettings.setTextZoom(100);
|
||||
webSettings.setDefaultFontSize(200); //设置显示字体的大小
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
|
||||
webSettings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
|
||||
}
|
||||
//控制webview不可点击
|
||||
// webView.setOnTouchListener(new View.OnTouchListener() {
|
||||
// @Override
|
||||
// public boolean onTouch(View v, MotionEvent event) {
|
||||
// return true;
|
||||
// }
|
||||
// });
|
||||
webView.setOnLongClickListener(new View.OnLongClickListener() {
|
||||
@Override
|
||||
public boolean onLongClick(View view) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public String readAsset(String fileName) {
|
||||
try {
|
||||
//获取文件中的字节
|
||||
InputStream inputStream = getResources().getAssets().open(fileName);
|
||||
//将字节转换为字符
|
||||
InputStreamReader isReader = new InputStreamReader(inputStream, StandardCharsets.UTF_8);
|
||||
//使用bufferReader去读取内容
|
||||
BufferedReader reader = new BufferedReader(isReader);
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
String out = "";
|
||||
while ((out = reader.readLine()) != null) {
|
||||
stringBuffer.append(out);
|
||||
Log.e("TAG", "readAsset: " + out);
|
||||
}
|
||||
return stringBuffer.toString();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -30,7 +30,9 @@ import com.flyco.tablayout.SlidingTabLayout;
|
||||
import com.info.sn.BuildConfig;
|
||||
import com.info.sn.R;
|
||||
import com.info.sn.activity.GuideActivity;
|
||||
import com.info.sn.activity.PrivacyPolicyActivity;
|
||||
import com.info.sn.activity.SNUidActivity;
|
||||
import com.info.sn.activity.UserAgreementActivity;
|
||||
import com.info.sn.activity.selectegrade.SelecteGradeActivity;
|
||||
import com.info.sn.base.BaseActivity;
|
||||
import com.info.sn.bean.gankao.AvailableProduct;
|
||||
@@ -93,7 +95,7 @@ public class MainActivity extends BaseActivity implements MainContact.MainView,
|
||||
ConstraintLayout cl_vip;
|
||||
|
||||
@BindView(R.id.tv_exit)
|
||||
TextView iv_exit;
|
||||
TextView tv_exit;
|
||||
|
||||
@BindView(R.id.tv_title)
|
||||
TextView tv_title;
|
||||
@@ -137,6 +139,12 @@ public class MainActivity extends BaseActivity implements MainContact.MainView,
|
||||
@BindView(R.id.tv_guide)
|
||||
TextView tv_guide;
|
||||
|
||||
@BindView(R.id.tv_pripolicy)
|
||||
TextView tv_pripolicy;
|
||||
|
||||
@BindView(R.id.tv_useragreement)
|
||||
TextView tv_useragreement;
|
||||
|
||||
@BindView(R.id.tv_activate)
|
||||
TextView tv_activate;
|
||||
|
||||
@@ -146,6 +154,9 @@ public class MainActivity extends BaseActivity implements MainContact.MainView,
|
||||
@BindView(R.id.slidingtablayout)
|
||||
SlidingTabLayout slidingtablayout;
|
||||
|
||||
@BindView(R.id.iv_exit)
|
||||
ImageView iv_exit;
|
||||
|
||||
@Override
|
||||
public void onDisconnected() {
|
||||
|
||||
@@ -386,50 +397,31 @@ public class MainActivity extends BaseActivity implements MainContact.MainView,
|
||||
|
||||
private void setOnClickListener() {
|
||||
setClickable();
|
||||
cl_update.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
continuousClick(COUNTS, DURATION);
|
||||
}
|
||||
cl_update.setOnClickListener(view -> continuousClick(COUNTS, DURATION));
|
||||
cl_vip.setOnClickListener(view -> {
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra("json", SnUidJSON);
|
||||
intent.setClass(MainActivity.this, SNUidActivity.class);
|
||||
startActivity(intent);
|
||||
});
|
||||
cl_vip.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra("json", SnUidJSON);
|
||||
intent.setClass(MainActivity.this, SNUidActivity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
bt_activation.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
startActivity(new Intent(MainActivity.this, SelecteGradeActivity.class));
|
||||
bt_activation.setOnClickListener(view -> {
|
||||
startActivity(new Intent(MainActivity.this, SelecteGradeActivity.class));
|
||||
// showActivationDialog();
|
||||
}
|
||||
});
|
||||
iv_exit.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
tv_title.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (isDebugMode()) {
|
||||
enterUserDebug();
|
||||
} else {
|
||||
|
||||
}
|
||||
iv_exit.setOnClickListener(view -> finish());
|
||||
tv_title.setOnClickListener(view -> {
|
||||
if (isDebugMode()) {
|
||||
enterUserDebug();
|
||||
} else {
|
||||
|
||||
}
|
||||
});
|
||||
tv_guide.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
startActivity(new Intent(MainActivity.this, GuideActivity.class));
|
||||
}
|
||||
tv_guide.setOnClickListener(view -> startActivity(new Intent(MainActivity.this, GuideActivity.class)));
|
||||
tv_pripolicy.setOnClickListener(v -> {
|
||||
startActivity(new Intent(MainActivity.this, PrivacyPolicyActivity.class));
|
||||
});
|
||||
tv_useragreement.setOnClickListener(v -> {
|
||||
startActivity(new Intent(MainActivity.this, UserAgreementActivity.class));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -321,7 +321,7 @@ public class ManagerService extends Service {
|
||||
Log.e(TAG, "TimeChangedReceiver:" + "timezone changed");
|
||||
} else if (Intent.ACTION_TIME_TICK.equals(action)) {
|
||||
Log.e(TAG, "TimeChangedReceiver:" + "time tick");
|
||||
setFloatingWindow();
|
||||
// setFloatingWindow();
|
||||
} else if (ACTION_UPDATE.equals(action)) {
|
||||
Log.e(TAG, "TimeChangedReceiver:" + "date update");
|
||||
setFloatingWindow();
|
||||
|
||||
@@ -743,7 +743,7 @@ public class ApkUtils {
|
||||
HashSet<String> writeAppSet = new HashSet<>(Arrays.asList(result.split(",")));
|
||||
writeAppSet.addAll(factoryAppSet);
|
||||
String pkgString = String.join(",", writeAppSet);
|
||||
Log.e("fht", "qch_app_forbid :" + result);
|
||||
Log.e("fht", "qch_app_forbid :" + pkgString);
|
||||
boolean qch_app_forbid = JGYUtils.putString(context.getContentResolver(), "qch_app_forbid", pkgString);
|
||||
} else {
|
||||
JGYUtils.putString(context.getContentResolver(), "qch_app_forbid", String.join(",", factoryAppSet));
|
||||
|
||||
@@ -868,7 +868,7 @@ public class Utils {
|
||||
String upgrade_disallow = Settings.System.getString(context.getContentResolver(), "upgrade_disallow");
|
||||
//所有app
|
||||
String only_jgy_shortcut_list = Settings.System.getString(context.getContentResolver(), "only_jgy_shortcut_list");
|
||||
Log.e("writeDisableUpdateList", now);
|
||||
Log.e("writeDisableUpdateList", "qch_app_forbid: " + now);
|
||||
HashSet<String> nowList = new HashSet<>();
|
||||
HashSet<String> disallowList = new HashSet<>();
|
||||
HashSet<String> allList = new HashSet<>();
|
||||
|
||||
Reference in New Issue
Block a user