mirror of https://github.com/M66B/NetGuard.git
Crowdin sync
This commit is contained in:
parent
790decd25d
commit
d0ad552855
|
@ -281,9 +281,7 @@ public class SinkholeService extends VpnService {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Schedule next update
|
// Schedule next update
|
||||||
Message msg = new Message();
|
mServiceHandler.sendEmptyMessageDelayed(MSG_STATS_UPDATE, 1000);
|
||||||
msg.what = MSG_STATS_UPDATE;
|
|
||||||
mServiceHandler.sendMessageDelayed(msg, 1000);
|
|
||||||
|
|
||||||
// Cleanup
|
// Cleanup
|
||||||
while (gt.size() >= 100) {
|
while (gt.size() >= 100) {
|
||||||
|
@ -314,7 +312,6 @@ public class SinkholeService extends VpnService {
|
||||||
// Create bitmap
|
// Create bitmap
|
||||||
int height = Util.dips2pixels(96, SinkholeService.this);
|
int height = Util.dips2pixels(96, SinkholeService.this);
|
||||||
int width = Util.dips2pixels(96 * 5, SinkholeService.this);
|
int width = Util.dips2pixels(96 * 5, SinkholeService.this);
|
||||||
Log.i(TAG, "h=" + height + " w=" + width);
|
|
||||||
Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
|
Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
|
||||||
|
|
||||||
// Create canvas
|
// Create canvas
|
||||||
|
@ -376,11 +373,11 @@ public class SinkholeService extends VpnService {
|
||||||
RemoteViews remoteViews = new RemoteViews(getPackageName(), R.layout.traffic);
|
RemoteViews remoteViews = new RemoteViews(getPackageName(), R.layout.traffic);
|
||||||
remoteViews.setImageViewBitmap(R.id.ivTraffic, bitmap);
|
remoteViews.setImageViewBitmap(R.id.ivTraffic, bitmap);
|
||||||
if (txsec < 1024 && rxsec < 1024)
|
if (txsec < 1024 && rxsec < 1024)
|
||||||
remoteViews.setTextViewText(R.id.tvTraffic, String.format("%.0f / %.0f B/sec", txsec, rxsec));
|
remoteViews.setTextViewText(R.id.tvTraffic, String.format("▲ %.0f ▼ %.0f B/sec", txsec, rxsec));
|
||||||
else if (txsec < 1024 * 1024 && rxsec < 1024 * 1024)
|
else if (txsec < 1024 * 1024 && rxsec < 1024 * 1024)
|
||||||
remoteViews.setTextViewText(R.id.tvTraffic, String.format("%.1f / %.1f KiB/sec", txsec / 1024, rxsec / 1024));
|
remoteViews.setTextViewText(R.id.tvTraffic, String.format("▲ %.1f ▼ %.1f KiB/sec", txsec / 1024, rxsec / 1024));
|
||||||
else
|
else
|
||||||
remoteViews.setTextViewText(R.id.tvTraffic, String.format("%.1f / %.1f MiB/sec", txsec / 1024 / 1024, rxsec / 1024 / 1024));
|
remoteViews.setTextViewText(R.id.tvTraffic, String.format("▲ %.1f ▼ %.1f MiB/sec", txsec / 1024 / 1024, rxsec / 1024 / 1024));
|
||||||
|
|
||||||
// Show notification
|
// Show notification
|
||||||
Intent main = new Intent(SinkholeService.this, ActivityMain.class);
|
Intent main = new Intent(SinkholeService.this, ActivityMain.class);
|
||||||
|
@ -591,9 +588,7 @@ public class SinkholeService extends VpnService {
|
||||||
|
|
||||||
// Start/stop stats
|
// Start/stop stats
|
||||||
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
|
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
|
||||||
Message msg = new Message();
|
mServiceHandler.sendEmptyMessage(pm.isInteractive() ? MSG_STATS_START : MSG_STATS_STOP);
|
||||||
msg.what = pm.isInteractive() ? MSG_STATS_START : MSG_STATS_STOP;
|
|
||||||
mServiceHandler.sendMessage(msg);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -22,11 +22,11 @@
|
||||||
<string name="setting_whitelist_roaming">默认阻止漫游</string>
|
<string name="setting_whitelist_roaming">默认阻止漫游</string>
|
||||||
<string name="setting_options">选项:</string>
|
<string name="setting_options">选项:</string>
|
||||||
<string name="setting_system">管理系统应用</string>
|
<string name="setting_system">管理系统应用</string>
|
||||||
<string name="setting_stats">Show speed notification</string>
|
<string name="setting_stats">显示网速通知</string>
|
||||||
<string name="setting_stats_base">Speed baseline: %s KiB/sec</string>
|
<string name="setting_stats_base">网速基准: %s KiB/秒</string>
|
||||||
<string name="setting_auto">%1$s 分钟后自动启用</string>
|
<string name="setting_auto">%1$s 分钟后自动启用</string>
|
||||||
<string name="setting_dark">使用暗色主题</string>
|
<string name="setting_dark">使用暗色主题</string>
|
||||||
<string name="setting_wifi_home">Wi-Fi home network: %1$s</string>
|
<string name="setting_wifi_home">Wi-Fi 家庭网络: %1$s</string>
|
||||||
<string name="setting_metered">控制按流量计费Wi-Fi网络</string>
|
<string name="setting_metered">控制按流量计费Wi-Fi网络</string>
|
||||||
<string name="setting_metered_2g">2G非按流量计费</string>
|
<string name="setting_metered_2g">2G非按流量计费</string>
|
||||||
<string name="setting_metered_3g">3G非按流量计费</string>
|
<string name="setting_metered_3g">3G非按流量计费</string>
|
||||||
|
@ -37,9 +37,9 @@
|
||||||
<string name="setting_import">导入设置</string>
|
<string name="setting_import">导入设置</string>
|
||||||
<string name="setting_technical">技术信息</string>
|
<string name="setting_technical">技术信息</string>
|
||||||
<string name="summary_system">定义系统应用规则, 仅供专业用户</string>
|
<string name="summary_system">定义系统应用规则, 仅供专业用户</string>
|
||||||
<string name="summary_stats">Show network speed graph in status bar notification</string>
|
<string name="summary_stats">在状态栏通知中显示网速示意图</string>
|
||||||
<string name="summary_auto">禁用小部件后, 在设定分钟后自动再次启用NetGuard\n输入零以禁用此选项</string>
|
<string name="summary_auto">禁用小部件后, 在设定分钟后自动再次启用NetGuard\n输入零以禁用此选项</string>
|
||||||
<string name="summary_wifi_home">Apply Wi-Fi network rules for selected network only (apply mobile network rules for other Wi-Fi networks)</string>
|
<string name="summary_wifi_home">仅将Wi-Fi网络规则应用于所选定的网络 (将移动网络规则应用于其他Wi-Fi网络)</string>
|
||||||
<string name="summary_metered">将移动网络规则应用于按流量计费的 (付费, 共享) Wi-Fi网络</string>
|
<string name="summary_metered">将移动网络规则应用于按流量计费的 (付费, 共享) Wi-Fi网络</string>
|
||||||
<string name="summary_metered_2g">将Wi-Fi网络规则应用于2G数据连接</string>
|
<string name="summary_metered_2g">将Wi-Fi网络规则应用于2G数据连接</string>
|
||||||
<string name="summary_metered_3g">将Wi-Fi网络规则应用于3G数据连接</string>
|
<string name="summary_metered_3g">将Wi-Fi网络规则应用于3G数据连接</string>
|
||||||
|
@ -58,7 +58,7 @@ NetGuard不具有网络访问权限, 所以您无需担心您的网络流量被
|
||||||
<string name="msg_voluntary">捐赠完全出于自愿并且不会解锁任何功能. 捐赠仅作为您对开发者付出劳动的感谢.</string>
|
<string name="msg_voluntary">捐赠完全出于自愿并且不会解锁任何功能. 捐赠仅作为您对开发者付出劳动的感谢.</string>
|
||||||
<string name="msg_terms">捐赠即表明您同意 <a href="http://www.netguard.me/#terms">条款与条件</a></string>
|
<string name="msg_terms">捐赠即表明您同意 <a href="http://www.netguard.me/#terms">条款与条件</a></string>
|
||||||
<string name="msg_dimming">如果您在下一个对话框中无法点击确定, 可能是另一个应用正在控制屏幕(如屏幕亮度调节软件).</string>
|
<string name="msg_dimming">如果您在下一个对话框中无法点击确定, 可能是另一个应用正在控制屏幕(如屏幕亮度调节软件).</string>
|
||||||
<string name="title_all">All</string>
|
<string name="title_all">全部</string>
|
||||||
<string name="title_screen_wifi">亮屏时允许Wi-Fi网络</string>
|
<string name="title_screen_wifi">亮屏时允许Wi-Fi网络</string>
|
||||||
<string name="title_screen_other">亮屏时允许移动网络</string>
|
<string name="title_screen_other">亮屏时允许移动网络</string>
|
||||||
<string name="title_roaming">漫游时阻止</string>
|
<string name="title_roaming">漫游时阻止</string>
|
||||||
|
|
Loading…
Reference in New Issue