Improved about QQ group

This commit is contained in:
PeratX 2017-04-08 11:56:22 +08:00
parent 3194ffdc7b
commit d14f69a34d
8 changed files with 94 additions and 47 deletions

View File

@ -1,6 +1,6 @@
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
def gitSha = 'git rev-parse --short HEAD'.execute([], project.rootDir).text.trim() def gitCommit = 'git rev-parse --short HEAD'.execute([], project.rootDir).text.trim()
android { android {
compileSdkVersion 25 compileSdkVersion 25
@ -11,6 +11,11 @@ android {
targetSdkVersion 25 targetSdkVersion 25
versionCode 1 versionCode 1
versionName "1.0.0" versionName "1.0.0"
buildConfigField "String", "BUILD_TIME", "\"${System.currentTimeMillis()}\""
buildConfigField "String", "GIT_COMMIT", "\"${gitCommit}\""
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
} }
buildTypes { buildTypes {
@ -28,7 +33,7 @@ android {
variant.outputs.each { output -> variant.outputs.each { output ->
def outputFile = output.outputFile def outputFile = output.outputFile
if (outputFile != null && outputFile.name.endsWith('.apk')) { if (outputFile != null && outputFile.name.endsWith('.apk')) {
def fileName = outputFile.name.replace("app", "${defaultConfig.applicationId}_${defaultConfig.versionName}_${gitSha}") def fileName = outputFile.name.replace("app", "${defaultConfig.applicationId}_${defaultConfig.versionName}_${gitCommit}")
output.outputFile = new File(outputFile.parent, fileName) output.outputFile = new File(outputFile.parent, fileName)
} }
} }
@ -44,6 +49,9 @@ dependencies {
compile 'com.android.support:appcompat-v7:25.3.1' compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1' compile 'com.android.support:design:25.3.1'
compile 'com.android.support:support-v4:25.3.1' compile 'com.android.support:support-v4:25.3.1'
compile "de.measite.minidns:minidns-hla:0.2.1" compile 'com.android.support:percent:25.3.1'
compile 'de.measite.minidns:minidns-hla:0.2.1'
testCompile 'junit:junit:4.12' testCompile 'junit:junit:4.12'
} }

View File

@ -11,32 +11,32 @@
</head> </head>
<script type="text/javascript"> <script type="text/javascript">
function changeVersion(softwareVersion) { function changeVersionInfo(version, time, gitCommit) {
document.getElementById("version").innerHTML = "Version: " + softwareVersion; document.getElementById("version").innerHTML = "版本: " + version;
document.getElementById("build_time").innerHTML = "构建时间:" + time;
document.getElementById("git_commit").innerHTML = "Git commit" + gitCommit;
} }
</script> </script>
<body> <body>
<img width="128" height="128" src="itxtech_logo.png"/> <img width="100" height="100" src="itxtech_logo.png"/>
<br> <br>
<div style="font-size:25px">iTX Technologies</div> <div style="font-size:25px">iTX Technologies</div>
<br> <br>
<br>
<img width="92" height="70" src="ic_launcher.png"> <img width="92" height="70" src="ic_launcher.png">
<br> <br>
<div style="font-size: 25px;">Daedalus</div> <div style="font-size: 25px;">Daedalus</div>
<div id="version" style="font-size: 20px;">null</div> <div id="version" style="font-size: 10px;">null</div>
<br> <div id="build_time" style="font-size: 10px;">null</div>
<div id="git_commit" style="font-size: 10px;">null</div>
<br> <br>
<img width="185" height="55" src="cutedns_logo.png"> <img width="185" height="55" src="cutedns_logo.png">
<div style="font-size: 25px;">CuteDNS!</div> <div style="font-size: 25px;">CuteDNS!</div>
<br> <br>
<br>
<br>
<div style="font-size: 10px; color: gray;"> <div style="font-size: 10px; color: gray;">
使用者必须遵守当地法律法规<br> Users must comply with local laws and regulations。<br>
欢迎加入 CuteDNS! QQ群625385297 。<br> Welcome to CuteDNS! QQ Group: 625385297.<br>
打开菜单探索更多功能。 Open the menu to explore more features.
</div> </div>
</body> </body>
</html> </html>

View File

@ -0,0 +1,42 @@
<!DOCTYPE html>
<html lang="zh" xmlns="http://www.w3.org/1999/html">
<head>
<meta charset="UTF-8">
<title>关于 iTXTech Daedalus</title>
<style>
body {
text-align: center;
}
</style>
</head>
<script type="text/javascript">
function changeVersionInfo(version, time, gitCommit) {
document.getElementById("version").innerHTML = "版本: " + version;
document.getElementById("build_time").innerHTML = "构建时间:" + time;
document.getElementById("git_commit").innerHTML = "Git commit" + gitCommit;
}
</script>
<body>
<img width="100" height="100" src="itxtech_logo.png"/>
<br>
<div style="font-size:25px">iTX Technologies</div>
<br>
<img width="92" height="70" src="ic_launcher.png">
<br>
<div style="font-size: 25px;">Daedalus</div>
<div id="version" style="font-size: 10px;">null</div>
<div id="build_time" style="font-size: 10px;">null</div>
<div id="git_commit" style="font-size: 10px;">null</div>
<br>
<img width="185" height="55" src="cutedns_logo.png">
<div style="font-size: 25px;">CuteDNS!</div>
<br>
<div style="font-size: 10px; color: gray;">
使用者必须遵守当地法律法规。<br>
欢迎加入 CuteDNS! QQ群625385297 。<br>
打开菜单探索更多功能。
</div>
</body>
</html>

View File

@ -4,10 +4,12 @@ import android.annotation.SuppressLint;
import android.content.Intent; import android.content.Intent;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity; import android.support.v7.app.AppCompatActivity;
import android.util.Log; import android.util.Log;
import android.view.Menu; import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View;
import android.webkit.WebView; import android.webkit.WebView;
import android.webkit.WebViewClient; import android.webkit.WebViewClient;
@ -36,8 +38,15 @@ public class AboutActivity extends AppCompatActivity {
view.getSettings().setJavaScriptEnabled(true); view.getSettings().setJavaScriptEnabled(true);
view.addJavascriptInterface(this, "JavascriptInterface"); view.addJavascriptInterface(this, "JavascriptInterface");
if (Locale.getDefault().getLanguage().equals("zh")) {//TODO: multi language view.setOnLongClickListener(new View.OnLongClickListener() {
view.loadUrl("file:///android_asset/index.html"); @Override
public boolean onLongClick(View view) {
return true;
}
});
if (Locale.getDefault().getLanguage().equals("zh")) {
view.loadUrl("file:///android_asset/index_zh.html");
} else { } else {
view.loadUrl("file:///android_asset/index.html"); view.loadUrl("file:///android_asset/index.html");
} }
@ -47,7 +56,7 @@ public class AboutActivity extends AppCompatActivity {
public void onPageFinished(WebView view, String url) { public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url); super.onPageFinished(view, url);
try { try {
view.loadUrl("javascript:changeVersion('" + getPackageManager().getPackageInfo(getPackageName(), 0).versionName + "')"); view.loadUrl("javascript:changeVersionInfo('" + getPackageManager().getPackageInfo(getPackageName(), 0).versionName + "', '" + BuildConfig.BUILD_TIME + "', '" + BuildConfig.GIT_COMMIT + "')");
} catch (Exception e) { } catch (Exception e) {
Log.e("Dvpn", e.toString()); Log.e("Dvpn", e.toString());
} }
@ -83,7 +92,7 @@ public class AboutActivity extends AppCompatActivity {
} }
if (id == R.id.action_join_qqgroup) { if (id == R.id.action_join_qqgroup) {
joinQQGroup("gg"); joinQQGroup("q6Lfo_EhAEO1fP6Xg3fmKsP4pd6U5-RE");
} }
return super.onOptionsItemSelected(item); return super.onOptionsItemSelected(item);
@ -97,7 +106,8 @@ public class AboutActivity extends AppCompatActivity {
startActivity(intent); startActivity(intent);
return true; return true;
} catch (Exception e) { } catch (Exception e) {
// 未安装手Q或安装的版本不支持 Snackbar.make(findViewById(R.id.activity_about), R.string.notice_join_group_failed, Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
return false; return false;
} }
} }

View File

@ -46,7 +46,7 @@ public class ServerTestActivity extends AppCompatActivity {
startTestBut.setOnClickListener(new View.OnClickListener() { startTestBut.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
Snackbar.make(v, R.string.start_test, Snackbar.LENGTH_LONG) Snackbar.make(v, R.string.notice_start_test, Snackbar.LENGTH_LONG)
.setAction("Action", null).show(); .setAction("Action", null).show();
startTestBut.setVisibility(View.INVISIBLE); startTestBut.setVisibility(View.INVISIBLE);
@ -78,7 +78,7 @@ public class ServerTestActivity extends AppCompatActivity {
private String testServer(DNSClient client, String dnsServer, String testUrl, String testText) { private String testServer(DNSClient client, String dnsServer, String testUrl, String testText) {
Log.d("Dvpn", "Testing DNS " + dnsServer); Log.d("Dvpn", "Testing DNS " + dnsServer);
testText += getResources().getString(R.string.test_server_address) + " " + testUrl + "\n" testText += getResources().getString(R.string.test_domain) + " " + testUrl + "\n"
+ getResources().getString(R.string.test_dns_server) + " " + dnsServer; + getResources().getString(R.string.test_dns_server) + " " + dnsServer;
mHandler.obtainMessage(MSG_DISPLAY_STATUS, testText).sendToTarget(); mHandler.obtainMessage(MSG_DISPLAY_STATUS, testText).sendToTarget();
@ -98,7 +98,7 @@ public class ServerTestActivity extends AppCompatActivity {
Set<A> answers = responseMessage.getAnswersFor(question); Set<A> answers = responseMessage.getAnswersFor(question);
for (A a : answers) { for (A a : answers) {
InetAddress inetAddress = a.getInetAddress(); InetAddress inetAddress = a.getInetAddress();
testText += "\n" + getResources().getString(R.string.test_resolved_address) + " " + inetAddress.getHostAddress(); testText += "\n" + getResources().getString(R.string.test_result_resolved) + " " + inetAddress.getHostAddress();
} }
testText += "\n" + getResources().getString(R.string.test_time_used) + " " + String.valueOf(endTime - startTime) + " ms\n\n"; testText += "\n" + getResources().getString(R.string.test_time_used) + " " + String.valueOf(endTime - startTime) + " ms\n\n";

View File

@ -36,7 +36,7 @@
<AutoCompleteTextView <AutoCompleteTextView
android:completionThreshold="1" android:completionThreshold="1"
android:singleLine="true" android:singleLine="true"
android:hint="@string/test_test_url" android:hint="@string/test_test_domain"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/autoCompleteTextView_test_url" android:layout_below="@+id/spinner_server_choice" android:id="@+id/autoCompleteTextView_test_url" android:layout_below="@+id/spinner_server_choice"

View File

@ -9,30 +9,24 @@
<string name="notification_activated">点击回到 Daedalus</string> <string name="notification_activated">点击回到 Daedalus</string>
<string name="settings_system">系统设置</string> <string name="settings_system">系统设置</string>
<string name="settings_boot">开机自动启用</string> <string name="settings_boot">开机自动启用</string>
<string name="about">作者iTX Technologies\n网站https://itxtech.org\n\nDaedalus 是一个运行在 Android 上的 DNS 代理程序。\n它基于
CuteDNS(http://www.cutedns.cn) 的 DNS 服务器。\n\n你可以通过此程序通过 https 协议直连Google, Google Play, Twitter, Facebook, Gmail, Youtube,
Google Drive, Tumblr, Mega, Dropbox, Apkpure, ccFox.info, ProjectH, Battle.NET, WordPress, Microsoft Live,
Github, Amazon, Archive, Box.com, Disqus, SoundCloud, inoreader, Feedly, FlipBoard, Flickr, imgur, Instagram,
DuckDuckGo, Ixquick, Yahoo, Google Services, Google apis, Android, UpLoad, Appspot, Googl eusercontent, Gstatic,
Google other, Google research, Wikipedia, xda-developer 等。\n\n此外你还可以在中国大陆访问 Google Play 应用程序。
</string>
<string name="settings_server">服务器设置</string> <string name="settings_server">服务器设置</string>
<string name="primary_server">首选 DNS 服务器</string> <string name="primary_server">首选 DNS 服务器</string>
<string name="server_south_china">华南</string> <string name="server_south_china">华南</string>
<string name="server_east_china">华东</string> <string name="server_east_china">华东</string>
<string name="server_north_china">华北</string> <string name="server_north_china">华北</string>
<string name="secondary_server">备用 DNS 服务器</string> <string name="secondary_server">备用 DNS 服务器</string>
<string name="start_test">正在测试指定的 DNS 服务器</string> <string name="notice_start_test">正在测试指定的 DNS 服务器</string>
<string name="action_server_test">测试服务器</string> <string name="action_server_test">测试服务器</string>
<string name="action_start_test">开始测试</string> <string name="action_start_test">开始测试</string>
<string name="test_server_address">测试服务器</string> <string name="test_domain">测试域名</string>
<string name="test_time_used">耗时:</string> <string name="test_time_used">耗时:</string>
<string name="test_dns_server">DNS 服务器:</string> <string name="test_dns_server">DNS 服务器:</string>
<string name="test_resolved_address">解析的地址</string> <string name="test_result_resolved">解析结果</string>
<string name="test_failed">查询失败。超时或未知的主机。</string> <string name="test_failed">查询失败。超时或未知的主机。</string>
<string name="test_test_url">google.com</string> <string name="test_test_domain">google.com</string>
<string name="action_visit_cutedns">访问 CuteDNS!</string> <string name="action_visit_cutedns">访问 CuteDNS!</string>
<string name="action_visit_github">访问 项目主页</string> <string name="action_visit_github">访问 项目主页</string>
<string name="action_visit_itxtech">访问 iTXTech</string> <string name="action_visit_itxtech">访问 iTXTech</string>
<string name="action_join_qqgroup">加入 CuteDNS! QQ群</string> <string name="action_join_qqgroup">加入 CuteDNS! QQ群</string>
<string name="notice_join_group_failed">未安装手Q或当前版本不支持此操作。</string>
</resources> </resources>

View File

@ -8,32 +8,25 @@
<string name="notification_activated">Click to back to Daedalus</string> <string name="notification_activated">Click to back to Daedalus</string>
<string name="settings_system">System settings</string> <string name="settings_system">System settings</string>
<string name="settings_boot">Auto activate on boot</string> <string name="settings_boot">Auto activate on boot</string>
<string name="about">Author: iTX Technologies\nWebsite: https://itxtech.org\n\nDaedalus is a DNS Proxy on
Android.\nIt is based on CuteDNS(http://www.cutedns.cn)\'s DNS server.\n\nYou are able to visit some restricted
websites: Google, Google Play, Twitter, Facebook, Gmail, Youtube, Google Drive, Tumblr, Mega, Dropbox, Apkpure,
ccFox.info, ProjectH, Battle.NET, WordPress, Microsoft Live, Github, Amazon, Archive, Box.com, Disqus,
SoundCloud, inoreader, Feedly, FlipBoard, Flickr, imgur, Instagram, DuckDuckGo, Ixquick, Yahoo, Google Services,
Google apis, Android, UpLoad, Appspot, Googl eusercontent, Gstatic, Google other, Google research, Wikipedia,
xda-developer and so on via https.\n\nBesides, you are also able to use Google Play application in mainland
China.
</string>
<string name="settings_server">Server settings</string> <string name="settings_server">Server settings</string>
<string name="primary_server">Primary DNS server</string> <string name="primary_server">Primary DNS server</string>
<string name="server_south_china">South China</string> <string name="server_south_china">South China</string>
<string name="server_east_china">East China</string> <string name="server_east_china">East China</string>
<string name="server_north_china">North China</string> <string name="server_north_china">North China</string>
<string name="secondary_server">Secondary DNS server</string> <string name="secondary_server">Secondary DNS server</string>
<string name="start_test">Testing specified DNS server</string> <string name="notice_start_test">Testing specified DNS server</string>
<string name="action_server_test">Server test</string> <string name="action_server_test">Server test</string>
<string name="action_start_test">Start test</string> <string name="action_start_test">Start test</string>
<string name="test_server_address">Test server address:</string> <string name="test_domain">Test domain:</string>
<string name="test_time_used">Time used:</string> <string name="test_time_used">Time used:</string>
<string name="test_dns_server">DNS server:</string> <string name="test_dns_server">DNS server:</string>
<string name="test_resolved_address">Resolved address:</string> <string name="test_result_resolved">Resolved address:</string>
<string name="test_failed">Query failed. Timeout or unknown hostname.</string> <string name="test_failed">Query failed. Timeout or unknown hostname.</string>
<string name="test_test_url">google.com</string> <string name="test_test_domain">google.com</string>
<string name="action_visit_itxtech">Visit iTXTech</string> <string name="action_visit_itxtech">Visit iTXTech</string>
<string name="action_visit_cutedns">Visit CuteDNS!</string> <string name="action_visit_cutedns">Visit CuteDNS!</string>
<string name="action_visit_github">Visit Project home</string> <string name="action_visit_github">Visit Project home</string>
<string name="action_join_qqgroup">Join QQ group</string> <string name="action_join_qqgroup">Join QQ group</string>
<string name="notice_join_group_failed">QQ is not installed or this version of QQ does not support this operation.
</string>
</resources> </resources>