Skip to content

Commit f5a5312

Browse files
committed
ZipUtils bindings
1 parent 5469257 commit f5a5312

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

bindings/2.2081/Cocos2d.bro

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5827,10 +5827,10 @@ class cocos2d::ZipUtils {
58275827
static gd::string compressString(gd::string const& data, bool encrypt, int encryptionKey) = imac 0x204f50, m1 0x1b10ac, ios 0x23d554;
58285828
static gd::string decompressString(gd::string const& data, bool encrypt, int encryptionKey) = imac 0x205600, m1 0x1b17c0, ios 0x23db3c;
58295829
static gd::string decompressString2(unsigned char* data, bool encrypt, int size, int encryptionKey) = imac 0x2052e0, m1 0x1b14a0, ios 0x23d8b4;
5830-
static gd::string encryptDecrypt(gd::string const& data, int encryptionKey);
5830+
static gd::string encryptDecrypt(gd::string const& data, int encryptionKey) = android inline, mac inline, ios inline;
58315831
static gd::string encryptDecryptWKey(gd::string const&, gd::string) = android inline, mac inline, ios inline;
5832-
static unsigned char hexToChar(gd::string const&);
5833-
static gd::string urlDecode(gd::string const&);
5832+
static unsigned char hexToChar(gd::string const&) = m1 0x1b24b0, imac 0x206250, ios 0x23e648;
5833+
static gd::string urlDecode(gd::string const&) = m1 0x1b2144, imac 0x205ec0, ios 0x23e3e0;
58345834
}
58355835

58365836
[[link(win, android)]]

bindings/2.2081/inline/ZipUtils.cpp

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
11
#include <Geode/Bindings.hpp>
22

33
#if defined(GEODE_IS_ANDROID) || defined(GEODE_IS_MACOS) || defined(GEODE_IS_IOS)
4+
gd::string cocos2d::ZipUtils::encryptDecrypt(gd::string const& p0, int p1) {
5+
std::string ret;
6+
ret.resize(p0.size());
7+
for (int i = 0; i < p0.size(); i++) {
8+
ret[i] = p0[i] ^ p1;
9+
}
10+
return ret;
11+
}
12+
413
gd::string cocos2d::ZipUtils::encryptDecryptWKey(gd::string const& p0, gd::string p1) {
5-
std::string ret;
6-
ret.resize(p0.size());
7-
for (int i = 0; i < p0.size(); i++) {
8-
ret[i] = p0[i] ^ p1[i % p1.size()];
9-
}
10-
return ret;
14+
std::string ret;
15+
ret.resize(p0.size());
16+
for (int i = 0; i < p0.size(); i++) {
17+
ret[i] = p0[i] ^ p1[i % p1.size()];
18+
}
19+
return ret;
1120
}
1221
#endif
1322

0 commit comments

Comments
 (0)