Skip to content

Commit

Permalink
added customized skin func
Browse files Browse the repository at this point in the history
  • Loading branch information
nov30th committed Jan 7, 2022
1 parent df61cc8 commit fb1d121
Show file tree
Hide file tree
Showing 15 changed files with 236 additions and 74 deletions.
22 changes: 0 additions & 22 deletions .idea/compiler.xml

This file was deleted.

3 changes: 0 additions & 3 deletions .idea/copyright/profiles_settings.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/encodings.xml

This file was deleted.

12 changes: 5 additions & 7 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

61 changes: 51 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,66 @@
# 支付宝装X模块

Download latest \[2.3.0\](2021.09): https://hoho.im/download/im.hoho.alipayInstall_20210917.apk
Xposed module for Alipay App which makes you barcode payment interface same as Diamond members or customized skins.

Xposed module for Alipay App which makes you barcode payment interface same as Diamond members.
这是一个Xposed模块,它可以让你的支付宝付款背景为黑色钻石会员样式或自定义皮肤。

这是一个Xposed模块,它可以让你的支付宝付款背景为黑色钻石会员样式。
## 2022.01功能更新
新增了自定义皮肤功能,包含随机更换皮肤功能(每次展示二维码随机使用一个自定义皮肤)

注意,模块没有界面操作,需有一定IT和美工经验。

### 2021.07酷市场
酷市场由于审核机制原因,2021年07月被下架。
### 自定义皮肤说明
- 更新装X模块2.4.0版本。
- 手动下载DEMO资源包,放入SD卡根目录既可。(**[SD CARD]**\000_HOHO_ALIPAY_SKIN)

### 目录结构说明

命名|所属目录|含义|是否目录|手动创建|作用后文件消失
---|---|---|---|---|---
actived|000_HOHO_ALIPAY_SKIN|开启自定义皮肤功能|随意|是|否
update|000_HOHO_ALIPAY_SKIN|触发支付宝增量自定义皮肤缓存|随意|是|是
delete|000_HOHO_ALIPAY_SKIN|触发支付宝删除自定义皮肤缓存|随意|是|是
任意名称目录|000_HOHO_ALIPAY_SKIN|自定义皮肤文件夹|是|是|否
任意名称文件|000_HOHO_ALIPAY_SKIN|无作用|否|是|否

> 通常情况下,创建 update文件 时,请同时创建 delete文件 干净清除。
> 触发仅在展示二维码时有效,使用手动触发机制非自动为避免频繁IO操作影响目标程序。
> 自定义皮肤开启后,账号皮肤数据不会被修改或影响,仅本地切换。
> 多个皮肤之间随机数切换,没有去重,看你手机心情展示。
内容|所属目录|含义
---|---|---
z01.0001|皮肤子目录|付款码背景
z02.0001|皮肤子目录|付款码卡头背景颜色
z02.0002|皮肤子目录|付款码卡头中间logo
z02.0003|皮肤子目录|付款码卡头右侧水印

### 2021.09更新

***资源包已经包含3个作者画的DEMO与简单的PSD文件,请自行研究。***

<a href="images/IMG_20220107_085600.jpg"><img src="images/IMG_20220107_085600.jpg" height="600" /></a>
<a href="images/IMG_20220107_085742.jpg"><img src="images/IMG_20220107_085742.jpg" height="600" /></a>
<a href="images/IMG_20220107_085805.jpg"><img src="images/IMG_20220107_085805.jpg" height="600" /></a>
<a href="images/IMG_20220107_085719.jpg"><img src="images/IMG_20220107_085719.jpg" height="600" /></a>

## 2021.09更新
由于共享参数设置问题,之前版本在新版支付宝下会始终为默认初始大众会员。

作者时间原因及比较懒,直接去掉了设置界面,当前版本仅有单一的钻石会员背景。

### 以往的截图
## 2021.07酷市场
酷市场由于审核机制原因,2021年07月被下架。

## 以往的截图

<a href="Screenshot_Settings.png"><img src="Screenshot_Settings.png" height="600" alt="设置页面" /></a>
<a href="Screenshot_Alipay_Yuebao.png"><img src="Screenshot_Alipay_Yuebao.png" height="600" alt="余额宝显示" /></a>
<a href="Screenshot_Alipay_Diamond.jpg"><img src="Screenshot_Alipay_Diamond.jpg" height="600" alt="付款时背景" /></a>

![alt text](https://raw.githubusercontent.com/nov30th/AlipayHighHeadsomeRichAndroid/master/Screenshot_Settings.png "设置页面")
![alt text](https://raw.githubusercontent.com/nov30th/AlipayHighHeadsomeRichAndroid/master/Screenshot_Alipay_Yuebao.png "余额宝显示")
![alt text](https://raw.githubusercontent.com/nov30th/AlipayHighHeadsomeRichAndroid/master/Screenshot_Alipay_Diamond.jpg "付款时背景")
## APK
Download Mirror [下载镜像]: https://hoho.im/2017/08/21/high-headsome-rich-uploaded/

【作者自用】
Binary file added SD卡资源文件包/解压至SD根目录.zip
Binary file not shown.
6 changes: 4 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 21
targetSdkVersion 25
versionCode 51
versionName "2.3.0"
versionCode 62
versionName "2.4.0-Beta"
// testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand All @@ -31,6 +31,8 @@ dependencies {
// exclude group: 'com.android.support', module: 'support-annotations'
// })
compile 'com.android.support:appcompat-v7:25.4.0'
compile 'com.alibaba:fastjson:1.1.72.android'

// compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
}
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"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":51,"versionName":"2.3.0","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":62,"versionName":"2.4.0-Beta","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]
6 changes: 3 additions & 3 deletions app/src/main/java/im/hoho/alipayInstallB/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ protected void onCreate(Bundle savedInstanceState) {
listview = (ListView) findViewById(R.id.listview);
textView = (TextView) findViewById(R.id.textView2);

textView.setText("2.3.0 LTW");
textView.setText("2.4.0-Beta");

listview.setDividerHeight(0);//屏蔽掉listview的横线
listview.setDivider(null);

String[] listContent = {"Author: 裘小杰 - hoho.im",
"支付宝付款显示钻石会员背景。",
"适配支付宝10.2.33后(20210917),由于共享参数失效导致大众会员问题。",
"目前没有会员样式选择,只有钻石付款页面。"
"自定义付款码皮肤(可随机变换).",
"没有界面控件,请参考文档操作。",
};
ArrayAdapter<String> adapter = new ArrayAdapter<String>(
this,
Expand Down
192 changes: 172 additions & 20 deletions app/src/main/java/im/hoho/alipayInstallB/PluginMain.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
package im.hoho.alipayInstallB;

import android.os.Environment;

import com.alibaba.fastjson.JSON;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import de.robv.android.xposed.IXposedHookLoadPackage;
Expand All @@ -23,26 +34,167 @@ public void handleLoadPackage(final XC_LoadPackage.LoadPackageParam lpparam) thr

if (lpparam.packageName.contains("com.eg.android.AlipayGphone")) {
XposedBridge.log("Loaded App: " + lpparam.packageName);
XposedBridge.log("Powered by HOHO`` 20210917");

XposedHelpers.findAndHookMethod("com.alipay.mobilegw.biz.shared.processer.login.UserLoginResult", lpparam.classLoader, "getExtResAttrs", new Object[]{new XC_MethodHook() {
protected void afterHookedMethod(XC_MethodHook.MethodHookParam param1MethodHookParam) throws Throwable {
String str1;
XposedBridge.log("Now, let's install B...");
String diamond = "diamond";
Map<String, String> map = (Map) param1MethodHookParam.getResult();
if (map.containsKey("memberGrade")) {
XposedBridge.log("Original member grade: " + (String) map.get("memberGrade"));
XposedBridge.log("Putting " + diamond + " into dict...");
map.put("memberGrade", diamond);
XposedBridge.log("Member grade changed to: " + (String) map.get("memberGrade"));
str1 = "diamond";
} else {
XposedBridge.log("Can not get the member grade in return value...WTF?");
}
}
}
});
XposedBridge.log("Powered by HOHO`` 20220107");

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...");
String diamond = "diamond";
Map<String, String> map = (Map) param1MethodHookParam.getResult();
if (map.containsKey("memberGrade")) {
XposedBridge.log("Original member grade: " + (String) map.get("memberGrade"));
XposedBridge.log("Putting " + diamond + " into dict...");
map.put("memberGrade", diamond);
XposedBridge.log("Member grade changed to: " + (String) map.get("memberGrade"));
} else {
XposedBridge.log("Can not get the member grade in return value...WTF?");
}
}
});

//region modify skin

final Class<?> ConfigUtilBiz = lpparam.classLoader.loadClass("com.alipay.mobile.onsitepaystatic.ConfigUtilBiz");
final Class<?> OspSkinModel = lpparam.classLoader.loadClass("com.alipay.mobile.onsitepaystatic.skin.OspSkinModel");

XposedHelpers.findAndHookMethod("com.alipay.mobile.onsitepaystatic.ConfigUtilBiz",
lpparam.classLoader,
"getFacePaySkinModel",
new XC_MethodHook() {


public void deleteFile(File file) {
if (file.isDirectory()) {
File[] files = file.listFiles();
for (int i = 0; i < files.length; i++) {
File f = files[i];
deleteFile(f);
}
file.delete();
} else if (file.exists()) {
file.delete();
}
}

public int copy(String fromFile, String toFile) {
// XposedBridge.log("DEBUG: copy: " + fromFile + " to " + toFile);
File[] currentFiles;
File root = new File(fromFile);
if (!root.exists()) {
return -1;
}
currentFiles = root.listFiles();
File targetDir = new File(toFile);
if (!targetDir.exists()) {
targetDir.mkdirs();
}
for (int i = 0; i < currentFiles.length; i++) {
if (currentFiles[i].isDirectory())//如果当前项为子目录 进行递归
{
copy(currentFiles[i].getPath(), toFile + "/" + currentFiles[i].getName());

} else//如果当前项为文件则进行文件拷贝
{
CopySdcardFile(currentFiles[i].getPath(), toFile + "/" + currentFiles[i].getName());
}
}
return 0;
}

public int CopySdcardFile(String fromFile, String toFile) {

try {
InputStream fosfrom = new FileInputStream(fromFile);
OutputStream fosto = new FileOutputStream(toFile);
byte bt[] = new byte[1024];
int c;
while ((c = fosfrom.read(bt)) > 0) {
fosto.write(bt, 0, c);
}
fosfrom.close();
fosto.close();
return 0;

} catch (Exception ex) {
return -1;
}
}

public List<String> searchSkins(String Path) {
List<String> resultList = new ArrayList<>();
File[] files = new File(Path).listFiles();

for (int i = 0; i < files.length; i++) {
File f = files[i];
if (f.isDirectory()) {
if (f.getName().equals("update") ||
f.getName().equals("actived") ||
f.getName().equals("delete")
)
continue;
String filename = f.getName();
resultList.add(f.getName());
}
}
return resultList;
}

@Override
protected void afterHookedMethod(MethodHookParam param)
throws Throwable {

String fixedPathInAliData = "/data/data/com.eg.android.AlipayGphone/files/onsitepay_skin_dir/HOHO";
XposedBridge.log("DEBUG: fixedPathInAliData: " + fixedPathInAliData);
File hohoSkinFileInAliData = new File(fixedPathInAliData);

String fixedPathUpdates = Environment.getExternalStorageDirectory() + "/000_HOHO_ALIPAY_SKIN";
XposedBridge.log("DEBUG: skin SD card path: " + fixedPathUpdates);

File skinActived = new File(fixedPathUpdates + "/actived");
File skinUpdateRequired = new File(fixedPathUpdates + "/update");
File skinDeleteRequired = new File(fixedPathUpdates + "/delete");

if (skinDeleteRequired.exists()) {
XposedBridge.log("deleting skin...");
skinDeleteRequired.delete();
deleteFile(hohoSkinFileInAliData);
XposedBridge.log("skin is deleted");
}

if (skinUpdateRequired.exists()) {
XposedBridge.log("copying skin...");
skinUpdateRequired.delete();
if (!hohoSkinFileInAliData.exists())
hohoSkinFileInAliData.mkdirs();
copy(fixedPathUpdates, fixedPathInAliData);
XposedBridge.log("copied files..");
}

if (hohoSkinFileInAliData.exists() && skinActived.exists()) {
XposedBridge.log("updating skins..");
List<String> randomConf = searchSkins(fixedPathInAliData);
String subFolder = "";
if (randomConf.size() > 0) {
//random config
// XposedBridge.log("DEBUG: randomConf size: " + randomConf.size());
int pos = (int) (Math.random() * 100) % randomConf.size();
// CopySdcardFile(randomConf.get(pos), fixedPathInAliData + "/meta.json");
subFolder = randomConf.get(pos);
// XposedBridge.log("DEBUG: random, " + subFolder + " as current folder.");
}
String hohoSkinModel_Xiaomi12Pro = "{\"md5\":\"HOHO_MD5\",\"minWalletVersion\":\"10.2.23.0000\",\"outDirName\":\"HOHO/" + subFolder + "\",\"skinId\":\"HOHO_CUSTOMIZED\",\"skinStyleId\":\"2022 New Year Happy!\",\"userId\":\"HOHO\"}";
Object skinModel = JSON.parseObject(hohoSkinModel_Xiaomi12Pro, OspSkinModel);
param.setResult(skinModel);
XposedBridge.log("skin updated..");
} else {
XposedBridge.log("skin is not active.");
}
}
});
//endregion
}

}
Expand Down
Binary file added images/IMG_20220107_085600.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/IMG_20220107_085719.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/IMG_20220107_085742.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/IMG_20220107_085805.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit fb1d121

Please sign in to comment.