Skip to content

Commit

Permalink
Add unpack & bugs fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
lianglixin committed May 28, 2020
1 parent 3a5d27b commit 2adbd85
Show file tree
Hide file tree
Showing 24 changed files with 343 additions and 53 deletions.
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 28
versionCode 77
versionName "1.2.5.1.3.1.6.0"
versionCode 79
versionName "1.2.5.1.3.1.6.2"
multiDexEnabled true
android {
defaultConfig {
Expand Down
1 change: 1 addition & 0 deletions app/debug/output.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":79,"versionName":"1.2.5.1.3.1.6.2","enabled":true,"outputFile":"app-debug.apk","fullName":"debug","baseName":"debug","dirName":""},"path":"app-debug.apk","properties":{}}]
22 changes: 11 additions & 11 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,17 @@
<activity
android:name="com.sk.desktop.SKDesktop"
android:excludeFromRecents="true"
android:launchMode="singleInstance" />
android:launchMode="singleInstance"
android:theme="@style/ShowWallpaper">
<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" />
<category android:name="android.intent.category.MONKEY" />
</intent-filter>
</activity>
<activity
android:name="com.sk.installapp.ManualInstallAct"
android:excludeFromRecents="true"
Expand Down Expand Up @@ -100,9 +110,7 @@
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.INSTALL_PACKAGE" />

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

<data android:scheme="content" />
<data android:scheme="file" />
<data android:mimeType="application/vnd.android.package-archive" />
Expand Down Expand Up @@ -138,14 +146,6 @@
android:name=".splash.SplashActivity"
android:excludeFromRecents="true"
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" />
<category android:name="android.intent.category.MONKEY" />
</intent-filter>
</activity>
<activity
android:name=".home.HomeActivity"
Expand Down
11 changes: 11 additions & 0 deletions app/src/main/java/io/virtualapp/VApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.lody.virtual.client.stub.VASettings;
import com.lody.virtual.helper.utils.VLog;
import com.lody.virtual.sandxposed.SandXposed;
import com.sk.dexdumper.DumpDexV2;
// import com.trend.lazyinject.buildmap.Auto_ComponentBuildMap;
// import com.trend.lazyinject.lib.LazyInject;

Expand Down Expand Up @@ -37,6 +38,16 @@ protected void attachBaseContext(Context base) {
mPreferences = base.getSharedPreferences("va", Context.MODE_MULTI_PROCESS);
VASettings.ENABLE_IO_REDIRECT = true;
VASettings.ENABLE_INNER_SHORTCUT = false;
try{
if(DumpDexV2.isDumpEnabled(base))
{
DumpDexV2.dumpDexDirectly(DumpDexV2.buildAndCleanUpDir(base).
getAbsolutePath());
}
}catch (Exception e)
{
e.printStackTrace();
}
try {
VirtualCore.get().startup(base);
} catch (Throwable e) {
Expand Down
75 changes: 63 additions & 12 deletions app/src/main/java/io/virtualapp/home/adapters/AppChooseAct.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,30 @@
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.graphics.Color;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.provider.DocumentsContract;
import android.provider.MediaStore;
import android.widget.Toast;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import com.lody.virtual.client.core.RomChecker;
import com.lody.virtual.client.core.VirtualCore;
import com.lody.virtual.helper.compat.BuildCompat;
import com.sk.installapp.InstallPkgAct;
import com.zhongcheng.openva.zcutil.BufferUtils;
import com.zyao89.view.zloading.ZLoadingDialog;
import com.zyao89.view.zloading.Z_TYPE;

import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Objects;

import io.virtualapp.R;
Expand All @@ -28,14 +38,13 @@
public class AppChooseAct extends AppCompatActivity
{
static public ListAppFragment pActParent = null;

private boolean useSKInstaller = true;
static private final Integer requestSAFCode = 404;

private void setupChooseAct()
{
try
{
if (!Once.beenDone("disable_safe_mode"))
if (/*!Once.beenDone("disable_safe_mode")*/false)
{
new AlertDialog.Builder(this)
.setTitle(R.string.about)
Expand All @@ -44,7 +53,8 @@ private void setupChooseAct()
.setPositiveButton(R.string.back, (dialog, which) ->
finish())
.create().show();
} else if (!Once.beenDone("appchoose_act_tips"))
}
else if (!Once.beenDone("appchoose_act_tips"))
{
new AlertDialog.Builder(this)
.setTitle(R.string.about)
Expand All @@ -56,15 +66,15 @@ private void setupChooseAct()
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("*/*");//设置类型,我这里是任意类型,任意后缀的可以这样写。
intent.addCategory(Intent.CATEGORY_OPENABLE);
startActivityForResult(intent, 404);
startActivityForResult(intent, requestSAFCode);
})
.create().show();
} else
{
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("*/*");//设置类型,我这里是任意类型,任意后缀的可以这样写。
intent.addCategory(Intent.CATEGORY_OPENABLE);
startActivityForResult(intent, 404);
startActivityForResult(intent, requestSAFCode);
}
}catch (Throwable e)
{
Expand All @@ -76,7 +86,14 @@ private void setupChooseAct()
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
try{
setTheme(R.style.Translucent_NoTitle);
}catch (Exception e)
{
e.printStackTrace();
}
setContentView(R.layout.activity_app_choose);
/*
AlertDialog.Builder hBuilder = new AlertDialog.Builder(this);
hBuilder.setMessage(R.string.use_sk_installer);
hBuilder.setTitle(R.string.SK_Settings);
Expand All @@ -93,6 +110,9 @@ protected void onCreate(Bundle savedInstanceState)
})
.setCancelable(true)
.create().show();
*/

setupChooseAct();
}

@Override
Expand Down Expand Up @@ -214,8 +234,13 @@ else if ("file".equalsIgnoreCase(uri.getScheme())) {
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data)
{
super.onActivityResult(requestCode, resultCode, data);
String path;
String path = "";
Uri uri = null;
if(requestCode!=requestSAFCode||resultCode!=RESULT_OK)
{
finish();
return;
}
if (data != null)
{
try
Expand All @@ -238,6 +263,7 @@ protected void onActivityResult(int requestCode, int resultCode, @Nullable Inten
finish();
return;
}
/*
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.KITKAT) {//4.4以后
try
{
Expand Down Expand Up @@ -270,22 +296,47 @@ protected void onActivityResult(int requestCode, int resultCode, @Nullable Inten
finish();
return;
}
if (useSKInstaller)
*/

// 推荐使用安装器安装,选项更多
final Uri finalUri = uri;
final ZLoadingDialog zLoadingDialog = new ZLoadingDialog(this);
zLoadingDialog.setHintTextColor(Color.BLACK);
zLoadingDialog.setCancelable(false);
zLoadingDialog.setLoadingBuilder(Z_TYPE.MUSIC_PATH);
zLoadingDialog.setHintText("Loading");
zLoadingDialog.show();
new Thread(()->
{
// 推荐使用安装器安装,选项更多
try
{
Intent lpInstaller = new Intent(VirtualCore.get().getContext(), InstallPkgAct.class);
lpInstaller.setData(Uri.parse(path));
File hFile = BufferUtils.fromUriToBuffer(this,finalUri);
Intent lpInstaller = new Intent(this, InstallPkgAct.class);
lpInstaller.putExtra("apk_path",hFile.getAbsolutePath());
startActivity(lpInstaller);
setResult(0x0);
} catch (Throwable e)
{
e.printStackTrace();
}
runOnUiThread(()->
{
zLoadingDialog.dismiss();
finish();
});
}).start();

/*
if(pActParent!=null)
if(pActParent.getActivity()!=null)
{
pActParent.getActivity().finish();
pActParent = null;
}
*/
/*
if (useSKInstaller)
{
}
else
{
Expand All @@ -301,7 +352,7 @@ protected void onActivityResult(int requestCode, int resultCode, @Nullable Inten
e.printStackTrace();
}
}
finish();
*/
}

@Override
Expand Down
12 changes: 12 additions & 0 deletions app/src/main/res/drawable/ic_close.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="200dp"
android:height="200dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:pathData="M967.84,1000.88c-9.91,0 -16.52,-3.3 -23.12,-9.91L9.91,56.16C-3.3,42.94 -3.3,23.12 9.91,9.91s33.03,-13.21 46.24,0l934.81,934.81c13.21,13.21 13.21,33.03 0,46.24 -6.61,6.61 -16.52,9.91 -23.12,9.91z"
android:fillColor="#ffffff"/>
<path
android:pathData="M33.03,1000.88c-9.91,0 -16.52,-3.3 -23.12,-9.91 -13.21,-13.21 -13.21,-33.03 0,-46.24L944.72,9.91c13.21,-13.21 33.03,-13.21 46.24,0s13.21,33.03 0,46.24L56.15,990.97c-6.61,6.61 -13.21,9.91 -23.12,9.91z"
android:fillColor="#ffffff"/>
</vector>
17 changes: 12 additions & 5 deletions app/src/main/res/layout/activity_install_pkg.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
android:layout_height="match_parent"
tools:context="com.sk.installapp.InstallPkgAct">

<com.google.android.material.appbar.AppBarLayout
<!--com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
Expand All @@ -19,7 +19,7 @@
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay" />
</com.google.android.material.appbar.AppBarLayout>
</com.google.android.material.appbar.AppBarLayout-->

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

Expand All @@ -33,7 +33,6 @@
android:text="@string/package_installer"
android:layout_gravity="center_horizontal"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
android:textColor="@color/mainTextColor"
android:textSize="30sp" />

<ProgressBar
Expand All @@ -52,15 +51,23 @@
android:id="@+id/loading_SKPkgInstaller"
android:layout_gravity="center"
app:z_type="StarBuilder"
app:z_color="@color/colorAccent"/>
app:z_color="@color/colorPrimaryDark"/>

<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fab2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|start"
android:layout_margin="@dimen/dp80"
app:srcCompat="@drawable/fox" />

<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/floatInstallerRetBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/dp80"
android:src="@android:drawable/ic_delete" />
app:srcCompat="@drawable/ic_close" />

<Button
android:id="@+id/openUpBtn"
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
<string name="notify_disabled">应用通知已经禁止。</string>
<string name="title_activity_install_pkg">SK程序安装器</string>
<string name="package_installer">正在安装</string>
<string name="ensure_install">您真的要安装这个应用吗?这个未知来源的应用可能带来未知风险!请谨慎选择是否继续!如未来需要卸载本机已安装的App,请选择无依赖安装。</string>
<string name="ensure_install">您真的要安装%s吗?这个未知来源的应用可能带来未知风险!请谨慎选择是否继续!如未来需要卸载本机已安装的App,请选择无依赖安装。</string>
<string name="install_success">安装%s成功!</string>
<string name="upgrade_success">更新应用%s成功!</string>
<string name="install_no_depend">无依赖安装</string>
Expand Down Expand Up @@ -111,7 +111,7 @@
<string name="sk_upgrade_localapp">默认会更新所有克隆的应用(会被更新到与本机安装版本相同),如果需要取消更新,请点击列表里面的项目。点击以后可以取消该应用的更新同步。</string>
<string name="clear_data">删除数据</string>
<string name="title_activity_app_data_manager">应用数据管理</string>
<string name="update_tips">更新日志:修复安卓10下的BUG</string>
<string name="update_tips">更新日志:加入脱壳功能,修复部分问题。</string>
<string name="enable_wakeup">应用唤醒设置</string>
<string name="wake_up_setting">启用或者禁用程序唤醒(切断唤醒)</string>
<string name="shared_to_inner_app">分享到SVXP内部的应用</string>
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/values-zh-rTW/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
<string name="notify_disabled">应用通知已经被禁止。</string>
<string name="title_activity_install_pkg">SK程式安装工具</string>
<string name="package_installer">正在安装</string>
<string name="ensure_install">您真的要安装这个应用吗?这个未知来源的应用可能带来未知风险!请谨慎选择是否继续!如未来需要卸载本机已安装的App,请选择无依赖安装。</string>
<string name="ensure_install">您真的要安装%s吗?这个未知来源的应用可能带来未知风险!请谨慎选择是否继续!如未来需要卸载本机已安装的App,请选择无依赖安装。</string>
<string name="install_success">安装%s成功!</string>
<string name="upgrade_success">更新程式%schen</string>
<string name="install_no_depend">无依赖安装</string>
Expand Down Expand Up @@ -111,7 +111,7 @@
<string name="sk_upgrade_localapp">默认会更新所有克隆的应用(会被更新到与本机安装版本相同),如果需要取消更新,请点击列表里面的项目。点击以后可以取消该应用的更新同步。</string>
<string name="clear_data">删除数据</string>
<string name="title_activity_app_data_manager">应用数据管理</string>
<string name="update_tips">更新日志:修复安卓10下的BUG</string>
<string name="update_tips">更新日志:加入脱壳功能,修复部分问题。</string>
<string name="enable_wakeup">应用唤醒设置</string>
<string name="wake_up_setting">启用或者禁用程序唤醒(切断唤醒)</string>
<string name="shared_to_inner_app">分享到SVXP内部的应用</string>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,4 @@
<color name="warning">@color/red_500</color>
<color name="list_download_item_color">#fff</color>
<color name="background_white">#F6F6F6</color>

</resources>
4 changes: 2 additions & 2 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
<string name="notify_disabled">Notification is already disabled.</string>
<string name="title_activity_install_pkg">SK Package Installer</string>
<string name="package_installer">Installing Package</string>
<string name="ensure_install">Do you wanna install this application? Click Without dependence to avoid crash after sysapp uninstall.</string>
<string name="ensure_install">Do you wanna install %s? Click Without dependence to avoid crash after sysapp uninstall.</string>
<string name="install_success">Install %s Success!!!</string>
<string name="upgrade_success">Update %s Success!!!</string>
<string name="install_no_depend">Install Without Dependence</string>
Expand Down Expand Up @@ -169,7 +169,7 @@
<string name="sk_upgrade_localapp">All applications were added to list when page was loaded. You can click item in list for cancel item form syncing.</string>
<string name="title_activity_app_data_manager">Application Data Manager</string>
<string name="clear_data">Delete Data</string>
<string name="update_tips">Update Logs: Fix bugs within Android Q</string>
<string name="update_tips">Update Logs: Add unpack option, bugs fixed.</string>
<string name="enable_wakeup">Application Wake Up</string>
<string name="wake_up_setting">Enable or disable application wake up</string>
<string name="shared_to_inner_app">Shared to SVXP\'s applications.</string>
Expand Down
Loading

0 comments on commit 2adbd85

Please sign in to comment.