|
24 | 24 |
|
25 | 25 | import com.wmods.wppenhacer.views.dialog.TabDialogContent;
|
26 | 26 | import com.wmods.wppenhacer.xposed.core.WppCore;
|
| 27 | +import com.wmods.wppenhacer.xposed.core.devkit.Unobfuscator; |
27 | 28 | import com.wmods.wppenhacer.xposed.core.devkit.UnobfuscatorCache;
|
28 | 29 | import com.wmods.wppenhacer.xposed.utils.DesignUtils;
|
29 | 30 | import com.wmods.wppenhacer.xposed.utils.ReflectionUtils;
|
@@ -70,48 +71,69 @@ public View getView(int position, @Nullable View convertView, @NonNull ViewGroup
|
70 | 71 | var tabdialog = new TabDialogContent(activity);
|
71 | 72 | tabdialog.setTitle(activity.getString(ResId.string.select_status_type));
|
72 | 73 | tabdialog.addTab(UnobfuscatorCache.getInstance().getString("mystatus"), DesignUtils.getIconByName("ic_status", true), (view) -> {
|
73 |
| - var intent = new Intent(WppCore.getCurrentActivity(), XposedHelpers.findClass("com.whatsapp.status.playback.MyStatusesActivity", getContext().getClassLoader())); |
74 |
| - WppCore.getCurrentActivity().startActivity(intent); |
| 74 | + try { |
| 75 | + var clazz = Unobfuscator.getClassByName("MyStatusesActivity", getContext().getClassLoader()); |
| 76 | + var intent = new Intent(WppCore.getCurrentActivity(), clazz); |
| 77 | + WppCore.getCurrentActivity().startActivity(intent); |
| 78 | + } catch (Exception e) { |
| 79 | + Utils.showToast(e.getMessage(), 1); |
| 80 | + } |
75 | 81 | dialog.dismissDialog();
|
76 | 82 | });
|
77 | 83 |
|
78 | 84 | // Botão da camera
|
79 | 85 | var iconCamera = DesignUtils.getDrawable(ResId.drawable.camera);
|
80 | 86 | DesignUtils.coloredDrawable(iconCamera, DesignUtils.isNightMode() ? Color.WHITE : Color.BLACK);
|
81 | 87 | tabdialog.addTab(activity.getString(ResId.string.open_camera), iconCamera, (view) -> {
|
82 |
| - Intent A09 = new Intent(); |
83 |
| - A09.setClassName(activity.getPackageName(), "com.whatsapp.camera.CameraActivity"); |
84 |
| - A09.putExtra("jid", "status@broadcast"); |
85 |
| - A09.putExtra("camera_origin", 4); |
86 |
| - A09.putExtra("is_coming_from_chat", false); |
87 |
| - A09.putExtra("media_sharing_user_journey_origin", 32); |
88 |
| - A09.putExtra("media_sharing_user_journey_start_target", 9); |
89 |
| - A09.putExtra("media_sharing_user_journey_chat_type", 4); |
90 |
| - activity.startActivity(A09); |
| 88 | + try { |
| 89 | + Intent intent = new Intent(); |
| 90 | + var clazz = Unobfuscator.getClassByName("CameraActivity", getContext().getClassLoader()); |
| 91 | + intent.setClassName(activity.getPackageName(), clazz.getName()); |
| 92 | + intent.putExtra("jid", "status@broadcast"); |
| 93 | + intent.putExtra("camera_origin", 4); |
| 94 | + intent.putExtra("is_coming_from_chat", false); |
| 95 | + intent.putExtra("media_sharing_user_journey_origin", 32); |
| 96 | + intent.putExtra("media_sharing_user_journey_start_target", 9); |
| 97 | + intent.putExtra("media_sharing_user_journey_chat_type", 4); |
| 98 | + activity.startActivity(intent); |
| 99 | + } catch (Exception e) { |
| 100 | + Utils.showToast(e.getMessage(), 1); |
| 101 | + } |
91 | 102 | dialog.dismissDialog();
|
92 |
| - |
93 | 103 | });
|
94 | 104 | // Botão de editar
|
95 | 105 | var iconEdit = DesignUtils.getDrawable(ResId.drawable.edit2);
|
96 | 106 | DesignUtils.coloredDrawable(iconEdit, DesignUtils.isNightMode() ? Color.WHITE : Color.BLACK);
|
97 | 107 |
|
98 | 108 | tabdialog.addTab(activity.getString(ResId.string.edit_text), iconEdit, (view) -> {
|
99 |
| - Intent A09 = new Intent(); |
100 |
| - if (XposedHelpers.findClassIfExists("com.whatsapp.textstatuscomposer.TextStatusComposerActivity", activity.getClassLoader()) != null) { |
101 |
| - A09.setClassName(activity.getPackageName(), "com.whatsapp.textstatuscomposer.TextStatusComposerActivity"); |
102 |
| - } else { |
103 |
| - A09.setClassName(activity.getPackageName(), "com.whatsapp.textstatuscomposer.TextStatusComposerActivityV2"); |
| 109 | + try { |
| 110 | + Intent intent = new Intent(); |
| 111 | + Class clazz; |
| 112 | + try { |
| 113 | + clazz = Unobfuscator.getClassByName("TextStatusComposerActivity", activity.getClassLoader()); |
| 114 | + } catch (Exception ignored) { |
| 115 | + clazz = Unobfuscator.getClassByName("ConsolidatedStatusComposerActivity", getContext().getClassLoader()); |
| 116 | + intent.putExtra("status_composer_mode",2); |
| 117 | + } |
| 118 | + intent.setClassName(activity.getPackageName(), clazz.getName()); |
| 119 | + activity.startActivity(intent); |
| 120 | + } catch (Exception e) { |
| 121 | + Utils.showToast(e.getMessage(), 1); |
104 | 122 | }
|
105 |
| - activity.startActivity(A09); |
106 | 123 | dialog.dismissDialog();
|
107 | 124 | });
|
108 | 125 | dialog.setContentView(tabdialog);
|
109 | 126 | dialog.showDialog();
|
110 | 127 | return;
|
111 | 128 | }
|
112 |
| - var intent = new Intent(WppCore.getCurrentActivity(), XposedHelpers.findClass("com.whatsapp.status.playback.StatusPlaybackActivity", getContext().getClassLoader())); |
113 |
| - intent.putExtra("jid", holder.jid); |
114 |
| - WppCore.getCurrentActivity().startActivity(intent); |
| 129 | + try { |
| 130 | + var clazz = Unobfuscator.getClassByName("StatusPlaybackActivity", getContext().getClassLoader()); |
| 131 | + var intent = new Intent(WppCore.getCurrentActivity(), clazz); |
| 132 | + intent.putExtra("jid", holder.jid); |
| 133 | + WppCore.getCurrentActivity().startActivity(intent); |
| 134 | + } catch (Exception e) { |
| 135 | + Utils.showToast(e.getMessage(), 1); |
| 136 | + } |
115 | 137 | });
|
116 | 138 |
|
117 | 139 | return convertView;
|
|
0 commit comments