-
Notifications
You must be signed in to change notification settings - Fork 4
/
migration_script_v3_to_v4.sh
246 lines (188 loc) · 25 KB
/
migration_script_v3_to_v4.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
#!/bin/sh
javaFiles=$(find . -name "*.java")
kotlinFiles=$(find . -name "*.kt")
allFiles=$(find . -name "*.java" -o -name "*.kt")
# Move `BaseChannel, GroupChannel, OpenChannel and ReadStatus` to com.sendbird.android.channel.* package.
sed -E -i "" "s/(import com.sendbird.android).(BaseChannel|GroupChannel|OpenChannel|ReadStatus)(;?$)/\1.channel.\2\3/g" $allFiles
# Move `GroupChannelListQuery, PublicGroupChannelListQuery and OpenChannelListQuery` to com.sendbird.android.channel.query.* package.
sed -E -i "" 's/(import com.sendbird.android).(GroupChannelListQuery|PublicGroupChannelListQuery|OpenChannelListQuery)(;?$)/\1.channel.query.\2\3/g' $allFiles
# Move `BaseCollection, CollectionLifecycle, GroupChannelCollection and MessageCollection` to com.sendbird.android.collection.* package.
sed -E -i "" 's/(import com.sendbird.android).(BaseCollection|CollectionLifecycle|GroupChannelCollection|MessageCollection)(;?$)/\1.collection.\2\3/g' $allFiles
# Move `GroupChannelContext, MessageContext, CollectionEventSource, Traceable and MessageCollectionInitPolicy` to com.sendbird.android.collection.* package.
sed -E -i "" 's/(import com.sendbird.android).handlers.(GroupChannelContext|MessageContext|CollectionEventSource|Traceable|MessageCollectionInitPolicy)(;?$)/\1.collection.\2\3/g' $allFiles
# Move `MessagePayloadFilter` to com.sendbird.android.params.common.* package.
sed -E -i "" 's/(import com.sendbird.android).(MessagePayloadFilter)(;?$)/\1.params.common.\2\3/g' $allFiles
# Rename `SendBird` to `Sendbird` and move `SendbirdError and SendbirdException` to com.sendbird.android.channel.query.* package`.
sed -E -i "" 's/(import com.sendbird.android).SendBird(Error|Exception)(;?$)/\1.exception.Sendbird\2\3/g' $allFiles
sed -E -i "" 's/([[:space:]]|:|=|\(|\<)SendBird(Error|Exception)/\1Sendbird\2/g' $allFiles
# Move `AdminMessage, AppleCriticalAlertOptions, BaseMessage, Emoji, EmojiCategory, EmojiContainer, FileMessage, MentionType, MessageMetaArray,
# OGImage, OGMetaData, PushNotificationDeliveryOption, Reaction, ReactionEvent, ThreadInfo, ThreadInfoUpdateEvent, Plugin and UserMessage` to com.sendbird.android.message.* package.
sed -E -i "" 's/(import com.sendbird.android).(AdminMessage|AppleCriticalAlertOptions|BaseMessage|Emoji|EmojiCategory|EmojiContainer|FileMessage|MentionType|MessageMetaArray|OGImage|OGMetaData|PushNotificationDeliveryOption|Reaction|ReactionEvent|ThreadInfo|ThreadInfoUpdateEvent|Plugin|UserMessage)(;?$)/\1.message.\2\3/g' $allFiles
# Rename `ReplyTypeFilter` to `ReplyType` and repackaged
sed -E -i "" 's/(import com.sendbird.android).ReplyTypeFilter(;?$)/\1.message.ReplyType\2/g' $allFiles
sed -E -i "" 's/([[:space:]]|:|=|\(|\<)ReplyTypeFilter/\1ReplyType/g' $allFiles
# Move `MessageSearchQuery, PreviousMessageListQuery` to com.sendbird.android.message.query.* package.
sed -E -i "" 's/(import com.sendbird.android).(MessageSearchQuery|PreviousMessageListQuery)(;?$)/\1.message.query.\2\3/g' $allFiles
# Rename `SendBird` to `Sendbird` and Move `AbstractPushHandler, OnPushTokenReceiveListener, SendBirdFirebaseInstanceIDService, SendBirdFirebaseMessagingService,
# SendBirdHmsMessagingService, SendBirdHmsPushHandler, SendBirdPushHandler and SendBirdPushHelper` to com.sendbird.android.push.* package.
sed -E -i "" 's/(import com.sendbird.android).(AbstractPushHandler|OnPushTokenReceiveListener|SendBirdFirebaseInstanceIDService|SendBirdFirebaseMessagingService|SendBirdHmsMessagingService|SendBirdHmsPushHandler|SendBirdPushHandler|SendBirdPushHelper)(;?$)/\1.push.\2\3/g' $allFiles
sed -E -i "" 's/([[:space:]]|:|=|\(|\<|.)SendBird(FirebaseInstanceIDService|FirebaseMessagingService|HmsMessagingService|HmsPushHandler|HmsPushHandler|PushHandler|PushHelper)/\1Sendbird\2/g' $allFiles
# Move `Member, RestrictionType, RestrictedUser, RestrictionInfo, Sender and User` to com.sendbird.android.user.* package.
sed -E -i "" 's/(import com.sendbird.android).(Member|RestrictionType|RestrictedUser|RestrictionInfo|Sender|User)(;?$)/\1.user.\2\3/g' $allFiles
# Move `ApplicationUserListQuery, BannedUserListQuery, BlockedUserListQuery, FriendListQuery, GroupChannelMemberListQuery,
# MutedUserListQuery, OperatorListQuery, ParticipantListQuery, UserListQuery` to com.sendbird.android.user.query.* package.
sed -E -i "" 's/(import com.sendbird.android).(ApplicationUserListQuery|BannedUserListQuery|BlockedUserListQuery|FriendListQuery|GroupChannelMemberListQuery|MutedUserListQuery|OperatorListQuery|ParticipantListQuery|UserListQuery)(;?$)/\1.user.query.\2\3/g' $allFiles
# Move `BaseMessageListParams, GroupChannelChangeLogsParams, GroupChannelTotalUnreadChannelCountParams, GroupChannelTotalUnreadMessageCountParams, MessageChangeLogsParams, MessageListParams, MessageRetrievalParams and ThreadMessageListParams` to com.sendbird.android.params.* package.
sed -E -i "" 's/(import com.sendbird.android).(BaseMessageListParams|GroupChannelChangeLogsParams|GroupChannelTotalUnreadChannelCountParams|GroupChannelTotalUnreadMessageCountParams|MessageChangeLogsParams|MessageListParams|MessageRetrievalParams|ThreadMessageListParams)(;?$)/\1.params.\2\3/g' $allFiles
# Inner class to top level
sed -E -i "" 's/(import com.sendbird.android).Member.Role(;?$)/\1.channel.Role\2/g' $allFiles
sed -E -i "" 's/(import com.sendbird.android).SendBird.(ThreadOption|ConnectionState)(;?$)/\1.\2\3/g' $allFiles
sed -E -i "" 's/(import com.sendbird.android).GroupChannel.(UnreadItemKey)(;?$)/\1.\2\3/g' $allFiles
sed -E -i "" 's/([[:space:]]|:|=|\(|\<)Member.Role/\1Role/g' $allFiles
sed -E -i "" 's/([[:space:]]|:|=|\(|\<)SendBird.(ThreadOption|ConnectionState)/\1\2/g' $allFiles
sed -E -i "" 's/([[:space:]]|:|=|\(|\<)GroupChannel.UnreadItemKey/\1UnreadItemKey/g' $allFiles
# Handlers
## SendBird.GetXXX -> handler.XXX
sed -E -i "" 's/(import com.sendbird.android).SendBird.Get(SnoozePeriodHandler|PushTriggerOptionHandler|PushTokensHandler|PushTemplateHandler|PushSoundHandler|MyGroupChannelChangeLogsHandler|FriendChangeLogsByTokenHandler|AllEmojiHandler|EmojiCategoryHandler|EmojiHandler|MyGroupChannelChangeLogsHandler)(;?$)/\1.handler.\2\3/g' $allFiles
sed -E -i "" 's/([[:space:]]|:|=|\(|\<)Get(SnoozePeriodHandler|PushTriggerOptionHandler|PushTokensHandler|PushTemplateHandler|PushSoundHandler|MyGroupChannelChangeLogsHandler|FriendChangeLogsByTokenHandler|AllEmojiHandler|EmojiCategoryHandler|EmojiHandler|MyGroupChannelChangeLogsHandler)/\1\2/g' $allFiles
## BaseMessageHandler
sed -E -i "" 's/(import com.sendbird.android).(BaseChannel.MessageMetaArrayHandler|BaseMessage.GetMessageHandler|BaseChannel.MessageMetaArrayHandler)(;?$)/\1.handler.BaseMessageHandler\3/g' $allFiles
sed -E -i "" 's/([[:space:]]|:|=|\(|\<)(BaseChannel.MessageMetaArrayHandler|BaseMessage.GetMessageHandler)/\1BaseMessageHandler/g' $allFiles
## BaseMessagesHandler
sed -E -i "" 's/(import com.sendbird.android).(BaseChannel.GetMessagesHandler|MessageSearchQuery.MessageSearchQueryResultHandler|PreviousMessageListQuery.MessageListQueryResult)(;?$)/\1.handler.BaseMessagesHandler\3/g' $allFiles
sed -E -i "" 's/([[:space:]]|:|=|\(|\<)(BaseChannel.GetMessagesHandler|MessageSearchQuery.MessageSearchQueryResultHandler|PreviousMessageListQuery.MessageListQueryResult)/\1BaseMessagesHandler/g' $allFiles
## MetaCounterHandler
sed -E -i "" 's/(import com.sendbird.android).(BaseChannel.MetaCounterHandler)(;?$)/\1.handler.MetaCounterHandler\3/g' $allFiles
sed -E -i "" 's/([[:space:]]|:|=|\(|\<)(BaseChannel.MetaCounterHandler)/\1MetaCounterHandler/g' $allFiles
## MetaDataHandler
sed -E -i "" 's/(import com.sendbird.android).(BaseChannel.MetaDataHandler|User.MetaDataHandler)(;?$)/\1.handler.MetaDataHandler\3/g' $allFiles
sed -E -i "" 's/([[:space:]]|:|=|\(|\<)(BaseChannel.MetaDataHandler|User.MetaDataHandler)/\1MetaDataHandler/g' $allFiles
## FileMessageHandler
sed -E -i "" 's/(import com.sendbird.android).(BaseChannel.CopyFileMessageHandler|BaseChannel.ResendFileMessageHandler|BaseChannel.SendFileMessageHandler|BaseChannel.UpdateFileMessageHandler)(;?$)/\1.handler.FileMessageHandler\3/g' $allFiles
sed -E -i "" 's/([[:space:]]|:|=|\(|\<)(BaseChannel.CopyFileMessageHandler|BaseChannel.ResendFileMessageHandler|BaseChannel.SendFileMessageHandler|BaseChannel.UpdateFileMessageHandler)/\1FileMessageHandler/g' $allFiles
## UserMessageHandler
sed -E -i "" 's/(import com.sendbird.android).(BaseChannel.CopyUserMessageHandler|BaseChannel.ResendUserMessageHandler|BaseChannel.SendUserMessageHandler|BaseChannel.TranslateUserMessageHandler|BaseChannel.UpdateUserMessageHandler)(;?$)/\1.handler.UserMessageHandler\3/g' $allFiles
sed -E -i "" 's/([[:space:]]|:|=|\(|\<)(BaseChannel.CopyUserMessageHandler|BaseChannel.ResendUserMessageHandler|BaseChannel.SendUserMessageHandler|BaseChannel.TranslateUserMessageHandler|BaseChannel.UpdateUserMessageHandler)/\1UserMessageHandler/g' $allFiles
## CompletionHandler
sed -E -i "" 's/(import com.sendbird.android).(BaseChannel.DeleteMessageHandler|BaseChannel.DeleteMetaCounterHandler|BaseChannel.DeleteMetaDataHandler|BaseChannel.ReportHandler|BaseChannel.ReportMessageHandler|BaseChannel.ReportUserHandler|GroupChannel.GroupChannelAcceptInvitationHandler|GroupChannel.GroupChannelBanHandler|GroupChannel.GroupChannelDeclineInvitationHandler|GroupChannel.GroupChannelDeleteHandler|GroupChannel.GroupChannelFreezeHandler|GroupChannel.GroupChannelHideHandler|GroupChannel.GroupChannelInviteHandler|GroupChannel.GroupChannelJoinHandler|GroupChannel.GroupChannelLeaveHandler|GroupChannel.GroupChannelMuteHandler|GroupChannel.GroupChannelRefreshHandler|GroupChannel.GroupChannelResetMyHistoryHandler|GroupChannel.GroupChannelSetMyCountPreferenceHandler|GroupChannel.GroupChannelSetMyPushTriggerOptionHandler|GroupChannel.GroupChannelSetPushPreferenceHandler|GroupChannel.GroupChannelUnbanHandler|GroupChannel.GroupChannelUnfreezeHandler|GroupChannel.GroupChannelUnhideHandler|GroupChannel.GroupChannelUnmuteHandler|OpenChannel.OpenChannelBanHandler|OpenChannel.OpenChannelDeleteHandler|OpenChannel.OpenChannelEnterHandler|OpenChannel.OpenChannelExitHandler|OpenChannel.OpenChannelMuteHandler|OpenChannel.OpenChannelRefreshHandler|OpenChannel.OpenChannelUnbanHandler|OpenChannel.OpenChannelUnmuteHandler|SendBird.DeleteFriendDiscoveriesHandler|SendBird.DeleteFriendDiscoveryHandler|SendBird.DeleteFriendHandler|SendBird.DeleteFriendsHandler|SendBird.MarkAsReadHandler|SendBird.SetChannelInvitationPreferenceHandler|SendBird.SetDoNotDisturbHandler|SendBird.SetPushSoundHandler|SendBird.SetPushTemplateHandler|SendBird.SetPushTriggerOptionHandler|SendBird.SetSnoozePeriodHandler|SendBird.UnregisterPushTokenHandler|SendBird.UploadFriendDiscoveriesHandler|SendBird.UserInfoUpdateHandler|SendBird.UserUnblockHandler|User.DeleteMetaDataHandler|handlers.AddOperatorsHandler|handlers.AllowFriendDiscoveryHandler)(;?$)/\1.handler.CompletionHandler\3/g' $allFiles
sed -E -i "" 's/([[:space:]]|:|=|\(|\<)(BaseChannel.DeleteMessageHandler|BaseChannel.DeleteMetaCounterHandler|BaseChannel.DeleteMetaDataHandler|BaseChannel.ReportHandler|BaseChannel.ReportMessageHandler|BaseChannel.ReportUserHandler|GroupChannel.GroupChannelAcceptInvitationHandler|GroupChannel.GroupChannelBanHandler|GroupChannel.GroupChannelDeclineInvitationHandler|GroupChannel.GroupChannelDeleteHandler|GroupChannel.GroupChannelFreezeHandler|GroupChannel.GroupChannelHideHandler|GroupChannel.GroupChannelInviteHandler|GroupChannel.GroupChannelJoinHandler|GroupChannel.GroupChannelLeaveHandler|GroupChannel.GroupChannelMuteHandler|GroupChannel.GroupChannelRefreshHandler|GroupChannel.GroupChannelResetMyHistoryHandler|GroupChannel.GroupChannelSetMyCountPreferenceHandler|GroupChannel.GroupChannelSetMyPushTriggerOptionHandler|GroupChannel.GroupChannelSetPushPreferenceHandler|GroupChannel.GroupChannelUnbanHandler|GroupChannel.GroupChannelUnfreezeHandler|GroupChannel.GroupChannelUnhideHandler|GroupChannel.GroupChannelUnmuteHandler|OpenChannel.OpenChannelBanHandler|OpenChannel.OpenChannelDeleteHandler|OpenChannel.OpenChannelEnterHandler|OpenChannel.OpenChannelExitHandler|OpenChannel.OpenChannelMuteHandler|OpenChannel.OpenChannelRefreshHandler|OpenChannel.OpenChannelUnbanHandler|OpenChannel.OpenChannelUnmuteHandler|SendBird.DeleteFriendDiscoveriesHandler|SendBird.DeleteFriendDiscoveryHandler|SendBird.DeleteFriendHandler|SendBird.DeleteFriendsHandler|SendBird.MarkAsReadHandler|SendBird.SetChannelInvitationPreferenceHandler|SendBird.SetDoNotDisturbHandler|SendBird.SetPushSoundHandler|SendBird.SetPushTemplateHandler|SendBird.SetPushTriggerOptionHandler|SendBird.SetSnoozePeriodHandler|SendBird.UnregisterPushTokenHandler|SendBird.UploadFriendDiscoveriesHandler|SendBird.UserInfoUpdateHandler|SendBird.UserUnblockHandler|User.DeleteMetaDataHandler|handlers.AddOperatorsHandler|handlers.AllowFriendDiscoveryHandler)/\1CompletionHandler/g' $allFiles
## FileMessageWithProgressHandler
sed -E -i "" 's/(import com.sendbird.android).(BaseChannel.ResendFileMessageWithProgressHandler|BaseChannel.SendFileMessageWithProgressHandler)(;?$)/\1.handler.FileMessageWithProgressHandler\3/g' $allFiles
sed -E -i "" 's/([[:space:]]|:|=|\(|\<)(BaseChannel.ResendFileMessageWithProgressHandler|BaseChannel.SendFileMessageWithProgressHandler)/\1FileMessageWithProgressHandler/g' $allFiles
## FileMessagesHandler
sed -E -i "" 's/(import com.sendbird.android).BaseChannel.SendFileMessagesHandler(;?$)/\1.handler.FileMessagesHandler\2/g' $allFiles
sed -E -i "" 's/([[:space:]]|:|=|\(|\<)BaseChannel.SendFileMessagesHandler/\1FileMessagesHandler/g' $allFiles
## FileMessagesWithProgressHandler
sed -E -i "" 's/(import com.sendbird.android).BaseChannel.SendFileMessagesWithProgressHandler(;?$)/\1.handler.FileMessagesWithProgressHandler\2/g' $allFiles
sed -E -i "" 's/([[:space:]]|:|=|\(|\<)BaseChannel.SendFileMessagesWithProgressHandler/\1FileMessagesWithProgressHandler/g' $allFiles
## CountHandler
sed -E -i "" 's/(import com.sendbird.android).(GroupChannel.GroupChannelTotalUnreadChannelCountHandler|GroupChannel.GroupChannelTotalUnreadMessageCountHandler|GroupChannel.GroupChannelChannelCountHandler)(;?$)/\1.handler.CountHandler\3/g' $allFiles
sed -E -i "" 's/([[:space:]]|:|=|\(|\<)(GroupChannel.GroupChannelTotalUnreadChannelCountHandler|GroupChannel.GroupChannelTotalUnreadMessageCountHandler|GroupChannel.GroupChannelChannelCountHandler)/\1CountHandler/g' $allFiles
## GroupChannelCallbackHandler
sed -E -i "" 's/(import com.sendbird.android).(GroupChannel.GroupChannelCreateHandler|GroupChannel.GroupChannelGetHandler|GroupChannel.GroupChannelUpdateHandler)(;?$)/\1.handler.GroupChannelCallbackHandler\3/g' $allFiles
sed -E -i "" 's/([[:space:]]|:|=|\(|\<)(GroupChannel.GroupChannelCreateHandler|GroupChannel.GroupChannelGetHandler|GroupChannel.GroupChannelUpdateHandler)/\1GroupChannelCallbackHandler/g' $allFiles
## OpenChannelCallbackHandler
sed -E -i "" 's/(import com.sendbird.android).(OpenChannel.OpenChannelCreateHandler|OpenChannel.OpenChannelGetHandler|OpenChannel.OpenChannelUpdateHandler)(;?$)/\1.handler.OpenChannelCallbackHandler\3/g' $allFiles
sed -E -i "" 's/([[:space:]]|:|=|\(|\<)(OpenChannel.OpenChannelCreateHandler|OpenChannel.OpenChannelGetHandler|OpenChannel.OpenChannelUpdateHandler)/\1OpenChannelCallbackHandler/g' $allFiles
## UsersHandler
sed -E -i "" 's/(import com.sendbird.android).(OperatorListQuery.OperatorListQueryResultHandler|SendBird.AddFriendsHandler)(;?$)/\1.handler.UsersHandler\3/g' $allFiles
sed -E -i "" 's/([[:space:]]|:|=|\(|\<)(OperatorListQuery.OperatorListQueryResultHandler|SendBird.AddFriendsHandler)/\1UsersHandler/g' $allFiles
## UserHandler
sed -E -i "" 's/(import com.sendbird.android).(SendBird.UserBlockHandler)(;?$)/\1.handler.UserHandler\3/g' $allFiles
sed -E -i "" 's/([[:space:]]|:|=|\(|\<)(SendBird.UserBlockHandler)/\1UserHandler/g' $allFiles
## ReactionHandler
sed -E -i "" 's/(import com.sendbird.android).(BaseChannel.ReactionHandler)(;?$)/\1.handler.ReactionHandler\3/g' $allFiles
sed -E -i "" 's/([[:space:]]|:|=|\(|\<)(BaseChannel.ReactionHandler)/\1ReactionHandler/g' $allFiles
## GetThreadedMessagesHandler
sed -E -i "" 's/(import com.sendbird.android).(BaseMessage.GetThreadedMessagesHandler)(;?$)/\1.handler.ThreadedMessagesHandler\3/g' $allFiles
sed -E -i "" 's/([[:space:]]|:|=|\(|\<)(BaseMessage.GetThreadedMessagesHandler)/\1ThreadedMessagesHandler/g' $allFiles
## GetChannelInvitationPreferenceHandler
sed -E -i "" 's/(import com.sendbird.android).(SendBird.GetChannelInvitationPreferenceHandler)(;?$)/\1.handler.ChannelInvitationPreferenceHandler\3/g' $allFiles
sed -E -i "" 's/([[:space:]]|:|=|\(|\<)(SendBird.GetChannelInvitationPreferenceHandler)/\1ChannelInvitationPreferenceHandler/g' $allFiles
## DoNotDisturbHandler
sed -E -i "" 's/(import com.sendbird.android).(SendBird.GetDoNotDisturbHandler)(;?$)/\1.handler.DoNotDisturbHandler\3/g' $allFiles
sed -E -i "" 's/([[:space:]]|:|=|\(|\<)(SendBird.GetDoNotDisturbHandler)/\1DoNotDisturbHandler/g' $allFiles
## RegisterPushTokenWithStatusHandler
sed -E -i "" 's/(import com.sendbird.android).(SendBird.RegisterPushTokenWithStatusHandler)(;?$)/\1.handler.PushTokenWithStatusHandler\3/g' $allFiles
sed -E -i "" 's/([[:space:]]|:|=|\(|\<)(SendBird.RegisterPushTokenWithStatusHandler)/\1PushTokenWithStatusHandler/g' $allFiles
## GetMyMutedInfoHandler
sed -E -i "" 's/(import com.sendbird.android).(BaseChannel.GetMyMutedInfoHandler)(;?$)/\1.handler.MyMutedInfoHandler\3/g' $allFiles
sed -E -i "" 's/([[:space:]]|:|=|\(|\<)(BaseChannel.GetMyMutedInfoHandler)/\1MyMutedInfoHandler/g' $allFiles
## Move GroupChannel inner class
sed -E -i "" 's/(import com.sendbird.android).GroupChannel.(GroupChannelCreateDistinctChannelIfNotExistHandler|GroupChannelGetMyPushTriggerOptionHandler)(;?$)/\1.handler.\2\3/g' $allFiles
sed -E -i "" 's/([[:space:]]|:|=|\(|\<)GroupChannel.(GroupChannelCreateDistinctChannelIfNotExistHandler|GroupChannelGetMyPushTriggerOptionHandler)/\1\2/g' $allFiles
## Move SendBird inner class
sed -E -i "" 's/(import com.sendbird.android).SendBird.(ConnectHandler|ConnectionHandler|DisconnectHandler|UserEventHandler)(;?$)/\1.handler.\2\3/g' $allFiles
sed -E -i "" 's/([[:space:]]|:|=|\(|\<)SendBird.(ConnectHandler|ConnectionHandler|DisconnectHandler|UserEventHandler)/\1\2/g' $allFiles
## handlers to handler
sed -E -i "" 's/(import com.sendbird.android).handlers.(GetAllowFriendDiscoveryHandler|MessageChangeLogsHandler|InitResultHandler|MessageCollectionHandler|MessageCollectionInitHandler|ChannelChangeLogsHandler|RemoveFailedMessagesHandler|CompletionHandler|GroupChannelCollectionHandler)(;?$)/\1.handler.\2\3/g' $allFiles
# Push
sed -E -i "" 's/(import com.sendbird.android).SendBird.(PushTokenType|PushTokenRegistrationStatus)(;?$)/\1.push.\2\3/g' $allFiles
sed -E -i "" 's/([[:space:]]|:|=|\(|\<)SendBird.(PushTokenType|PushTokenRegistrationStatus)/\1\2/g' $allFiles
# Move BaseChannel inner class
sed -E -i "" 's/(import com.sendbird.android).BaseChannel.(ReportCategory|MessageTypeFilter)(;?$)/\1.channel.\2\3/g' $allFiles
sed -E -i "" 's/([[:space:]]|:|=|\(|\<)BaseChannel.(ReportCategory|MessageTypeFilter)/\1\2/g' $allFiles
# Move GroupChannel inner class
sed -E -i "" 's/(import com.sendbird.android).BaseChannel.(HiddenState|CountPreference|ChannelType)(;?$)/\1.channel.\2\3/g' $allFiles
sed -E -i "" 's/([[:space:]]|:|=|\(|\<)BaseChannel.(HiddenState|CountPreference|ChannelType)/\1\2/g' $allFiles
# Move BaseMessage inner class
sed -E -i "" 's/(import com.sendbird.android).BaseMessage.(SendingStatus)(;?$)/\1.message.\2\3/g' $allFiles
sed -E -i "" 's/([[:space:]]|:|=|\(|\<)BaseMessage.(SendingStatus)/\1\2/g' $allFiles
# Move FileMessage inner class
sed -E -i "" 's/(import com.sendbird.android).FileMessage.(Thumbnail|ThumbnailSize)(;?$)/\1.message.\2\3/g' $allFiles
sed -E -i "" 's/([[:space:]]|:|=|\(|\<)FileMessage.(Thumbnail|ThumbnailSize)/\1\2/g' $allFiles
# Move Member inner class
sed -E -i "" 's/(import com.sendbird.android).Member.(MutedState|MemberState)(;?$)/\1.user.\2\3/g' $allFiles
sed -E -i "" 's/([[:space:]]|:|=|\(|\<)Member.(MutedState|MemberState)/\1\2/g' $allFiles
# Move ReactionEvent inner class
sed -E -i "" 's/(import com.sendbird.android).ReactionEvent.(ReactionEventAction)(;?$)/\1.message.\2\3/g' $allFiles
sed -E -i "" 's/([[:space:]]|:|=|\(|\<)ReactionEvent.(ReactionEventAction)/\1\2/g' $allFiles
# Move SendBirdPushHelper inner class
sed -E -i "" 's/(import com.sendbird.android).SendBirdPushHelper.OnPushRequestCompleteListener(;?$)/\1.handler.PushRequestCompleteHandler\2/g' $allFiles
sed -E -i "" 's/([[:space:]]|:|=|\(|\<)SendBirdPushHelper.OnPushRequestCompleteListener/\1PushRequestCompleteHandler/g' $allFiles
# Move GroupChannelMemberListQuery inner class
sed -E -i "" 's/(import com.sendbird.android).GroupChannelMemberListQuery.(OperatorFilter|MutedMemberFilter|MemberStateFilter)(;?$)/\1.user.query.\2\3/g' $allFiles
sed -E -i "" 's/(import com.sendbird.android).GroupChannelMemberListQuery.GroupChannelMemberListQueryResultHandler(;?$)/\1.handler.MembersHandler\2/g' $allFiles
sed -E -i "" 's/([[:space:]]|:|=|\(|\<)GroupChannelMemberListQuery.(OperatorFilter|MutedMemberFilter|MemberStateFilter)/\1\2/g' $allFiles
sed -E -i "" 's/([[:space:]]|:|=|\(|\<)GroupChannelMemberListQuery.GroupChannelMemberListQueryResultHandler/\1MembersHandler/g' $allFiles
# Move GroupChannelListQuery inner class
sed -E -i "" 's/(import com.sendbird.android).(GroupChannelListQuery.SuperChannelFilter|PublicGroupChannelListQuery.SuperChannelFilter)(;?$)/\1.channel.SuperChannelFilter\3/g' $allFiles
sed -E -i "" 's/(import com.sendbird.android).GroupChannelListQuery.(MembershipFilter|SearchField|QueryType|PublicChannelFilter|UnreadChannelFilter|HiddenChannelFilter)(;?$)/\1.channel.query.\2\3/g' $allFiles
sed -E -i "" 's/(import com.sendbird.android).PublicGroupChannelListQuery.(MembershipFilter)(;?$)/\1.channel.query.\2\3/g' $allFiles
sed -E -i "" 's/([[:space:]]|:|=|\(|\<)GroupChannelListQuery.(SuperChannelFilter|MembershipFilter|SearchField|QueryType|PublicChannelFilter|UnreadChannelFilter|HiddenChannelFilter)/\1\2/g' $allFiles
sed -E -i "" 's/(import com.sendbird.android).GroupChannelListQuery.MemberStateFilter(;?$)/\1.channel.query.MyMemberStateFilter\2/g' $allFiles
sed -E -i "" 's/([[:space:]]|:|=|\(|\<)GroupChannelListQuery.MemberStateFilter/\1MyMemberStateFilter/g' $allFiles
sed -E -i "" 's/(import com.sendbird.android).handlers.(OnChannelLoadResultHandler)(;?$)/\1.handler.GroupChannelsCallbackHandler\3/g' $allFiles
sed -E -i "" 's/([[:space:]]|:|=|\(|\<)OnChannelLoadResultHandler/\1GroupChannelsCallbackHandler/g' $allFiles
sed -E -i "" 's/(import com.sendbird.android).(GroupChannelListQuery.GroupChannelListQueryResultHandler|PublicGroupChannelListQuery.PublicGroupChannelListQueryResultHandler)(;?$)/\1.handler.GroupChannelsCallbackHandler\3/g' $allFiles
sed -E -i "" 's/([[:space:]]|:|=|\(|\<)GroupChannelListQuery.GroupChannelListQueryResultHandler/\1GroupChannelsCallbackHandler/g' $allFiles
sed -E -i "" 's/([[:space:]]|:|=|\(|\<)PublicGroupChannelListQuery.PublicGroupChannelListQueryResultHandler/\1GroupChannelsCallbackHandler/g' $allFiles
sed -E -i "" 's/(import com.sendbird.android).(OpenChannelListQuery.OpenChannelListQueryResultHandler)(;?$)/\1.handler.OpenChannelsCallbackHandler\3/g' $allFiles
sed -E -i "" 's/([[:space:]]|:|=|\(|\<)OpenChannelListQuery.OpenChannelListQueryResultHandler/\1OpenChannelsCallbackHandler/g' $allFiles
sed -E -i "" 's/(import com.sendbird.android).(GroupChannelListQuery.Order|PublicGroupChannelListQuery.Order)(;?$)/\1.channel.query.GroupChannelListQueryOrder\3/g' $allFiles
sed -E -i "" 's/([[:space:]]|:|=|\(|\<)(GroupChannelListQuery.Order|PublicGroupChannelListQuery.Order)/\1GroupChannelListQueryOrder/g' $allFiles
# Rename GroupChannelMemberListQuery to MemberListQuery
sed -E -i "" 's/([[:space:]]|:|=|\(|\<)GroupChannelMemberListQuery/\1MemberListQuery/g' $allFiles
# Renamed functions
sed -E -i "" 's/\.updateCurrentUserInfoWithProfileImage(\(|{| {)/\.updateCurrentUserInfo\1/g' $allFiles
sed -E -i "" 's/\.registerPushTokenForCurrentUser(\(|{| {)/\.registerPushToken\1/g' $allFiles
sed -E -i "" 's/\.unregisterPushTokenForCurrentUser(\(|{| {)/\.unregisterPushToken\1/g' $allFiles
sed -E -i "" 's/\.unregisterPushTokenAllForCurrentUser(\(|{| {)/\.unregisterPushTokenAll\1/g' $allFiles
sed -E -i "" 's/\.getMyGroupChannelChangeLogsByTokenWithParams(\(|{| {)/\.getMyGroupChannelChangeLogsByToken\1/g' $allFiles
sed -E -i "" 's/\.getMyGroupChannelChangeLogsByTimestampWithParams(\(|{| {)/\.getMyGroupChannelChangeLogsByTimestamp\1/g' $allFiles
sed -E -i "" 's/\.inviteWithUserId(\(|{| {)/\.invite\1/g' $allFiles
sed -E -i "" 's/\.banUserWithUserId(\(|{| {)/\.banUser\1/g' $allFiles
sed -E -i "" 's/\.unbanUserWithUserId(\(|{| {)/\.unbanUser\1/g' $allFiles
sed -E -i "" 's/\.muteUserWithUserId(\(|{| {)/\.muteUser\1/g' $allFiles
sed -E -i "" 's/\.unmuteUserWithUserId(\(|{| {)/\.unmuteUser\1/g' $allFiles
sed -E -i "" 's/\.isOperatorWithUserId(\(|{| {)/\.isOperator\1/g' $allFiles
sed -E -i "" 's/\.markAsReadWithChannelUrls(\(|{| {)/\.markAsRead\1/g' $allFiles
sed -E -i "" 's/\.blockUserWithUserId(\(|{| {)/\.blockUser\1/g' $allFiles
sed -E -i "" 's/\.unblockUserWithUserId(\(|{| {)/\.unblockUser\1/g' $allFiles
sed -E -i "" 's/\.createChannelWithUserIds(\(|{| {)/\.createChannel\1/g' $allFiles
# Renamed enums
sed -E -i "" 's/EVENT_READ_RECEIPT_UPDATED/EVENT_READ_STATUS_UPDATED/g' $allFiles
sed -E -i "" 's/EVENT_DELIVERY_RECEIPT_UPDATED/EVENT_DELIVERY_STATUS_UPDATED/g' $allFiles
# SendBird
sed -E -i "" 's/(import com.sendbird.android).SendBird(;?$)/\1.SendbirdChat\2/g' $allFiles
sed -E -i "" 's/([[:space:]]|:|=|\(|\<)SendBird\./\1SendbirdChat./g' $allFiles