Skip to content

Commit

Permalink
UI finsihed
Browse files Browse the repository at this point in the history
  • Loading branch information
nov30th committed Oct 9, 2024
1 parent cc43687 commit 3744211
Show file tree
Hide file tree
Showing 4 changed files with 117 additions and 10 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
applicationId "im.hoho.alipayInstallB"
minSdkVersion 23
targetSdkVersion 33
versionCode 103
versionName "2.5.1"
versionCode 105
versionName "2.5.3"
// testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
namespace 'im.hoho.alipayInstallB'
Expand Down
68 changes: 63 additions & 5 deletions app/src/main/java/im/hoho/alipayInstallB/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

import android.Manifest;
import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.Color;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
Expand All @@ -22,11 +24,8 @@
import net.lingala.zip4j.exception.ZipException;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URL;
Expand All @@ -50,7 +49,7 @@ public class MainActivity extends Activity {
private ProgressBar progressBar;
private ExecutorService executorService;
private Handler mainHandler;

// private TextView tvPluginStatus;

@Override
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
Expand All @@ -64,12 +63,21 @@ public void onRequestPermissionsResult(int requestCode, String[] permissions, in
}
}
}
//
// @Override
// protected void onResume() {
// super.onResume();
// updatePluginStatus();
// }

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

// tvPluginStatus = findViewById(R.id.tvPluginStatus);
// updatePluginStatus();

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
if (!Environment.isExternalStorageManager()) {
Intent intent = new Intent(Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION);
Expand Down Expand Up @@ -116,6 +124,49 @@ public void onClick(View v) {
}
});

Button btnOpenResourceFolder = findViewById(R.id.btnOpenResourceFolder);
TextView tvGithubLink = findViewById(R.id.tvGithubLink);

btnOpenResourceFolder.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
File resourceFolder = new File(EXTRACT_PATH + "000_HOHO_ALIPAY_SKIN");
if (resourceFolder.exists() && resourceFolder.isDirectory()) {
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
Uri uri = Uri.parse(resourceFolder.getAbsolutePath());
intent.setDataAndType(uri, "*/*");
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.putExtra(Intent.EXTRA_LOCAL_ONLY, true);

try {
startActivity(Intent.createChooser(intent, "选择文件浏览器"));
} catch (ActivityNotFoundException e) {
// 如果没有找到文件管理器应用,尝试使用 ACTION_VIEW
intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(uri, "resource/folder");

if (intent.resolveActivityInfo(getPackageManager(), 0) != null) {
startActivity(intent);
} else {
Toast.makeText(MainActivity.this, "没有找到文件浏览器应用", Toast.LENGTH_SHORT).show();
}
}
} else {
Toast.makeText(MainActivity.this, "Resource package not installed", Toast.LENGTH_SHORT).show();
}
}
});

tvGithubLink.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String url = "https://github.com/nov30th/AlipayHighHeadsomeRichAndroid";
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(url));
startActivity(intent);
}
});

}

private void setupButtons() {
Expand Down Expand Up @@ -163,6 +214,13 @@ private void toggleFile(String filePath) {
Toast.makeText(this, "Reopen payment code to take effect", Toast.LENGTH_SHORT).show();
}

@Override
protected void onResume() {
super.onResume();
updateStatuses();
updateDownloadButtonText();
}

private void updateStatuses() {
updateStatus(ivExportStatus, EXPORT_FILE);
updateStatus(ivDeleteStatus, DELETE_FILE);
Expand All @@ -178,7 +236,7 @@ private void updateStatus(ImageView imageView, String filePath) {

private void updateDownloadButtonText() {
File skinFolder = new File(EXTRACT_PATH + "000_HOHO_ALIPAY_SKIN");
btnDownload.setText(skinFolder.exists() ? "Redownload Resources" : "Download Resources");
btnDownload.setText(skinFolder.exists() ? "Redownload Resources (GITHUB)" : "Download Resources (GITHUB)");
}

private void downloadAndExtract() {
Expand Down
9 changes: 8 additions & 1 deletion app/src/main/java/im/hoho/alipayInstallB/PluginMain.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package im.hoho.alipayInstallB;

import android.content.Context;
import android.content.SharedPreferences;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.os.Environment;
Expand All @@ -18,6 +19,7 @@

import de.robv.android.xposed.IXposedHookLoadPackage;
import de.robv.android.xposed.XC_MethodHook;
import de.robv.android.xposed.XSharedPreferences;
import de.robv.android.xposed.XposedBridge;
import de.robv.android.xposed.XposedHelpers;
import de.robv.android.xposed.callbacks.XC_LoadPackage;
Expand All @@ -26,13 +28,15 @@
* Created by qzj_ on 2016/5/9.
*/
public class PluginMain implements IXposedHookLoadPackage {
public static volatile boolean isModuleLoaded = false;

private static final String packageName = "com.eg.android.AlipayGphone";

public PluginMain() {
XposedBridge.log("Now Loading HOHO`` alipay plugin...");
}



@Override
public void handleLoadPackage(final XC_LoadPackage.LoadPackageParam lpparam) throws Throwable {

Expand All @@ -41,6 +45,9 @@ public void handleLoadPackage(final XC_LoadPackage.LoadPackageParam lpparam) thr
XposedBridge.log("Powered by HOHO`` 20230927 杭州亚运会版 sd source changed 20231129");
final boolean[] isDbUpdated = {false};

// 设置插件已加载状态
isModuleLoaded = true;

XposedHelpers.findAndHookMethod("com.alipay.mobilegw.biz.shared.processer.login.UserLoginResult", lpparam.classLoader, "getExtResAttrs", new XC_MethodHook() {
protected void afterHookedMethod(MethodHookParam param1MethodHookParam) throws Throwable {
XposedBridge.log("Now, let's install B...");
Expand Down
46 changes: 44 additions & 2 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,30 @@
android:orientation="vertical"
android:padding="16dp">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="Copyright © Nov30th, HOHO, 裘小杰"
android:layout_marginBottom="8dp"/>

<TextView
android:id="@+id/tvVersion"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="Version: 2.5.1"
android:text="Version: "
android:layout_marginBottom="24dp"/>

<!-- <TextView
android:id="@+id/tvPluginStatus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="插件:未加载"
android:textStyle="bold"
android:layout_marginBottom="8dp"/> -->

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand Down Expand Up @@ -107,7 +123,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Download Resources"/>
android:text="Download Resources (Github)" />

<ProgressBar
android:id="@+id/progressBar"
Expand All @@ -119,4 +135,30 @@
android:visibility="gone"/>
</LinearLayout>

<!-- 新添加的打开资源文件夹按钮 -->
<Button
android:id="@+id/btnOpenResourceFolder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Open Resource Folder"
android:layout_marginTop="16dp"/>

<!-- 新添加的 GitHub 链接 -->
<TextView
android:id="@+id/textView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="SD CARD/Android/media/com.eg.android.AlipayGphone/" />

<TextView
android:id="@+id/tvGithubLink"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="GITHUB REPO / 说明 / 项目源码"
android:textColor="#0000FF"
android:layout_gravity="center_horizontal"
android:layout_marginTop="16dp"
android:clickable="true"
android:focusable="true"/>

</LinearLayout>

0 comments on commit 3744211

Please sign in to comment.