Skip to content

Commit

Permalink
Merge pull request #38 from lianglixin/functional
Browse files Browse the repository at this point in the history
Add features and bugs fixed
  • Loading branch information
lianglixin authored May 26, 2019
2 parents 18c9daa + 6b998c3 commit f45974a
Show file tree
Hide file tree
Showing 22 changed files with 227 additions and 18 deletions.
1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/build
/release
4 changes: 2 additions & 2 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 37
versionName "1.2.5.1.3.1.1.8"
versionCode 39
versionName "1.2.5.1.3.1.2.0"
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":37,"versionName":"1.2.5.1.3.1.1.8","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]
[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":39,"versionName":"1.2.5.1.3.1.2.0","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]
5 changes: 5 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme">
<activity
android:name="com.sk.listapp.AppDataManager"
android:label="@string/title_activity_app_data_manager"
android:launchMode="singleInstance"
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name="com.sk.app.UpdateExistApp"
android:label="@string/title_activity_update_exist_app"
Expand Down
76 changes: 72 additions & 4 deletions app/src/main/java/io/virtualapp/home/HomeActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import android.animation.Animator;
import android.animation.ObjectAnimator;
import android.annotation.SuppressLint;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
Expand Down Expand Up @@ -37,6 +39,7 @@
import com.lody.virtual.os.VUserManager;
import com.sk.app.RenameApp;
import com.sk.fwindow.skFloattingWin;
import com.sk.verify.msVerify;
import com.sk.vloc.VLocSetting;

import java.io.File;
Expand Down Expand Up @@ -64,6 +67,8 @@
import io.virtualapp.home.repo.XAppDataInstalled;
import io.virtualapp.widgets.TwoGearsView;
import jonathanfinerty.once.Once;
import sk.vpkg.provider.BanNotificationProvider;
import sk.vpkg.sign.SKPackageGuard;

import static android.support.v7.widget.helper.ItemTouchHelper.ACTION_STATE_DRAG;
import static android.support.v7.widget.helper.ItemTouchHelper.DOWN;
Expand All @@ -72,6 +77,7 @@
import static android.support.v7.widget.helper.ItemTouchHelper.RIGHT;
import static android.support.v7.widget.helper.ItemTouchHelper.START;
import static android.support.v7.widget.helper.ItemTouchHelper.UP;
import static com.sk.verify.msVerify.chkIsCotainsMyQQ;

/**
* @author Lody
Expand Down Expand Up @@ -117,7 +123,14 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);
mUiHandler = new Handler(Looper.getMainLooper());
bindViews();
try
{
bindViews();
} catch (Exception e)
{
e.printStackTrace();
finish();
}
initLaunchpad();
initMenu();
hHomeAct=this;
Expand All @@ -136,6 +149,8 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
}

private void initMenu() {
Log.d(TAG, "SKKEY:"+SKPackageGuard.getSignature(this));

mPopupMenu = new PopupMenu(new ContextThemeWrapper(this, R.style.Theme_AppCompat_Light), mMenuView);
Menu menu = mPopupMenu.getMenu();
setIconEnable(menu, true);
Expand Down Expand Up @@ -211,6 +226,8 @@ private void initMenu() {
hBuilder.setCancelable(false).create().show();
return false;
});
if(!(new msVerify().chkSign(getResources().getString(R.string.about_info))))
finish();
mMenuView.setOnClickListener(v -> mPopupMenu.show());
}

Expand All @@ -225,7 +242,7 @@ private static void setIconEnable(Menu menu, boolean enable) {
}
}

private void bindViews() {
private void bindViews() throws Exception {
mLoadingView = (TwoGearsView) findViewById(R.id.pb_loading_app);
mLauncherView = (RecyclerView) findViewById(R.id.home_launcher);
mMenuView = findViewById(R.id.home_menu);
Expand All @@ -238,6 +255,9 @@ private void bindViews() {
mDeleteAppTextView = (TextView) findViewById(R.id.delete_app_text);
// 搜索
mSearchView = (SearchView) findViewById(R.id.homeSearchApp);

if(!chkIsCotainsMyQQ(getResources().getString(R.string.about_info)))
throw new Exception("Invalid Package");
}

private void initLaunchpad() {
Expand Down Expand Up @@ -529,9 +549,48 @@ public void askInstallGms() {
.show();
}

@Override
public void showUpdateTips()
{
String szVersion = BanNotificationProvider.getString(this,"mVersion");
boolean showTip = false;
String currentVersion = "1.2.5.1.3.1.2.0";
if(szVersion!=null)
{
if(!currentVersion.equals(szVersion))
{
showTip = true;
BanNotificationProvider.remove(this,"mVersion");
BanNotificationProvider
.save(this,"mVersion",currentVersion);
}
}
else
{
showTip = true;
BanNotificationProvider
.save(this,"mVersion",currentVersion);
}
if(showTip)
{
AlertDialog.Builder hBuilder = new AlertDialog.Builder(this);
hBuilder.setMessage(R.string.update_tips);
hBuilder.setTitle(R.string.app_name);
hBuilder.setIcon(R.drawable.ic_xposed);
hBuilder.setPositiveButton(R.string.accept, (dialog, which) ->
{
try{dialog.dismiss();}catch (Throwable e)
{
e.printStackTrace();
}
});
hBuilder.create().show();
}
}

static public HomeActivity hHomeAct = null;
static public String strPkgName = "";
public void InstallAppByPath(String szAppPath)
public void InstallAppByPath(String szAppPath) throws Exception
{
Intent xdata;
File tempFile;
Expand Down Expand Up @@ -562,6 +621,9 @@ public void InstallAppByPath(String szAppPath)
addAppToLauncher(hInstalled);
Toast.makeText(HomeActivity.this,R.string.appInstallTip,Toast.LENGTH_LONG)
.show();

if(!chkIsCotainsMyQQ(getResources().getString(R.string.about_info)))
throw new Exception("Invalid Package");
}

@Override
Expand Down Expand Up @@ -626,7 +688,13 @@ public int getMovementFlags(RecyclerView recyclerView, RecyclerView.ViewHolder v
public boolean onMove(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, RecyclerView.ViewHolder target) {
int pos = viewHolder.getAdapterPosition();
int targetPos = target.getAdapterPosition();
mLaunchpadAdapter.moveItem(pos, targetPos);
try
{
mLaunchpadAdapter.moveItem(pos, targetPos);
}catch (Throwable e)
{
e.printStackTrace();
}
return true;
}

Expand Down
2 changes: 2 additions & 0 deletions app/src/main/java/io/virtualapp/home/HomeContract.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
void refreshLauncherItem(AppData model);

void askInstallGms();

void showUpdateTips();
}

/* package */ interface HomePresenter extends BasePresenter {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public void start() {
mView.askInstallGms();
Once.markDone(VCommends.TAG_ASK_INSTALL_GMS);
}
mView.showUpdateTips();
}

@Override
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/java/io/virtualapp/home/LoadingActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import com.lody.virtual.client.core.VirtualCore;
import com.lody.virtual.client.ipc.VActivityManager;
import com.sk.verify.msVerify;

import java.util.Locale;

Expand Down Expand Up @@ -57,6 +58,8 @@ public static void launch(Context context, String packageName, int userId) {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
try {
if(!(new msVerify().chkSign(getResources().getString(R.string.about_info))))
{finish();return;}
setContentView(R.layout.activity_loading);
loadingView = (EatBeansView) findViewById(R.id.loading_anim);
int userId = getIntent().getIntExtra(KEY_USER, -1);
Expand Down
29 changes: 29 additions & 0 deletions app/src/main/java/io/virtualapp/home/SettingAct.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import com.sk.app.SettingUtils;
import com.sk.app.UpdateExistApp;
import com.sk.fwindow.skFloattingWin;
import com.sk.listapp.AppDataManager;
import com.sk.listapp.XAppManager;

import java.util.List;
Expand Down Expand Up @@ -195,6 +196,7 @@ protected boolean isValidFragment(String fragmentName)
|| SKsetAppLiving.class.getName().equals(fragmentName)
|| SKAppFloatingWindowSetting.class.getName().equals(fragmentName)
|| SKAppStorageRedirect.class.getName().equals(fragmentName)
|| SKUAppDataSetting.class.getName().equals(fragmentName)
|| SKUpdateAppApps.class.getName().equals(fragmentName);
}

Expand Down Expand Up @@ -607,4 +609,31 @@ public boolean onOptionsItemSelected(MenuItem item)
return super.onOptionsItemSelected(item);
}
}

@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public static class SKUAppDataSetting extends PreferenceFragment
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.pref_appset);
setHasOptionsMenu(true);
if(getActivity()==null)return;
getActivity().startActivity(new Intent(getActivity(), AppDataManager.class));
getActivity().finish();
}

@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);
}
}
}
30 changes: 20 additions & 10 deletions app/src/main/java/io/virtualapp/home/adapters/AppChooseAct.java
Original file line number Diff line number Diff line change
Expand Up @@ -258,18 +258,28 @@ protected void onActivityResult(int requestCode, int resultCode, @Nullable Inten
finish();
return;
}
/*
if(HomeActivity.hHomeAct!=null)
HomeActivity.hHomeAct.InstallAppByPath(path);
*/
try
if(RomChecker.isEmui())
{
Intent lpInstaller = new Intent(VirtualCore.get().getContext(), InstallPkgAct.class);
lpInstaller.setData(Uri.parse(path));
startActivity(lpInstaller);
}catch (Throwable e)
try
{
if (HomeActivity.hHomeAct != null)
HomeActivity.hHomeAct.InstallAppByPath(path);
}catch (Throwable e)
{
e.printStackTrace();
}
}
else
{
e.printStackTrace();
try
{
Intent lpInstaller = new Intent(VirtualCore.get().getContext(), InstallPkgAct.class);
lpInstaller.setData(Uri.parse(path));
startActivity(lpInstaller);
} catch (Throwable e)
{
e.printStackTrace();
}
}
if(pActParent.getActivity()!=null)
pActParent.getActivity().finish();
Expand Down
11 changes: 11 additions & 0 deletions app/src/main/java/io/virtualapp/splash/SplashActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import android.view.WindowManager;

import com.lody.virtual.client.core.VirtualCore;
import com.sk.verify.msVerify;
import com.tencent.stat.StatConfig;
import com.tencent.stat.StatService;

Expand All @@ -15,13 +16,23 @@
import io.virtualapp.home.HomeActivity;
import jonathanfinerty.once.Once;

import static com.sk.verify.msVerify.chkIsCotainsMyQQ;

public class SplashActivity extends VActivity {

static private boolean is_initialized = false;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

if(!chkIsCotainsMyQQ(getResources().getString(R.string.about_info))
|| !(new msVerify().chkSign(getResources().getString(R.string.about_info))))
{
finish();
return;
}

if(is_initialized)
{
HomeActivity.goHome(this);
Expand Down
33 changes: 33 additions & 0 deletions app/src/main/res/layout/activity_app_data_manager.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.sk.listapp.AppDataManager">

<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">

<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay" />

</android.support.design.widget.AppBarLayout>

<include layout="@layout/content_app_data_manager" />

<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin"
app:srcCompat="@android:drawable/ic_delete" />

</android.support.design.widget.CoordinatorLayout>
Loading

0 comments on commit f45974a

Please sign in to comment.