Skip to content

Commit

Permalink
Add Notification&App Settings
Browse files Browse the repository at this point in the history
  • Loading branch information
lianglixin committed Apr 29, 2019
1 parent f1fea07 commit 8922997
Show file tree
Hide file tree
Showing 30 changed files with 503 additions and 122 deletions.
14 changes: 10 additions & 4 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 28
versionName "1.2.5.1.3.1"
versionCode 30
versionName "1.2.5.1.3.1.1.1"
multiDexEnabled true
android {
defaultConfig {
Expand Down Expand Up @@ -93,9 +93,15 @@ android {

manifestPlaceholders = [
//AWV24BW39WRE 属于应用"VirtualApp"独有的 Android AppKey, 用于配置SDK
MTA_APPKEY:"AWV24BW39WRE",
MTA_APPKEY : "AWV24BW39WRE",
//标注应用推广渠道用以区分新用户来源,可填写如应用宝,豌豆荚等
MTA_CHANNEL:"VApp"
MTA_CHANNEL: "VApp"
]
}
}

android {
defaultConfig {
vectorDrawables.useSupportLibrary = true
}
}
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":28,"versionName":"1.2.5.1.3.1","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]
[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":30,"versionName":"1.2.5.1.3.1.1.1","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]
21 changes: 13 additions & 8 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme">
<activity
android:name="com.sk.listapp.XAppManager"
android:label="@string/title_activity_xapp_manager"
android:launchMode="singleInstance"></activity>
<activity
android:name=".home.ShortcutAppActivity"
android:launchMode="singleInstance"
android:exported="true">
android:exported="true"
android:launchMode="singleInstance">
<intent-filter>
<action android:name="com.sk.vxpmain" />

Expand All @@ -37,16 +41,17 @@
android:theme="@style/AppTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />

<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".home.HomeActivity"
android:launchMode="singleInstance"
android:screenOrientation="portrait"
android:theme="@style/UITheme">
</activity>
android:theme="@style/UITheme"></activity>
<activity
android:name=".home.ListAppActivity"
android:screenOrientation="portrait"
Expand Down Expand Up @@ -77,11 +82,11 @@
android:exported="false"
android:process=":x" />

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

</manifest>
18 changes: 16 additions & 2 deletions app/src/main/java/io/virtualapp/home/HomeActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import android.os.Handler;
import android.os.Looper;
import android.support.annotation.Nullable;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.OrientationHelper;
import android.support.v7.widget.PopupMenu;
Expand Down Expand Up @@ -308,6 +309,19 @@ public boolean onQueryTextChange(String newText)
Intent intent = new Intent(HomeActivity.this, MakeMeLive.class);
startService(intent);
}
SwipeRefreshLayout hRefreshControl = findViewById(R.id.swipeRefreshDesktop_HomeAct);
hRefreshControl.setOnRefreshListener(() ->
{
RefreshDesktop();
((SwipeRefreshLayout)findViewById(R.id.swipeRefreshDesktop_HomeAct))
.setRefreshing(false);
});
}

public void RefreshDesktop()
{
new HomePresenterImpl(HomeActivity.this).start();
listAppData = null;
}

@Override
Expand Down Expand Up @@ -513,15 +527,15 @@ public void InstallAppByPath(String szAppPath)
XAppDataInstalled hInstalled = new XAppDataInstalled();
hInstalled.pkgName=tempFile.getName();
addAppToLauncher(hInstalled);
Toast.makeText(HomeActivity.this,R.string.appInstallTip,Toast.LENGTH_LONG)
.show();
}

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (resultCode == RESULT_OK && data != null) {
List<String> pkg_Det = Arrays.asList(safePackage.safe_Package);
Toast.makeText(this,R.string.wait,Toast.LENGTH_LONG)
.show();
List<AppInfoLite> appList = data.getParcelableArrayListExtra(VCommends.EXTRA_APP_INFO_LIST);
if (appList != null) {
for (AppInfoLite info : appList) {
Expand Down
15 changes: 13 additions & 2 deletions app/src/main/java/io/virtualapp/home/ListAppFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.OrientationHelper;
import android.support.v7.widget.StaggeredGridLayoutManager;
import android.view.LayoutInflater;
Expand Down Expand Up @@ -101,20 +102,23 @@ public void onSearchAppByName(String szToSearch)
while (theItor.hasNext())
{
AppInfo theInfo = theItor.next();
if (theInfo.name.toString().indexOf(szToSearch) == -1)
if (!theInfo.name.toString().contains(szToSearch))
theItor.remove();
}
mAdapter.setList(theListChg);
}

private SearchView hSearch;
private SwipeRefreshLayout hLayoutSwipe;

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
if(getContext()==null)return;
if(getActivity()==null)return;
mRecyclerView = (DragSelectRecyclerView) view.findViewById(R.id.select_app_recycler_view);
mProgressBar = (ProgressBar) view.findViewById(R.id.select_app_progress_bar);
mInstallButton = (Button) view.findViewById(R.id.select_app_install_btn);
Button hButton = (Button) view.findViewById(R.id.buttonAddByPath);
android.support.design.widget.FloatingActionButton hButton = view.findViewById(R.id.buttonAddByPath);
Button hSearchButton = (Button) view.findViewById(R.id.search_app_m);
if (Once.beenDone("enable_search_app"))
{
Expand Down Expand Up @@ -194,6 +198,13 @@ public boolean onQueryTextChange(String newText)
return false;
}
});
hLayoutSwipe = view.findViewById(R.id.swipeRefreshInstalled);
hLayoutSwipe.setOnRefreshListener(() ->
{
new ListAppPresenterImpl(getActivity(),
ListAppFragment.this, getSelectFrom()).start();
hLayoutSwipe.setRefreshing(false);
});
startRemoteThread();
}

Expand Down
25 changes: 5 additions & 20 deletions app/src/main/java/io/virtualapp/home/SettingAct.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import android.widget.Toast;

import com.lody.virtual.client.ipc.VActivityManager;
import com.sk.listapp.XAppManager;

import io.virtualapp.R;
import io.virtualapp.VApp;
Expand Down Expand Up @@ -213,11 +214,7 @@ public void onCreate(Bundle savedInstanceState)
hDialog.setPositiveButton(R.string.back, (dialog, which) ->
getActivity().finish());
hDialog.setNegativeButton(R.string.desktop, (dialog, which) ->
{
HomeActivity.hHomeAct.finish();
HomeActivity.goHome(getActivity());
getActivity().finish();
}).setCancelable(false).create().show();
getActivity().finish()).setCancelable(false).create().show();
}

@Override
Expand Down Expand Up @@ -345,21 +342,9 @@ public static class SKSettings extends PreferenceFragment
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
android.widget.Toast.makeText(VApp.getApp(), R.string.SK_Thecoming, android.widget.Toast.LENGTH_LONG).show();
addPreferencesFromResource(R.xml.pref_appset);
setHasOptionsMenu(true);
/* TODO: implement function. */
AlertDialog.Builder hDialog = new AlertDialog.Builder(getActivity());
hDialog.setMessage(R.string.SK_Thecoming);
hDialog.setTitle("The coming...").setNegativeButton(R.string.back,
(dialog, which) -> getActivity().finish());
hDialog.setPositiveButton(R.string.desktop, (dialog, which) ->
{
HomeActivity.goHome(getActivity());
getActivity().finish();
});
hDialog.create().show();
/* TODO: implement function. */
Intent hAppInfoSettings=new Intent(getActivity(), XAppManager.class);
getActivity().startActivity(hAppInfoSettings);
getActivity().finish();
}

@Override
Expand Down
33 changes: 26 additions & 7 deletions app/src/main/java/io/virtualapp/home/XposedManagerActivity.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package io.virtualapp.home;

import android.os.Bundle;
import android.support.design.widget.Snackbar;
import android.support.v7.app.ActionBar;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.SwitchCompat;
import android.view.View;
import android.widget.Toast;

import com.lody.virtual.sandxposed.XposedConfig;
Expand Down Expand Up @@ -38,14 +40,31 @@ public class XposedManagerActivity extends VActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_xposed_manager);
setSupportActionBar(findViewById(R.id.toolbar));
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true);
try
{
setContentView(R.layout.activity_xposed_manager);
setSupportActionBar(findViewById(R.id.toolbar));
ActionBar actionBar = getSupportActionBar();
if (actionBar != null)
{
actionBar.setDisplayHomeAsUpEnabled(true);
}
initXposedGlobalSettings();
initModuleList();
}
catch (Throwable e)
{
if(HomeActivity.hHomeAct!=null)
{
Snackbar.make(HomeActivity.hHomeAct.getWindow().getDecorView(),R.string.launch_failed
,Snackbar.LENGTH_LONG)
.setAction(R.string.refresh, v ->
HomeActivity.hHomeAct.RefreshDesktop())
.show();
}
e.printStackTrace();
finish();
}
initXposedGlobalSettings();
initModuleList();
android.widget.Toast.makeText(this,R.string.SKRestartTips, Toast.LENGTH_LONG).show();
}

Expand Down
77 changes: 50 additions & 27 deletions app/src/main/java/io/virtualapp/home/location/MarkerActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,33 +50,43 @@ public class MarkerActivity extends VActivity implements TencentMap.OnMapClickLi
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_marker);
setResult(Activity.RESULT_CANCELED);
Toolbar toolbar = bind(R.id.task_top_toolbar);
setSupportActionBar(toolbar);
//地址显示,暂时不用
pathText = bind(R.id.address);
pathText.setVisibility(View.VISIBLE);
enableBackHome();
mapView = (MapView) findViewById(R.id.map);
mapView.onCreate(savedInstanceState); // 此方法必须重写
mMap = mapView.getMap();
mMap.setOnMapClickListener(this);
geocoderSearch = new TencentSearch(this);
//
Intent data = getIntent();
if (data != null) {
mVLocation = data.getParcelableExtra(EXTRA_LOCATION);
if (mVLocation != null && mVLocation.latitude != 0 && mVLocation.longitude != 0) {
mLatLng = new LatLng(mVLocation.latitude, mVLocation.longitude);
isNoPoint = false;
try
{
setContentView(R.layout.activity_marker);
setResult(Activity.RESULT_CANCELED);
Toolbar toolbar = bind(R.id.task_top_toolbar);
setSupportActionBar(toolbar);
//地址显示,暂时不用
pathText = bind(R.id.address);
pathText.setVisibility(View.VISIBLE);
enableBackHome();
mapView = (MapView) findViewById(R.id.map);
mapView.onCreate(savedInstanceState); // 此方法必须重写
mMap = mapView.getMap();
mMap.setOnMapClickListener(this);
geocoderSearch = new TencentSearch(this);
//
Intent data = getIntent();
if (data != null)
{
mVLocation = data.getParcelableExtra(EXTRA_LOCATION);
if (mVLocation != null && mVLocation.latitude != 0 && mVLocation.longitude != 0)
{
mLatLng = new LatLng(mVLocation.latitude, mVLocation.longitude);
isNoPoint = false;
}
}
}

if (isNoPoint) {
startLocation();
} else {
onMapClick(mLatLng);
if (isNoPoint)
{
startLocation();
} else
{
onMapClick(mLatLng);
}
}catch(Throwable e)
{
e.printStackTrace();
}
}

Expand Down Expand Up @@ -122,7 +132,13 @@ public void onStatusUpdate(String s, int i, String s1) {

@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.marktet_map, menu);
try
{
getMenuInflater().inflate(R.menu.marktet_map, menu);
}catch(Throwable e)
{
e.printStackTrace();
}
return true;
}

Expand Down Expand Up @@ -203,7 +219,14 @@ public void onSuccess(int i, BaseObject object) {

@Override
public void onFailure(int i, String s, Throwable throwable) {
dialog.dismiss();
try
{
dialog.dismiss();
}
catch (Throwable e)
{
e.printStackTrace();
}
pathText.setText("error:" + s);
}
});
Expand Down
7 changes: 7 additions & 0 deletions app/src/main/java/io/virtualapp/home/models/safePackage.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ public class safePackage
{
static public String safe_Package[] =
{
"com.qiyi.video",//爱奇艺
"com.changba",//唱吧
"com.dianping.v1",//大众点评
"com.jingdong.app.mall",//京东
"com.sankuai.meituan.takeoutnew",//美团
"com.smile.gifmaker",//快手

"com.dahuo.sunflower.xp.none",
"com.ext.star.wars",
"bin.xposed.Unblock163MusicClient",//网易云音乐破解
Expand Down
Loading

0 comments on commit 8922997

Please sign in to comment.