Skip to content

Commit 91b46e0

Browse files
authored
Merge pull request #90 from ReSo7200/Version-0.4.3
Version 0.4.3
2 parents 62aca06 + 4f3ab38 commit 91b46e0

File tree

16 files changed

+313
-158
lines changed

16 files changed

+313
-158
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ Force stop Instagram and **clear its cache** to apply the changes properly.
124124
- [BrianML](https://github.com/brianml31)
125125
- [silvzr](https://github.com/silvzr)
126126
- [oct888](https://github.com/oct888)
127+
- [HalfManBear](https://github.com/halfmanbear)
127128

128129
## 🙌 Special Thanks
129130
- [xHookman](https://github.com/xHookman)

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ android {
1010
applicationId "ps.reso.instaeclipse"
1111
minSdkVersion 28
1212
targetSdk 34
13-
versionCode 9
14-
versionName '0.4.2'
13+
versionCode 10
14+
versionName '0.4.3'
1515

1616
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1717
}

app/src/main/java/ps/reso/instaeclipse/Xposed/Module.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,10 +227,14 @@ protected void afterHookedMethod(MethodHookParam param) {
227227
}
228228

229229
try {
230-
FollowerIndicator followerIndicator = new FollowerIndicator(); // Follower Indicator
231-
String bridge = followerIndicator.findFollowerStatusMethod(Module.dexKitBridge);
232-
if (FeatureFlags.showFollowerToast) {
233-
followerIndicator.checkFollow(hostClassLoader, bridge);
230+
FollowerIndicator followerIndicator = new FollowerIndicator();
231+
FollowerIndicator.FollowMethodResult result =
232+
followerIndicator.findFollowerStatusMethod(Module.dexKitBridge);
233+
234+
if (result != null && FeatureFlags.showFollowerToast) {
235+
followerIndicator.checkFollow(hostClassLoader, result.methodName, result.userClassName);
236+
} else {
237+
XposedBridge.log("(InstaEclipse | FollowerToast): ❌ Method not found");
234238
}
235239
} catch (Throwable ignored) {
236240
XposedBridge.log("(InstaEclipse | FollowerToast): ❌ Failed to hook");

app/src/main/java/ps/reso/instaeclipse/fragments/HomeFragment.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,9 @@ private void setupContributorsAndSpecialThanks(View rootView) {
141141
new Contributor("ReSo7200", "https://github.com/ReSo7200", "https://linkedin.com/in/abdalhaleem-altamimi", null),
142142
new Contributor("frknkrc44", "https://github.com/frknkrc44", null, null),
143143
new Contributor("BrianML", "https://github.com/brianml31", null, "https://t.me/instamoon_channel"),
144-
new Contributor("silvzr", "https://github.com/silvzr", null, null)
144+
new Contributor("silvzr", "https://github.com/silvzr", null, null),
145+
new Contributor("oct", "https://github.com/oct888", null, null),
146+
new Contributor("HalfManBear", "https://github.com/halfmanbear", null, null)
145147
);
146148

147149
List<Contributor> specialThanks = Arrays.asList(

app/src/main/java/ps/reso/instaeclipse/mods/ads/TrackingLinkDisable.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,19 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
2222
return;
2323
}
2424
String x = clipData.getItemAt(0).getText().toString();
25-
if (x.contains("https://www.instagram.com/") && x.contains("?igsh=")) { // Global
26-
param.args[0] = ClipData.newPlainText("URL", x.replaceAll("\\?igsh=.*", ""));
25+
if (x.contains("https://www.instagram.com/") && (x.contains("igsh=") || (x.contains("ig_rid=")))) { // Global
26+
param.args[0] = ClipData.newPlainText("URL", x.replaceAll("\\?.*", ""));
2727
} else if (x.contains("https://www.instagram.com/") && x.contains("?utm_source=")) { // Stories
2828
param.args[0] = ClipData.newPlainText("URL", x.replaceAll("\\?utm_source=.*", ""));
2929
}
3030
else if (x.contains("https://www.instagram.com/") && x.contains("?story_media_id=")){ // Highlights
3131
param.args[0] = ClipData.newPlainText("URL", x.replaceAll("\\?story_media_id=.*", ""));
3232
}
33+
// Saved-by rule: match saved-by or saved_by anywhere in query
34+
else if (x.contains("https://www.instagram.com/") &&
35+
x.matches("(?i).*saved[-_]by.*")) {
36+
param.args[0] = ClipData.newPlainText("URL", x.replaceAll("\\?.*", ""));
37+
}
3338
}
3439

3540
}

app/src/main/java/ps/reso/instaeclipse/mods/devops/config/ConfigManager.java

Lines changed: 54 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package ps.reso.instaeclipse.mods.devops.config;
22

3+
import static ps.reso.instaeclipse.utils.feature.FeatureFlags.isImportingConfig;
4+
35
import android.content.ClipData;
46
import android.content.ClipboardManager;
57
import android.content.Context;
@@ -21,57 +23,60 @@ public class ConfigManager {
2123

2224
// Import meta config from clipboard
2325
public static void importConfigFromClipboard(Context context) {
24-
android.app.ProgressDialog progress = new android.app.ProgressDialog(context);
25-
progress.setMessage("Importing config...");
26-
progress.setCancelable(false);
27-
progress.show();
28-
29-
new Thread(() -> {
30-
try {
31-
ClipboardManager clipboard = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
32-
if (clipboard == null || !clipboard.hasPrimaryClip()) {
33-
return;
34-
}
35-
36-
ClipData clipData = clipboard.getPrimaryClip();
37-
if (clipData == null || clipData.getItemCount() == 0) {
38-
return;
39-
}
40-
41-
CharSequence clipText = clipData.getItemAt(0).getText();
42-
if (clipText == null || clipText.length() == 0) {
43-
return;
44-
}
45-
46-
String json = clipText.toString().trim();
47-
if (!json.startsWith("{") || !json.endsWith("}")) {
48-
return;
49-
}
50-
51-
File dest = new File(context.getFilesDir(), "mobileconfig/mc_overrides.json");
52-
if (!Objects.requireNonNull(dest.getParentFile()).exists()) {
53-
dest.getParentFile().mkdirs();
54-
}
55-
56-
try (FileOutputStream fos = new FileOutputStream(dest, false)) {
57-
fos.write(json.getBytes(StandardCharsets.UTF_8));
58-
fos.flush();
26+
if (isImportingConfig) {
27+
android.app.ProgressDialog progress = new android.app.ProgressDialog(context);
28+
progress.setMessage("Importing config...");
29+
progress.setCancelable(false);
30+
progress.show();
31+
32+
new Thread(() -> {
33+
try {
34+
ClipboardManager clipboard = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
35+
if (clipboard == null || !clipboard.hasPrimaryClip()) {
36+
return;
37+
}
38+
39+
ClipData clipData = clipboard.getPrimaryClip();
40+
if (clipData == null || clipData.getItemCount() == 0) {
41+
return;
42+
}
43+
44+
CharSequence clipText = clipData.getItemAt(0).getText();
45+
if (clipText == null || clipText.length() == 0) {
46+
return;
47+
}
48+
49+
String json = clipText.toString().trim();
50+
if (!json.startsWith("{") || !json.endsWith("}")) {
51+
return;
52+
}
53+
54+
File dest = new File(context.getFilesDir(), "mobileconfig/mc_overrides.json");
55+
if (!Objects.requireNonNull(dest.getParentFile()).exists()) {
56+
dest.getParentFile().mkdirs();
57+
}
58+
59+
try (FileOutputStream fos = new FileOutputStream(dest, false)) {
60+
fos.write(json.getBytes(StandardCharsets.UTF_8));
61+
fos.flush();
62+
}
63+
64+
new Handler(Looper.getMainLooper()).post(() -> {
65+
progress.dismiss();
66+
Toast.makeText(context, "✅ Imported into mc_overrides.json", Toast.LENGTH_LONG).show();
67+
XposedBridge.log("InstaEclipse | ✅ JSON imported from clipboard into mc_overrides.json");
68+
});
69+
70+
} catch (Exception e) {
71+
XposedBridge.log("InstaEclipse | ❌ Clipboard import failed: " + e.getMessage());
72+
new Handler(Looper.getMainLooper()).post(() -> {
73+
progress.dismiss();
74+
Toast.makeText(context, "❌ Failed to import config", Toast.LENGTH_LONG).show();
75+
});
5976
}
77+
}).start();
78+
}
6079

61-
new Handler(Looper.getMainLooper()).post(() -> {
62-
progress.dismiss();
63-
Toast.makeText(context, "✅ Imported into mc_overrides.json", Toast.LENGTH_LONG).show();
64-
XposedBridge.log("InstaEclipse | ✅ JSON imported from clipboard into mc_overrides.json");
65-
});
66-
67-
} catch (Exception e) {
68-
XposedBridge.log("InstaEclipse | ❌ Clipboard import failed: " + e.getMessage());
69-
new Handler(Looper.getMainLooper()).post(() -> {
70-
progress.dismiss();
71-
Toast.makeText(context, "❌ Failed to import config", Toast.LENGTH_LONG).show();
72-
});
73-
}
74-
}).start();
7580
}
7681

7782
// Export meta config to Device

app/src/main/java/ps/reso/instaeclipse/mods/ghost/ViewOnce.java

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -51,36 +51,40 @@ public void handleViewOnceBlock(DexKitBridge bridge) {
5151
@Override
5252
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
5353
if (!FeatureFlags.isGhostViewOnce) {
54-
// If Ghost View Once is disabled, allow normal execution
54+
return; // Feature disabled → skip
55+
}
56+
57+
Object rw = param.args[2]; // Third argument (visual item object)
58+
if (rw == null) {
5559
return;
5660
}
5761

58-
Object rw = param.args[2]; // Third argument (likely visual item object)
59-
60-
if (rw != null) {
61-
Method[] allMethods = rw.getClass().getDeclaredMethods();
62-
63-
for (Method m : allMethods) {
64-
if (m.getParameterTypes().length == 0 &&
65-
m.getReturnType() == String.class) {
66-
try {
67-
m.setAccessible(true);
68-
String value = (String) m.invoke(rw);
69-
70-
if (value != null && value.contains("send_visual_item_seen_marker")) {
71-
// If it matches visual seen marker, block it
72-
param.setResult(null);
73-
return;
74-
}
75-
} catch (Throwable ignored) {
76-
// Ignore reflection exceptions
77-
}
62+
for (Method m : rw.getClass().getDeclaredMethods()) {
63+
// Only check methods with no params returning String
64+
if (m.getParameterTypes().length != 0 || m.getReturnType() != String.class) {
65+
continue;
66+
}
67+
68+
try {
69+
m.setAccessible(true);
70+
String value = (String) m.invoke(rw);
71+
if (value == null) {
72+
continue;
7873
}
74+
75+
if (value.contains("visual_item_seen") ||
76+
value.contains("send_visual_item_seen_marker")) {
77+
// XposedBridge.log("Blocked ViewOnce send: " + value);
78+
param.setResult(null); // Block this call
79+
}
80+
} catch (Throwable ignored) {
81+
// Ignore reflection errors
7982
}
8083
}
8184
}
8285
});
8386

87+
8488
XposedBridge.log("(InstaEclipse | ViewOnce): ✅ Hooked (dynamic check): " +
8589
method.getClassName() + "." + method.getName());
8690
FeatureStatusTracker.setHooked("GhostViewOnce");

0 commit comments

Comments
 (0)