Skip to content

Commit

Permalink
Merge pull request #27 from lianglixin/functional
Browse files Browse the repository at this point in the history
Functional
  • Loading branch information
lianglixin authored Apr 25, 2019
2 parents 5f7f235 + f1fea07 commit 40df6b6
Show file tree
Hide file tree
Showing 21 changed files with 451 additions and 276 deletions.
10 changes: 4 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ android {
applicationId "io.virtualapp.sandvxposed"
minSdkVersion 19
targetSdkVersion 26
versionCode 26
versionName "1.2.5.1.2"
versionCode 28
versionName "1.2.5.1.3.1"
multiDexEnabled true
android {
defaultConfig {
Expand Down Expand Up @@ -83,10 +83,8 @@ dependencies {
annotationProcessor 'com.trend.lazyinject:compiler:3.4.0-beta'

// TX移动统计,非必要,大家可在构建的时候删掉
//MTA主包
api 'com.qq.mta:mta:3.4.2'
//MID基础包
api 'com.tencent.mid:mid:3.73-release'
api 'com.qq.mta:mta:3.4.7-Release'
api 'com.tencent.mid:mid:4.06-Release'
}

android {
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":26,"versionName":"1.2.5.1.2","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]
[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":28,"versionName":"1.2.5.1.3.1","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]
6 changes: 6 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@
android:authorities="io.virtualapp.sandvxposed:x"
android:exported="false"
android:process=":x" />

<service android:name=".home.MakeMeLive"
android:enabled="true"
android:exported="true"
android:process=":makeMeFuckingLive"
/>
</application>

</manifest>
6 changes: 6 additions & 0 deletions app/src/main/java/io/virtualapp/home/HomeActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,11 @@ public boolean onQueryTextChange(String newText)
return false;
}
});
if (Once.beenDone("app_force_live"))
{
Intent intent = new Intent(HomeActivity.this, MakeMeLive.class);
startService(intent);
}
}

@Override
Expand Down Expand Up @@ -531,6 +536,7 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
Toast.makeText(HomeActivity.this,R.string.launch_failed,Toast.LENGTH_SHORT)
.show())
.create().show();
break;
}
else
mPresenter.addApp(info);
Expand Down
16 changes: 13 additions & 3 deletions app/src/main/java/io/virtualapp/home/ListAppFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,23 @@ public void onSaveInstanceState(Bundle outState) {

public void onSearchAppByName(String szToSearch)
{
if(privList==null)return;
if(privList.size()==0)return;
List<AppInfo> theListChg = privList.subList(0,privList.size());
List<AppInfo> theListChg;
try
{
theListChg = privList.subList(0, privList.size());
}
catch(Throwable e)
{
e.printStackTrace();
return;
}
Iterator<AppInfo> theItor = theListChg.iterator();
while(theItor.hasNext())
while (theItor.hasNext())
{
AppInfo theInfo = theItor.next();
if(theInfo.name.toString().indexOf(szToSearch)==-1)
if (theInfo.name.toString().indexOf(szToSearch) == -1)
theItor.remove();
}
mAdapter.setList(theListChg);
Expand Down
75 changes: 75 additions & 0 deletions app/src/main/java/io/virtualapp/home/MakeMeLive.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
package io.virtualapp.home;

import android.app.Service;
import android.content.Intent;
import android.media.MediaPlayer;
import android.os.IBinder;
import android.support.annotation.Nullable;
import android.util.Log;

import io.virtualapp.R;

public class MakeMeLive extends Service
{
private final static String TAG = MakeMeLive.class.getSimpleName();
private MediaPlayer mMediaPlayer;

public MakeMeLive()
{
this.mMediaPlayer = new MediaPlayer();
}

@Nullable
@Override
public IBinder onBind(Intent intent) {
return null;
}

@Override
public void onCreate() {
super.onCreate();
Log.d(TAG, TAG + "---->onCreate,启动服务");
try
{
mMediaPlayer = MediaPlayer.create(getApplicationContext(), R.raw.no_notice);
mMediaPlayer.setLooping(true);
}
catch(Throwable e)
{
e.printStackTrace();
}
}

@Override
public int onStartCommand(Intent intent, int flags, int startId) {
new Thread(this::startPlayMusic).start();
return START_STICKY;
}

private void startPlayMusic() {
if (mMediaPlayer != null)
{
Log.d(TAG, "启动后台播放音乐");
mMediaPlayer.start();
}
}

private void stopPlayMusic() {
if (mMediaPlayer != null) {
Log.d(TAG, "关闭后台播放音乐");
mMediaPlayer.stop();
mMediaPlayer.release();
mMediaPlayer = null;
}
}

@Override
public void onDestroy() {
super.onDestroy();
stopPlayMusic();
Log.d(TAG, TAG + "---->onDestroy,停止服务");
// 重启自己
// Intent intent = new Intent(getApplicationContext(), MakeMeLive.class);
// startService(intent);
}
}
62 changes: 61 additions & 1 deletion app/src/main/java/io/virtualapp/home/SettingAct.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,18 @@
import android.annotation.TargetApi;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.ComponentName;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.ServiceConnection;
import android.content.res.Configuration;
import android.media.Ringtone;
import android.media.RingtoneManager;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.IBinder;
import android.preference.ListPreference;
import android.preference.Preference;
import android.preference.PreferenceActivity;
Expand Down Expand Up @@ -188,7 +191,8 @@ protected boolean isValidFragment(String fragmentName)
|| DataSyncPreferenceFragment.class.getName().equals(fragmentName)
|| NotificationPreferenceFragment.class.getName().equals(fragmentName)
|| SKResstart.class.getName().equals(fragmentName)
|| SKSettings.class.getName().equals(fragmentName);
|| SKSettings.class.getName().equals(fragmentName)
|| SKsetAppLiving.class.getName().equals(fragmentName);
}

/**
Expand Down Expand Up @@ -395,4 +399,60 @@ public boolean onOptionsItemSelected(MenuItem item)
return super.onOptionsItemSelected(item);
}
}

@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public static class SKsetAppLiving extends PreferenceFragment
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.pref_data_sync);
setHasOptionsMenu(true);

AlertDialog.Builder hDialog = new AlertDialog.Builder(getActivity());
hDialog.setMessage(R.string.non_stop);
hDialog.setTitle(R.string.SK_Settings).setNegativeButton(R.string.disable,
(dialog, which) ->
{
if (Once.beenDone("app_force_live"))
{
Once.clearDone("app_force_live");
}
Intent intent = new Intent(getActivity(), MakeMeLive.class);
getActivity().stopService(intent);
getActivity().finish();
});
hDialog.setPositiveButton(R.string.enable, (dialog, which) ->
{
if (!Once.beenDone("app_force_live"))
{
Once.markDone("app_force_live");
}
Intent intent = new Intent(getActivity(), MakeMeLive.class);
getActivity().startService(intent);
getActivity().finish();
})
.setCancelable(false);
hDialog.create().show();

// Bind the summaries of EditText/List/Dialog/Ringtone preferences
// to their values. When their values change, their summaries are
// updated to reflect the new value, per the Android Design
// guidelines.
bindPreferenceSummaryToValue(findPreference("sync_frequency"));
}

@Override
public boolean onOptionsItemSelected(MenuItem item)
{
int id = item.getItemId();
if (id == android.R.id.home)
{
startActivity(new Intent(getActivity(), SettingAct.class));
return true;
}
return super.onOptionsItemSelected(item);
}
}
}
5 changes: 3 additions & 2 deletions app/src/main/java/io/virtualapp/home/models/AppInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import android.graphics.drawable.Drawable;

import com.lody.virtual.server.pm.parser.VPackage;

/**
* @author Lody
*/
Expand All @@ -12,7 +14,6 @@ public class AppInfo {
public boolean fastOpen;
public Drawable icon;
public CharSequence name;
public CharSequence version;
public int cloneCount;
public boolean disableMultiVersion;
public VPackage.XposedModule xposedModule;
}
Binary file added app/src/main/res/raw/no_notice.mp3
Binary file not shown.
3 changes: 2 additions & 1 deletion app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<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="software_license">SandVXP开源软件协议介绍 为有效保护用户使用软件的透明纯净、安全稳定性与用户所享有软件的相关权益, 同时能更好有助于国内开源软件可持续发展,麦科技官网起草制定以下开源软件协议,命名为:SandVXP开源软件协议。 SandVXP开源软件协议将致力于推动软件透明、开源创新发展,主张完美主义、专注品质,并呼吁尊重原创版权、宣扬信守契约精神。 本软件为组织出品,完全免费开源,与本人公司无关,且软件为非盈利所用。 以下协议有使用简称 软件产品开发方:软件官方 软件产品使用者:用户 SandVXP开源软件协议约定 软件官方遵守协议约定 1) 禁止闭源发布源码程序,所有源码程序用户都可阅读。 2) 必须提供完整源码程序,可任何方式,如提供线上下载、光盘、磁盘拷贝。 3) 必须提供透明源码程序,禁止使用任何可逆或不可逆手段进行混淆源码程序。 4) 禁止任何侵权行为,包括软件的源码程序、资料文档、文件信息。 5) 禁止软件产品插入与软件官方无关的任何广告信息,包括文字、图像、媒体信息。 6) 禁止软件产品内置与软件官方程序应用无关的任何第三方插件程序、组件。 7) 禁止软件程序存在任何不经过用户许可的远程响应执行的控制程序。 8) SandVXP软件不对用户的使用后果付任何责任。 9) 请有保密需求的用户,注意本软件(以及其源码)是不对您的保密需求负责的。 10) 使用本软件源码务必注明原作者GanYao和Lixin Liang。并且必须注明软件出处。 11) 原版软件拥有收集用户匿名统计信息并上报的功能,特此声明。 用户遵守协议约定 1) 禁止用户修改软件官方任何的版权说明信息,包括程序的版权协议说明、软件官方链接、文字说明、图像标志、媒体信息。 2) 禁止用户通过任何方式破坏、侵犯软件官方的正常发展运营,包括软件官方程序的正常运行与商业授权机制。 协议使用与生效声明  使用SandVXP开源软件协议的软件官方需在源码程序注释注明使用SandVXP开源软件协议与附带协议说明文件, 用户自安装使用SandVXP开源协议的软件开始,协议将立即生效。 本协议随时改变,请重置应用信息以查看最新的软件协议声明。</string>
<string name="accept">接受</string>
<string name="appchoose_tips">您可以通过这个方式选择文件。稍后的文件浏览器请点击右上角菜单,点击显示内部存储,并手动点击内部存储选项以选择文件(EMUI是这样,不同UI实现不同)。请不要选择第三方文件管理器来打开文件。</string>
<string name="search">搜索</string>
Expand All @@ -67,4 +67,5 @@
<string name="sk_failed">失败</string>
<string name="unknown_package">正在安全模式当中,该应用未被识别,安装器已经阻止这一危险应用。如果您非常信任此应用,请在应用设置(右上菜单-设置)里禁用安全模式,安装以后请重新开启安全模式!</string>
<string name="still_safe">保持开启(推荐)</string>
<string name="non_stop">防止进程结束</string>
</resources>
Loading

0 comments on commit 40df6b6

Please sign in to comment.