Skip to content

Commit

Permalink
Merge pull request #24 from lianglixin/functional
Browse files Browse the repository at this point in the history
Fix crash on MIUI
  • Loading branch information
lianglixin authored Apr 21, 2019
2 parents 0afdb37 + 02b5604 commit 1815f3e
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ android {
minSdkVersion 19
targetSdkVersion 26
versionCode 24
versionName "1.2.5.1"
versionName "1.2.5.1.1"
multiDexEnabled true
android {
defaultConfig {
Expand Down
Binary file modified app/release/app-release.apk
Binary file not shown.
2 changes: 1 addition & 1 deletion app/release/output.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":24,"versionName":"1.2.5.1","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]
[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":24,"versionName":"1.2.5.1.1","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]
31 changes: 27 additions & 4 deletions app/src/main/java/io/virtualapp/home/HomeActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
import io.virtualapp.home.models.PackageAppData;
import io.virtualapp.home.repo.XAppDataInstalled;
import io.virtualapp.widgets.TwoGearsView;
import jonathanfinerty.once.Once;

import static android.support.v7.widget.helper.ItemTouchHelper.ACTION_STATE_DRAG;
import static android.support.v7.widget.helper.ItemTouchHelper.DOWN;
Expand Down Expand Up @@ -108,6 +109,17 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
initMenu();
hHomeAct=this;
new HomePresenterImpl(this).start();

if (!Once.beenDone("user_license")) {
new AlertDialog.Builder(this)
.setTitle(R.string.about)
.setMessage(R.string.software_license)
.setCancelable(false)
.setNegativeButton(R.string.back, (dialog, which) -> finish())
.setPositiveButton(R.string.accept, (dialog, which) ->
Once.markDone("user_license"))
.create().show();
}
}

private void initMenu() {
Expand All @@ -119,10 +131,21 @@ private void initMenu() {
return false;
});
menu.add("账户").setIcon(R.drawable.ic_account).setOnMenuItemClickListener(item -> {
List<VUserInfo> users = VUserManager.get().getUsers();
List<String> names = new ArrayList<>(users.size());
for (VUserInfo info : users) {
names.add(info.name);
List<String> names;
List<VUserInfo> users;
try
{
users = VUserManager.get().getUsers();
names = new ArrayList<>(users.size());
for (VUserInfo info : users)
{
names.add(info.name);
}
}
catch(Throwable e)
{
e.printStackTrace();
return false;
}
CharSequence[] items = new CharSequence[names.size()];
for (int i = 0; i < names.size(); i++) {
Expand Down
8 changes: 7 additions & 1 deletion app/src/main/java/io/virtualapp/home/ListAppFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,13 @@ public boolean isSelectable(int position) {
});
mAdapter.setSelectionListener(count -> {
mInstallButton.setEnabled(count > 0);
mInstallButton.setText(String.format(Locale.ENGLISH, getResources().getString(R.string.install_d), count));
try
{
mInstallButton.setText(String.format(Locale.ENGLISH, getResources().getString(R.string.install_d), count));
}catch (Throwable e)
{
e.printStackTrace();
}
});
mInstallButton.setOnClickListener(v -> {
Integer[] selectedIndices = mAdapter.getSelectedIndices();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,12 @@ public String getPath(final Context context, final Uri uri) {
// DownloadsProvider
else if (isDownloadsDocument(uri)) {
final String id = DocumentsContract.getDocumentId(uri);
final Uri contentUri = ContentUris.withAppendedId(
Uri.parse("content://downloads/public_downloads"), Long.valueOf(id));
Uri contentUri = uri;// = ContentUris.withAppendedId(
// Uri.parse("content://downloads/public_downloads"), Long.valueOf(id));
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
contentUri = ContentUris.withAppendedId(
Uri.parse("content://downloads/public_downloads"), Long.valueOf(id));
}
return getDataColumn(context, contentUri, null, null);
}
// MediaProvider
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,6 @@
<string name="rom_shortcut_tips">检测到您的机型必须手动允许快捷方式的创建,请到系统设置->应用->权限管理,找到本应用,开启快捷方式权限。</string>
<string name="app_powered_by">由SandHook框架强力驱动</string>
<string name="app_contributor">Yao Gan, Lixin Liang, Saurik</string>
<string name="software_license">"SandVXP开源软件协议介绍 为有效保护用户使用软件的透明纯净、安全稳定性与用户所享有软件的相关权益, 同时能更好有助于国内开源软件可持续发展,麦科技官网起草制定以下开源软件协议,命名为:SandVXP开源软件协议。 SandVXP开源软件协议将致力于推动软件透明、开源创新发展,主张完美主义、专注品质,并呼吁尊重原创版权、宣扬信守契约精神。 本软件为组织出品,完全免费开源,与本人公司无关,且软件为非盈利所用。 以下协议有使用简称 软件产品开发方:软件官方 软件产品使用者:用户 SandVXP开源软件协议约定 软件官方遵守协议约定 1) 禁止闭源发布源码程序,所有源码程序用户都可阅读。 2) 必须提供完整源码程序,可任何方式,如提供线上下载、光盘、磁盘拷贝。 3) 必须提供透明源码程序,禁止使用任何可逆或不可逆手段进行混淆源码程序。 4) 禁止任何侵权行为,包括软件的源码程序、资料文档、文件信息。 5) 禁止软件产品插入与软件官方无关的任何广告信息,包括文字、图像、媒体信息。 6) 禁止软件产品内置与软件官方程序应用无关的任何第三方插件程序、组件。 7) 禁止软件程序存在任何不经过用户许可的远程响应执行的控制程序。 8) SandVXP软件不对用户的使用后果付任何责任。 9) 请有保密需求的用户,注意本软件(以及其源码)是不对您的保密需求负责的。 10) 使用本软件源码务必注明原作者GanYao和Lixin Liang。并且必须注明软件出处。 用户遵守协议约定 1) 禁止用户修改软件官方任何的版权说明信息,包括程序的版权协议说明、软件官方链接、文字说明、图像标志、媒体信息。 2) 禁止用户通过任何方式破坏、侵犯软件官方的正常发展运营,包括软件官方程序的正常运行与商业授权机制。 协议使用与生效声明  使用SandVXP开源软件协议的软件官方需在源码程序注释注明使用SandVXP开源软件协议与附带协议说明文件, 用户自安装使用SandVXP开源协议的软件开始,协议将立即生效。 "</string>
<string name="accept">接受</string>
</resources>
2 changes: 2 additions & 0 deletions app/src/main/res/values-zh-rTW/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,6 @@
<string name="rom_shortcut_tips">检测到您的机型必须手动允许快捷方式的创建,请到系统设置->应用->权限管理,找到本应用,开启快捷方式权限。</string>
<string name="app_powered_by">由SandHook框架强力驱动</string>
<string name="app_contributor">Yao Gan, Lixin Liang, Saurik</string>
<string name="software_license">"SandVXP开源软件协议介绍 为有效保护用户使用软件的透明纯净、安全稳定性与用户所享有软件的相关权益, 同时能更好有助于国内开源软件可持续发展,麦科技官网起草制定以下开源软件协议,命名为:SandVXP开源软件协议。 SandVXP开源软件协议将致力于推动软件透明、开源创新发展,主张完美主义、专注品质,并呼吁尊重原创版权、宣扬信守契约精神。 本软件为组织出品,完全免费开源,与本人公司无关,且软件为非盈利所用。 以下协议有使用简称 软件产品开发方:软件官方 软件产品使用者:用户 SandVXP开源软件协议约定 软件官方遵守协议约定 1) 禁止闭源发布源码程序,所有源码程序用户都可阅读。 2) 必须提供完整源码程序,可任何方式,如提供线上下载、光盘、磁盘拷贝。 3) 必须提供透明源码程序,禁止使用任何可逆或不可逆手段进行混淆源码程序。 4) 禁止任何侵权行为,包括软件的源码程序、资料文档、文件信息。 5) 禁止软件产品插入与软件官方无关的任何广告信息,包括文字、图像、媒体信息。 6) 禁止软件产品内置与软件官方程序应用无关的任何第三方插件程序、组件。 7) 禁止软件程序存在任何不经过用户许可的远程响应执行的控制程序。 8) SandVXP软件不对用户的使用后果付任何责任。 9) 请有保密需求的用户,注意本软件(以及其源码)是不对您的保密需求负责的。 10) 使用本软件源码务必注明原作者GanYao和Lixin Liang。并且必须注明软件出处。 用户遵守协议约定 1) 禁止用户修改软件官方任何的版权说明信息,包括程序的版权协议说明、软件官方链接、文字说明、图像标志、媒体信息。 2) 禁止用户通过任何方式破坏、侵犯软件官方的正常发展运营,包括软件官方程序的正常运行与商业授权机制。 协议使用与生效声明  使用SandVXP开源软件协议的软件官方需在源码程序注释注明使用SandVXP开源软件协议与附带协议说明文件, 用户自安装使用SandVXP开源协议的软件开始,协议将立即生效。 "</string>
<string name="accept">接受</string>
</resources>
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,6 @@
<string name="rom_shortcut_tips">We detected your device must accept permission manual. Please allow shortcut ceration permission in system settings. Allow this in Settings -> App Management -> Permission Management -> this application -> allow shortcut permission.</string>
<string name="app_powered_by">Powered by SandHook</string>
<string name="app_contributor">Yao Gan, Lixin Liang, Saurik</string>
<string name="software_license">Introduction of SandVXP Open Source Software Protocol In order to effectively protect the transparency, purity, security and stability of the software used by users and the related rights and interests of the software enjoyed by users, At the same time, it can better contribute to the sustainable development of domestic open source software. AMH official website drafted and formulated the following open source software protocol, named SandVXP open source software protocol. SandVXP Open Source Software Agreement will strive to promote software transparency, open source innovation and development, advocate perfectionism, focus on quality, and call for respect for original copyright, promote adherence to the spirit of contract. This software is produced for the organization, completely free and open source, has nothing to do with my company, and the software is used for non-profit. The following protocols are abbreviated for use Software Product Developer: Software Official Software Product User: User SandVXP Open Source Software Protocol Agreement Software official Compliance Agreement 1) Prohibit the publication of closed source programs, all source program users can read. 2) Complete source code programs must be provided in any way, such as online downloads, CD-ROMs and disk copies. 3) Transparent source code programs must be provided, and obfuscation of source code programs by any reversible or irreversible means must be prohibited. 4) Prohibit any infringement, including software source code procedures, data documents, document information. 5) It is forbidden for software products to insert any advertising information, including text, image and media information, which is not related to the official software. 6) Prohibit any third-party plug-ins or components built into software products that are not related to the application of official software programs. 7) Prohibit any control program executed by remote response without user\'s permission. 8) SandVXP software does not bear any responsibility for the consequences of users\'use. 9) Please note that the software (and its source code) is not responsible for your security needs. 10) The original authors GanYao and Lixin Liang must be noted in the source code of this software. And the source of the software must be indicated. User Compliance with Agreement 1) Users are prohibited from modifying any official copyright information of the software, including the description of the copyright agreement of the program, the official link of the software, the text description, the image logo and the media information. 2) It is forbidden for users to destroy or infringe upon the normal development and operation of the official software in any way, including the normal operation of the official software procedures and the commercial authorization mechanism. Statement of Agreement Use and Entry into Force Software authorities using the SandVXP Open Source Software Protocol need to annotate the use of the SandVXP Open Source Software Protocol and the accompanying protocol documentation in the source program annotations. Since the user installs the software using SandVXP open source protocol, the protocol will take effect immediately.</string>
<string name="accept">Accept</string>
</resources>

0 comments on commit 1815f3e

Please sign in to comment.