From cb459029c55d10468efd7635cb14be0d70b99ac3 Mon Sep 17 00:00:00 2001 From: tc-wleite Date: Mon, 2 Dec 2024 12:50:32 -0300 Subject: [PATCH] '#2375: Handle group/community messages (group events 41/43/61). --- .../localization/iped-parsers-messages.properties | 2 ++ .../iped-parsers-messages_de_DE.properties | 2 ++ .../iped-parsers-messages_es_AR.properties | 2 ++ .../iped-parsers-messages_fr_FR.properties | 2 ++ .../iped-parsers-messages_it_IT.properties | 2 ++ .../iped-parsers-messages_pt_BR.properties | 2 ++ .../main/java/iped/parsers/whatsapp/ExtractorIOS.java | 11 +++++++++++ .../src/main/java/iped/parsers/whatsapp/Message.java | 2 +- .../java/iped/parsers/whatsapp/ReportGenerator.java | 8 ++++++++ 9 files changed, 32 insertions(+), 1 deletion(-) diff --git a/iped-app/resources/localization/iped-parsers-messages.properties b/iped-app/resources/localization/iped-parsers-messages.properties index 8894430a30..f7107ae05d 100644 --- a/iped-app/resources/localization/iped-parsers-messages.properties +++ b/iped-app/resources/localization/iped-parsers-messages.properties @@ -318,6 +318,8 @@ WhatsAppReport.BusinessChangedName=This business account changed its name. WhatsAppReport.ChatBusinessOfficial=This chat is with an official business account. WhatsAppReport.GroupAddedToCommunity=Group was added to the community WhatsAppReport.GroupRemovedFromCommunity=Group was removed from the community +WhatsAppReport.GroupNotPartOfCommunity=This group is not part of the community anymore. +WhatsAppReport.CommunityNotAvailable=This community is not available anymore WhatsAppReport.AnyCommunityMemberCanJoinThisGroup=Anyone in the community can join this group. WhatsAppReport.CommunityManagementAction=Community management action. WhatsAppReport.CommunityRenamed=changed the community's name diff --git a/iped-app/resources/localization/iped-parsers-messages_de_DE.properties b/iped-app/resources/localization/iped-parsers-messages_de_DE.properties index 0be4f88b80..42e1f07c28 100644 --- a/iped-app/resources/localization/iped-parsers-messages_de_DE.properties +++ b/iped-app/resources/localization/iped-parsers-messages_de_DE.properties @@ -318,6 +318,8 @@ WhatsAppReport.BusinessChangedName=This business account changed its name.[TBT] WhatsAppReport.ChatBusinessOfficial=This chat is with an official business account.[TBT] WhatsAppReport.GroupAddedToCommunity=Group was added to the community[TBT] WhatsAppReport.GroupRemovedFromCommunity=Group was removed from the community[TBT] +WhatsAppReport.GroupNotPartOfCommunity=This group is not part of the community anymore.[TBT] +WhatsAppReport.CommunityNotAvailable=This community is not available anymore[TBT] WhatsAppReport.AnyCommunityMemberCanJoinThisGroup=Any community member can join this group.[TBT] WhatsAppReport.CommunityManagementAction=Community management action.[TBT] WhatsAppReport.CommunityRenamed=changed the community's name[TBT] diff --git a/iped-app/resources/localization/iped-parsers-messages_es_AR.properties b/iped-app/resources/localization/iped-parsers-messages_es_AR.properties index 6f328c2dfd..cdaa30dc43 100644 --- a/iped-app/resources/localization/iped-parsers-messages_es_AR.properties +++ b/iped-app/resources/localization/iped-parsers-messages_es_AR.properties @@ -318,6 +318,8 @@ WhatsAppReport.BusinessChangedName=This business account changed its name.[TBT] WhatsAppReport.ChatBusinessOfficial=This chat is with an official business account.[TBT] WhatsAppReport.GroupAddedToCommunity=Group was added to the community[TBT] WhatsAppReport.GroupRemovedFromCommunity=Group was removed from the community[TBT] +WhatsAppReport.GroupNotPartOfCommunity=This group is not part of the community anymore.[TBT] +WhatsAppReport.CommunityNotAvailable=This community is not available anymore[TBT] WhatsAppReport.AnyCommunityMemberCanJoinThisGroup=Cualquier miembro de la comunidad puede unirse a este grupo. WhatsAppReport.CommunityManagementAction=Community management action.[TBT] WhatsAppReport.CommunityRenamed=cambió el nombre de la comunidad diff --git a/iped-app/resources/localization/iped-parsers-messages_fr_FR.properties b/iped-app/resources/localization/iped-parsers-messages_fr_FR.properties index 066f7f9581..4679a7a421 100644 --- a/iped-app/resources/localization/iped-parsers-messages_fr_FR.properties +++ b/iped-app/resources/localization/iped-parsers-messages_fr_FR.properties @@ -318,6 +318,8 @@ WhatsAppReport.BusinessChangedName=Ce compte professionnel a changé de nom. WhatsAppReport.ChatBusinessOfficial=Ce chat est avec un compte professionnel officiel. WhatsAppReport.GroupAddedToCommunity=Le groupe a été ajouté à la communauté. WhatsAppReport.GroupRemovedFromCommunity=Le groupe a été supprimé de la communauté. +WhatsAppReport.GroupNotPartOfCommunity=This group is not part of the community anymore.[TBT] +WhatsAppReport.CommunityNotAvailable=This community is not available anymore[TBT] WhatsAppReport.AnyCommunityMemberCanJoinThisGroup=N'importe qui dans la communauté peut rejoindre ce groupe. WhatsAppReport.CommunityManagementAction=Gestion de la communauté. WhatsAppReport.CommunityRenamed=Changer le nom de la communauté diff --git a/iped-app/resources/localization/iped-parsers-messages_it_IT.properties b/iped-app/resources/localization/iped-parsers-messages_it_IT.properties index 1fb00160bf..ebf06b39da 100644 --- a/iped-app/resources/localization/iped-parsers-messages_it_IT.properties +++ b/iped-app/resources/localization/iped-parsers-messages_it_IT.properties @@ -318,6 +318,8 @@ WhatsAppReport.BusinessChangedName=This business account changed its name.[TBT] WhatsAppReport.ChatBusinessOfficial=This chat is with an official business account.[TBT] WhatsAppReport.GroupAddedToCommunity=Group was added to the community[TBT] WhatsAppReport.GroupRemovedFromCommunity=Group was removed from the community[TBT] +WhatsAppReport.GroupNotPartOfCommunity=This group is not part of the community anymore.[TBT] +WhatsAppReport.CommunityNotAvailable=This community is not available anymore[TBT] WhatsAppReport.AnyCommunityMemberCanJoinThisGroup=Any community member can join this group.[TBT] WhatsAppReport.CommunityManagementAction=Community management action.[TBT] WhatsAppReport.CommunityRenamed=changed the community's name[TBT] diff --git a/iped-app/resources/localization/iped-parsers-messages_pt_BR.properties b/iped-app/resources/localization/iped-parsers-messages_pt_BR.properties index e26152e12f..74ab15ef64 100644 --- a/iped-app/resources/localization/iped-parsers-messages_pt_BR.properties +++ b/iped-app/resources/localization/iped-parsers-messages_pt_BR.properties @@ -318,6 +318,8 @@ WhatsAppReport.BusinessChangedName=Esta conta comercial mudou seu nome. WhatsAppReport.ChatBusinessOfficial=Você está conversando com uma conta comercial oficial. WhatsAppReport.GroupAddedToCommunity=Grupo foi adicionado a comunidade WhatsAppReport.GroupRemovedFromCommunity=Grupo foi removido da comunidade +WhatsAppReport.GroupNotPartOfCommunity=Este grupo não faz mais parte da comunidade. +WhatsAppReport.CommunityNotAvailable=Esta comunidade não está mais disponível WhatsAppReport.AnyCommunityMemberCanJoinThisGroup=Todos os membros da comunidade podem entrar neste grupo. WhatsAppReport.CommunityManagementAction=Ação de gerenciamento de comunidade. WhatsAppReport.CommunityRenamed=mudou o nome da comunidade diff --git a/iped-parsers/iped-parsers-impl/src/main/java/iped/parsers/whatsapp/ExtractorIOS.java b/iped-parsers/iped-parsers-impl/src/main/java/iped/parsers/whatsapp/ExtractorIOS.java index a78dc8d995..a33ab62069 100644 --- a/iped-parsers/iped-parsers-impl/src/main/java/iped/parsers/whatsapp/ExtractorIOS.java +++ b/iped-parsers/iped-parsers-impl/src/main/java/iped/parsers/whatsapp/ExtractorIOS.java @@ -15,6 +15,7 @@ import static iped.parsers.whatsapp.Message.MessageType.COMMUNITY_CHANGED_ALL_MEMBERS_CAN_ADD; import static iped.parsers.whatsapp.Message.MessageType.COMMUNITY_DESCRIPTION_CHANGED; import static iped.parsers.whatsapp.Message.MessageType.COMMUNITY_MANAGEMENT_ACTION; +import static iped.parsers.whatsapp.Message.MessageType.COMMUNITY_NOT_AVAILABLE; import static iped.parsers.whatsapp.Message.MessageType.COMMUNITY_WELCOME; import static iped.parsers.whatsapp.Message.MessageType.CONTACT_MESSAGE; import static iped.parsers.whatsapp.Message.MessageType.DELETED_BY_SENDER; @@ -37,6 +38,7 @@ import static iped.parsers.whatsapp.Message.MessageType.GROUP_ICON_DELETED; import static iped.parsers.whatsapp.Message.MessageType.GROUP_INVITE; import static iped.parsers.whatsapp.Message.MessageType.GROUP_NAME_CHANGED; +import static iped.parsers.whatsapp.Message.MessageType.GROUP_NOT_PART_OF_COMMUNITY; import static iped.parsers.whatsapp.Message.MessageType.GROUP_REMOVED_FROM_COMMUNITY; import static iped.parsers.whatsapp.Message.MessageType.IMAGE_MESSAGE; import static iped.parsers.whatsapp.Message.MessageType.LOCATION_MESSAGE; @@ -1462,6 +1464,10 @@ protected Message.MessageType decodeMessageType(int messageType, int gEventType, result = GROUP_CREATED; break; + case 13: + result = COMMUNITY_NOT_AVAILABLE; + break; + case 15: result = USER_JOINED_GROUP_FROM_LINK; break; @@ -1503,6 +1509,7 @@ protected Message.MessageType decodeMessageType(int messageType, int gEventType, break; case 31: + case 61: result = GROUP_ADDED_TO_COMMUNITY; break; @@ -1518,6 +1525,10 @@ protected Message.MessageType decodeMessageType(int messageType, int gEventType, result = GROUP_CHANGED_ONLY_ADMINS_CAN_ADD; break; + case 43: + result = GROUP_NOT_PART_OF_COMMUNITY; + break; + case 50: // multiple users added to group result = USER_ADDED_TO_GROUP; diff --git a/iped-parsers/iped-parsers-impl/src/main/java/iped/parsers/whatsapp/Message.java b/iped-parsers/iped-parsers-impl/src/main/java/iped/parsers/whatsapp/Message.java index d70ab71583..ec0463b581 100644 --- a/iped-parsers/iped-parsers-impl/src/main/java/iped/parsers/whatsapp/Message.java +++ b/iped-parsers/iped-parsers-impl/src/main/java/iped/parsers/whatsapp/Message.java @@ -679,7 +679,7 @@ public void setAddress(String address) { } public static enum MessageType { - TEXT_MESSAGE, IMAGE_MESSAGE, AUDIO_MESSAGE, VIDEO_MESSAGE, UNKNOWN_MEDIA_MESSAGE, CONTACT_MESSAGE, LOCATION_MESSAGE, SHARE_LOCATION_MESSAGE, VOICE_CALL, VIDEO_CALL, DOC_MESSAGE, GIF_MESSAGE, BLOCKED_CONTACT, UNBLOCKED_CONTACT, BUSINESS_CHAT, BUSINESS_TO_STANDARD, MESSAGES_ENCRYPTED, MESSAGES_NOW_ENCRYPTED, ENCRYPTION_KEY_CHANGED, MISSED_VOICE_CALL, MISSED_VIDEO_CALL, DELETED_MESSAGE, DELETED_BY_ADMIN, DELETED_BY_SENDER, GROUP_CREATED, USER_ADDED_TO_COMMUNITY, USER_ADDED_TO_GROUP, USER_JOINED_GROUP_FROM_COMMUNITY, USER_JOINED_GROUP_FROM_LINK, USER_JOINED_GROUP_FROM_INVITATION, USER_LEFT_GROUP, USER_REMOVED_FROM_GROUP, USER_COMMUNITY_ADMIN, URL_MESSAGE, GROUP_ICON_CHANGED, GROUP_ICON_DELETED, GROUP_DESCRIPTION_CHANGED, GROUP_DESCRIPTION_DELETED, SUBJECT_CHANGED, YOU_ADMIN, YOU_NOT_ADMIN, USER_ADMIN, WAITING_MESSAGE, STICKER_MESSAGE, REFUSED_VIDEO_CALL, REFUSED_VOICE_CALL, UNAVAILABLE_VIDEO_CALL, UNAVAILABLE_VOICE_CALL, UNKNOWN_VOICE_CALL, UNKNOWN_VIDEO_CALL, VIEW_ONCE_AUDIO_MESSAGE, VIEW_ONCE_IMAGE_MESSAGE, VIEW_ONCE_VIDEO_MESSAGE, CALL_MESSAGE, BUSINESS_META_SECURE_SERVICE, GROUP_INVITE, TEMPLATE_MESSAGE, TEMPLATE_QUOTE, POLL_MESSAGE, EPHEMERAL_DURATION_CHANGED, EPHEMERAL_SETTINGS_NOT_APPLIED, EPHEMERAL_CHANGED, EPHEMERAL_DEFAULT, EPHEMERAL_SAVE, GROUP_CHANGED_ONLY_ADMINS_CAN_ADD, GROUP_CHANGED_ONLY_ADMINS_CAN_SEND, GROUP_CHANGED_ALL_MEMBERS_CAN_SEND, GROUP_CHANGED_ONLY_ADMINS_CAN_EDIT, GROUP_CHANGED_ALL_MEMBERS_CAN_EDIT, GROUP_ONLY_ADMINS_CAN_SEND, CHANGED_DEVICE, CHANGED_NUMBER_TO, CHANGED_NUMBER_CHATTING_WITH_NEW, CHANGED_NUMBER_CHATTING_WITH_OLD, STANDARD_CHAT, SENDER_ADDED_TO_CONTACTS, SENDER_IN_CONTACTS, BUSINESS_OFFICIAL, GROUP_ADDED_TO_COMMUNITY, GROUP_REMOVED_FROM_COMMUNITY, COMMUNITY_MANAGEMENT_ACTION, COMMUNITY_WELCOME, UI_ELEMENTS, UI_ELEMENTS_QUOTE, CHAT_ADDED_PRIVACY, CHANNEL_ADDED_PRIVACY, CHANNEL_CREATED, ORDER_MESSAGE, PRODUCT_MESSAGE, BUSINESS_CHANGED_NAME, USER_JOINED_WHATSAPP, PINNED_MESSAGE, GROUP_NAME_CHANGED, AI_THIRD_PARTY, NEW_PARTICIPANTS_NEED_ADMIN_APPROVAL, RESET_GROUP_LINK, COMMUNITY_RENAMED, ANY_COMMUNITY_MEMBER_CAN_JOIN_GROUP, UNKNOWN_MESSAGE, OVER_256_MEMBERS_ONLY_ADMINS_CAN_EDIT, SECURITY_NOTIFICATIONS_NO_LONGER_AVAILABLE, CONTACTED_FIND_BUSINESSES, COMMUNITY_CHANGED_ONLY_ADMINS_CAN_ADD, COMMUNITY_CHANGED_ALL_MEMBERS_CAN_ADD, COMMUNITY_DESCRIPTION_CHANGED + TEXT_MESSAGE, IMAGE_MESSAGE, AUDIO_MESSAGE, VIDEO_MESSAGE, UNKNOWN_MEDIA_MESSAGE, CONTACT_MESSAGE, LOCATION_MESSAGE, SHARE_LOCATION_MESSAGE, VOICE_CALL, VIDEO_CALL, DOC_MESSAGE, GIF_MESSAGE, BLOCKED_CONTACT, UNBLOCKED_CONTACT, BUSINESS_CHAT, BUSINESS_TO_STANDARD, MESSAGES_ENCRYPTED, MESSAGES_NOW_ENCRYPTED, ENCRYPTION_KEY_CHANGED, MISSED_VOICE_CALL, MISSED_VIDEO_CALL, DELETED_MESSAGE, DELETED_BY_ADMIN, DELETED_BY_SENDER, GROUP_CREATED, USER_ADDED_TO_COMMUNITY, USER_ADDED_TO_GROUP, USER_JOINED_GROUP_FROM_COMMUNITY, USER_JOINED_GROUP_FROM_LINK, USER_JOINED_GROUP_FROM_INVITATION, USER_LEFT_GROUP, USER_REMOVED_FROM_GROUP, USER_COMMUNITY_ADMIN, URL_MESSAGE, GROUP_ICON_CHANGED, GROUP_ICON_DELETED, GROUP_DESCRIPTION_CHANGED, GROUP_DESCRIPTION_DELETED, SUBJECT_CHANGED, YOU_ADMIN, YOU_NOT_ADMIN, USER_ADMIN, WAITING_MESSAGE, STICKER_MESSAGE, REFUSED_VIDEO_CALL, REFUSED_VOICE_CALL, UNAVAILABLE_VIDEO_CALL, UNAVAILABLE_VOICE_CALL, UNKNOWN_VOICE_CALL, UNKNOWN_VIDEO_CALL, VIEW_ONCE_AUDIO_MESSAGE, VIEW_ONCE_IMAGE_MESSAGE, VIEW_ONCE_VIDEO_MESSAGE, CALL_MESSAGE, BUSINESS_META_SECURE_SERVICE, GROUP_INVITE, TEMPLATE_MESSAGE, TEMPLATE_QUOTE, POLL_MESSAGE, EPHEMERAL_DURATION_CHANGED, EPHEMERAL_SETTINGS_NOT_APPLIED, EPHEMERAL_CHANGED, EPHEMERAL_DEFAULT, EPHEMERAL_SAVE, GROUP_CHANGED_ONLY_ADMINS_CAN_ADD, GROUP_CHANGED_ONLY_ADMINS_CAN_SEND, GROUP_CHANGED_ALL_MEMBERS_CAN_SEND, GROUP_CHANGED_ONLY_ADMINS_CAN_EDIT, GROUP_CHANGED_ALL_MEMBERS_CAN_EDIT, GROUP_ONLY_ADMINS_CAN_SEND, CHANGED_DEVICE, CHANGED_NUMBER_TO, CHANGED_NUMBER_CHATTING_WITH_NEW, CHANGED_NUMBER_CHATTING_WITH_OLD, STANDARD_CHAT, SENDER_ADDED_TO_CONTACTS, SENDER_IN_CONTACTS, BUSINESS_OFFICIAL, GROUP_ADDED_TO_COMMUNITY, GROUP_REMOVED_FROM_COMMUNITY, COMMUNITY_MANAGEMENT_ACTION, COMMUNITY_WELCOME, UI_ELEMENTS, UI_ELEMENTS_QUOTE, CHAT_ADDED_PRIVACY, CHANNEL_ADDED_PRIVACY, CHANNEL_CREATED, ORDER_MESSAGE, PRODUCT_MESSAGE, BUSINESS_CHANGED_NAME, USER_JOINED_WHATSAPP, PINNED_MESSAGE, GROUP_NAME_CHANGED, AI_THIRD_PARTY, NEW_PARTICIPANTS_NEED_ADMIN_APPROVAL, RESET_GROUP_LINK, COMMUNITY_RENAMED, ANY_COMMUNITY_MEMBER_CAN_JOIN_GROUP, UNKNOWN_MESSAGE, OVER_256_MEMBERS_ONLY_ADMINS_CAN_EDIT, SECURITY_NOTIFICATIONS_NO_LONGER_AVAILABLE, CONTACTED_FIND_BUSINESSES, COMMUNITY_CHANGED_ONLY_ADMINS_CAN_ADD, COMMUNITY_CHANGED_ALL_MEMBERS_CAN_ADD, COMMUNITY_DESCRIPTION_CHANGED, COMMUNITY_NOT_AVAILABLE, GROUP_NOT_PART_OF_COMMUNITY } public static enum MessageStatus { diff --git a/iped-parsers/iped-parsers-impl/src/main/java/iped/parsers/whatsapp/ReportGenerator.java b/iped-parsers/iped-parsers-impl/src/main/java/iped/parsers/whatsapp/ReportGenerator.java index 57b6c67930..3fa8a95109 100644 --- a/iped-parsers/iped-parsers-impl/src/main/java/iped/parsers/whatsapp/ReportGenerator.java +++ b/iped-parsers/iped-parsers-impl/src/main/java/iped/parsers/whatsapp/ReportGenerator.java @@ -523,6 +523,14 @@ private synchronized void printMessage(PrintWriter out, Message message, boolean } out.println("
"); break; + case COMMUNITY_NOT_AVAILABLE: + out.println("
"); + out.println(name + " " + Messages.getString("WhatsAppReport.CommunityNotAvailable") + ".
"); + break; + case GROUP_NOT_PART_OF_COMMUNITY: + out.println("
"); + out.println(name + " " + Messages.getString("WhatsAppReport.GroupNotPartOfCommunity") + ".
"); + break; case COMMUNITY_RENAMED: out.println("
"); out.println(name + " " + Messages.getString("WhatsAppReport.CommunityRenamed") + ".
");