migration.sh 16.3 KB
Newer Older
1 2
#!/bin/sh

3 4
SED_START='find ./src/android/org/linphone/ -type f -exec sed -i -e '
SED_END='{} \;'
5

6 7
# Imports
eval "$SED_START 's/import org.linphone.tools/import org.linphone.core.tools/g' $SED_END"
8
eval "$SED_START 's/import org.linphone.core.OpenH264DownloadHelperListener/import org.linphone.core.tools.OpenH264DownloadHelperListener/g' $SED_END"
9

10
# Listeners
11 12 13 14
eval "$SED_START 's/AccountCreator.AccountCreatorListener/AccountCreatorListener/g' $SED_END"
eval "$SED_START 's/LinphoneCoreListenerBase/CoreListenerStub/g' $SED_END"
eval "$SED_START 's/LinphoneCoreListener/CoreListener/g' $SED_END"
eval "$SED_START 's/LinphoneChatMessage.LinphoneChatMessageListener/ChatMessageListener/g' $SED_END"
15 16

# Enums
17 18
eval "$SED_START 's/Core.LinphoneLimeState/Core.LimeState/g' $SED_END"
eval "$SED_START 's/LinphoneLimeState/LimeState/g' $SED_END"
19

20
eval "$SED_START 's/GlobalState.GlobalOn/Core.GlobalState.On/g' $SED_END"
21

22 23 24 25
eval "$SED_START 's/RegistrationState.RegistrationOk/RegistrationState.Ok/g' $SED_END"
eval "$SED_START 's/RegistrationState.RegistrationFailed/RegistrationState.Failed/g' $SED_END"
eval "$SED_START 's/RegistrationState.RegistrationCleared/RegistrationState.Cleared/g' $SED_END"
eval "$SED_START 's/RegistrationState.RegistrationProgress/RegistrationState.Progress/g' $SED_END"
26
eval "$SED_START 's/RegistrationState.RegistrationNone/RegistrationState.None/g' $SED_END"
27

28 29 30 31
eval "$SED_START 's/RemoteProvisioningState.ConfiguringSuccessful/ConfiguringState.Successful/g' $SED_END"
eval "$SED_START 's/LinphoneCore.RemoteProvisioningState/Core.ConfiguringState/g' $SED_END"
eval "$SED_START 's/RemoteProvisioningState/ConfiguringState/g' $SED_END"
eval "$SED_START 's/ConfiguringFailed/Failed/g' $SED_END"
32

33
eval "$SED_START 's/CallDirection/Call.Dir/g' $SED_END"
34

35 36 37 38 39
eval "$SED_START 's/State.CallReleased/State.Released/g' $SED_END"
eval "$SED_START 's/State.CallEnd/State.End/g' $SED_END"
eval "$SED_START 's/State.CallUpdatedByRemote/State.UpdatedByRemote/g' $SED_END"
eval "$SED_START 's/State.CallIncomingEarlyMedia/State.IncomingEarlyMedia/g' $SED_END"
eval "$SED_START 's/State.CallUpdating/State.Updating/g' $SED_END"
40

41 42 43
eval "$SED_START 's/LogCollectionUploadState.LogCollectionUploadStateInProgress/LogCollectionUploadState.InProgress/g' $SED_END"
eval "$SED_START 's/LogCollectionUploadState.LogCollectionUploadStateDelivered/LogCollectionUploadState.Delivered/g' $SED_END"
eval "$SED_START 's/LogCollectionUploadState.LogCollectionUploadStateNotDelivered/LogCollectionUploadState.NotDelivered/g' $SED_END"
44

45
eval "$SED_START 's/AccountCreator.RequestStatus/AccountCreator.Status/g' $SED_END"
46
eval "$SED_START 's/RequestStatus/Status/g' $SED_END"
47 48 49 50 51 52 53
eval "$SED_START 's/AccountCreator.Status.Ok/AccountCreator.Status.RequestOk/g' $SED_END"
eval "$SED_START 's/AccountCreator.PasswordCheck/AccountCreator.PasswordStatus/g' $SED_END"
eval "$SED_START 's/AccountCreator.PhoneNumberCheck/AccountCreator.PhoneNumberStatus/g' $SED_END"
eval "$SED_START 's/AccountCreator.EmailCheck/AccountCreator.EmailStatus/g' $SED_END"
eval "$SED_START 's/AccountCreator.UsernameCheck/AccountCreator.UsernameStatus/g' $SED_END"
eval "$SED_START 's/AccountCreator.Status.Failed/AccountCreator.Status.RequestFailed/g' $SED_END"
eval "$SED_START 's/AccountCreator.Status.ErrorServer/AccountCreator.Status.ServerError/g' $SED_END"
54
eval "$SED_START 's/PhoneNumberStatus.CountryCodeInvalid/PhoneNumberStatus.InvalidCountryCode/g' $SED_END"
55

56 57
eval "$SED_START 's/Reason.Media/Reason.NotAcceptable/g' $SED_END"
eval "$SED_START 's/Reason.BadCredentials/Reason.Forbidden/g' $SED_END"
58

59 60 61 62 63 64 65
eval "$SED_START 's/TransportType.LinphoneTransportUdp/TransportType.Udp/g' $SED_END"
eval "$SED_START 's/TransportType.LinphoneTransportTcp/TransportType.Tcp/g' $SED_END"
eval "$SED_START 's/TransportType.LinphoneTransportTls/TransportType.Tls/g' $SED_END"
eval "$SED_START 's/TransportType.LinphoneTransportDtls/TransportType.Dtls/g' $SED_END"

eval "$SED_START 's/AddressFamily.INET_6.getInt()/AddressFamily.Inet6.toInt()/g' $SED_END"
eval "$SED_START 's/AddressFamily.INET.getInt()/AddressFamily.Inet.toInt()/g' $SED_END"
66 67

# Classes
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
eval "$SED_START 's/LpConfig/Config/g' $SED_END"
eval "$SED_START 's/LinphoneCoreException/CoreException/g' $SED_END"
eval "$SED_START 's/LinphoneCoreFactory/Factory/g' $SED_END"
eval "$SED_START 's/LinphoneAccountCreator/AccountCreator/g' $SED_END"
eval "$SED_START 's/LinphoneAddress/Address/g' $SED_END"
eval "$SED_START 's/LinphoneAuthInfo/AuthInfo/g' $SED_END"
eval "$SED_START 's/LinphoneCallLog/CallLog/g' $SED_END"
eval "$SED_START 's/LinphoneCallParams/CallParams/g' $SED_END"
eval "$SED_START 's/LinphoneCallStats/CallStats/g' $SED_END"
eval "$SED_START 's/LinphoneCall/Call/g' $SED_END"
eval "$SED_START 's/LinphoneChatMessage/ChatMessage/g' $SED_END"
eval "$SED_START 's/LinphoneChatRoom/ChatRoom/g' $SED_END"
eval "$SED_START 's/LinphoneConferenceParams/ConferenceParams/g' $SED_END"
eval "$SED_START 's/LinphoneConference/Conference/g' $SED_END"
eval "$SED_START 's/LinphoneConfig/Config/g' $SED_END"
eval "$SED_START 's/LinphoneContent/Content/g' $SED_END"
eval "$SED_START 's/LinphoneCore/Core/g' $SED_END"
eval "$SED_START 's/LinphoneEvent/Event/g' $SED_END"
eval "$SED_START 's/LinphoneFriendList/FriendList/g' $SED_END"
eval "$SED_START 's/LinphoneFriend/Friend/g' $SED_END"
eval "$SED_START 's/LinphoneHeaders/Headers/g' $SED_END"
eval "$SED_START 's/LinphoneImNotifyPolicy/ImNotifyPolicy/g' $SED_END"
eval "$SED_START 's/LinphoneInfoMessage/InfoMessage/g' $SED_END"
eval "$SED_START 's/LinphoneNatPolicy/NatPolicy/g' $SED_END"
eval "$SED_START 's/LinphonePayloadType/PayloadType/g' $SED_END"
eval "$SED_START 's/LinphonePlayer/Player/g' $SED_END"
eval "$SED_START 's/LinphonePresence/Presence/g' $SED_END"
eval "$SED_START 's/LinphonePrivacy/Privacy/g' $SED_END"
eval "$SED_START 's/LinphoneProxyConfig/ProxyConfig/g' $SED_END"
eval "$SED_START 's/LinphonePublishState/PublishState/g' $SED_END"
eval "$SED_START 's/LinphoneRange/Range/g' $SED_END"
eval "$SED_START 's/LinphoneStreamType/StreamType/g' $SED_END"
eval "$SED_START 's/LinphoneSubscription/Subscription/g' $SED_END"
eval "$SED_START 's/LinphoneTransports/Transports/g' $SED_END"
eval "$SED_START 's/LinphoneTunnel/Tunnel/g' $SED_END"
eval "$SED_START 's/LinphoneVcard/Vcard/g' $SED_END"
eval "$SED_START 's/LinphoneXmlRpc/XmlRpc/g' $SED_END"

# Callbacks
eval "$SED_START 's/onChatMessageStateChanged/onMsgStateChanged/g' $SED_END"
eval "$SED_START 's/onChatMessageFileTransferProgressChanged/onFileTransferProgressIndication/g' $SED_END"
eval "$SED_START 's/registrationState/onRegistrationStateChanged/g' $SED_END"

# Methods
112
eval "$SED_START 's/getFriendsLists()/getFriends()/g' $SED_END"
113
eval "$SED_START 's/getFriendLists()/getFriendsLists()/g' $SED_END"
114
eval "$SED_START 's/getFriendList(/getFriendsLists(/g' $SED_END"
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
eval "$SED_START 's/getIdentity(/getIdentityAddress(/g' $SED_END"
eval "$SED_START 's/isTunnelAvailable()/tunnelAvailable()/g' $SED_END"
eval "$SED_START 's/setZrtpSecretsCache(/setZrtpSecretsFile(/g' $SED_END"
eval "$SED_START 's/setRootCA(/setRootCa(/g' $SED_END"
eval "$SED_START 's/isInComingInvitePending()/isIncomingInvitePending()/g' $SED_END"
eval "$SED_START 's/getAudioCodecs()/getAudioPayloadTypes()/g' $SED_END"
eval "$SED_START 's/getVideoCodecs()/getVideoPayloadTypes()/g' $SED_END"
eval "$SED_START 's/getMime()/getMimeType()/g' $SED_END"
eval "$SED_START 's/getFrom()/getFromAddress()/g' $SED_END"
eval "$SED_START 's/getTo()/getToAddress()/g' $SED_END"
eval "$SED_START 's/getUserName()/getUsername()/g' $SED_END"
eval "$SED_START 's/getLimeEncryption()/limeEnabled()/g' $SED_END"
eval "$SED_START 's/getDirection/getDir/g' $SED_END"
eval "$SED_START 's/.getVideoEnabled()/.videoEnabled()/g' $SED_END"
eval "$SED_START 's/.getDataAsString()/.getStringBuffer()/g' $SED_END"
eval "$SED_START 's/getEventName()/getName()/g' $SED_END"
eval "$SED_START 's/setPlaybackGain(/setPlaybackGainDb(/g' $SED_END"
eval "$SED_START 's/isIncall()/inCall()/g' $SED_END"
eval "$SED_START 's/setVideoEnabled(/enableVideo(/g' $SED_END"
eval "$SED_START 's/setAudioBandwidth(/setAudioBandwidthLimit(/g' $SED_END"
eval "$SED_START 's/isAuthenticationTokenVerified()/getAuthenticationTokenVerified()/g' $SED_END"
eval "$SED_START 's/isMicMuted()/!micEnabled()/g' $SED_END"
eval "$SED_START 's/isLowBandwidthEnabled()/lowBandwidthEnabled()/g' $SED_END"
eval "$SED_START 's/muteMic(/enableMic(!/g' $SED_END"
eval "$SED_START 's/getRate()/getClockRate()/g' $SED_END"
eval "$SED_START 's/getSentVideoSize()/getSentVideoDefinition()/g' $SED_END"
eval "$SED_START 's/getReceivedVideoSize()/getReceivedVideoDefinition()/g' $SED_END"
eval "$SED_START 's/getUsedAudioCodec()/getUsedAudioPayloadType()/g' $SED_END"
eval "$SED_START 's/getUsedVideoCodec()/getUsedVideoPayloadType()/g' $SED_END"
eval "$SED_START 's/setVideoWindow(/setNativeVideoWindowId(/g' $SED_END"
eval "$SED_START 's/setPreviewWindow(/setNativePreviewWindowId(/g' $SED_END"
eval "$SED_START 's/islimeAvailable()/limeAvailable()/g' $SED_END"
eval "$SED_START 's/createChatMessage(/createMessage(/g' $SED_END"
148
#For messages only
149
eval "$SED_START 's/message.getStatus()/message.getState()/g' $SED_END"
150
#
151 152 153 154 155 156
eval "$SED_START 's/reSend()/resend()/g' $SED_END"
eval "$SED_START 's/setAppData(/setAppdata(/g' $SED_END"
eval "$SED_START 's/getAppData()/getAppdata()/g' $SED_END"
eval "$SED_START 's/getOrCreateChatRoom(/getChatRoomFromUri(/g' $SED_END"
eval "$SED_START 's/findFriendByAddress(/findFriend(/g' $SED_END"
eval "$SED_START 's/getTimestamp()/getStartDate()/g' $SED_END"
157
#For ProxyConfigs only 
158
eval "$SED_START 's/lpc.getAddress()/lpc.getIdentityAddress()/g' $SED_END"
159 160 161
eval "$SED_START 's/cfg.getAddress()/cfg.getIdentityAddress()/g' $SED_END"
eval "$SED_START 's/prxCfg.getAddress()/prxCfg.getIdentityAddress()/g' $SED_END"
eval "$SED_START 's/proxy.getAddress()/proxy.getIdentityAddress()/g' $SED_END"
162
#
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177
eval "$SED_START 's/getCallDuration()/getDuration()/g' $SED_END"
eval "$SED_START 's/isVCardSupported()/vcardSupported()/g' $SED_END"
eval "$SED_START 's/getPresenceModelForUri(/getPresenceModelForUriOrTel(/g' $SED_END"
eval "$SED_START 's/setAvpfRRInterval(/setAvpfRrInterval(/g' $SED_END"
eval "$SED_START 's/getProxy()/getServerAddr()/g' $SED_END"
eval "$SED_START 's/setProxy(/setServerAddr(/g' $SED_END"
eval "$SED_START 's/setIdentity(/setIdentityAddress(/g' $SED_END"
eval "$SED_START 's/setUserId(/setUserid(/g' $SED_END"
eval "$SED_START 's/getUserId(/getUserid(/g' $SED_END"
eval "$SED_START 's/getAuthInfosList(/getAuthInfoList(/g' $SED_END"
eval "$SED_START 's/getSignalingTransportPorts()/getTransports()/g' $SED_END"
eval "$SED_START 's/setSignalingTransportPorts(/setTransports(/g' $SED_END"
eval "$SED_START 's/isIpv6Enabled()/ipv6Enabled()/g' $SED_END"
eval "$SED_START 's/isAdaptiveRateControlEnabled()/adaptiveRateControlEnabled()/g' $SED_END"
eval "$SED_START 's/setLimeEncryption(/enableLime(/g' $SED_END"
178
#For enums only
179
eval "$SED_START 's/.value()/.toInt()/g' $SED_END"
180
#
181 182 183 184 185 186 187
eval "$SED_START 's/clearAuthInfos()/clearAllAuthInfo()/g' $SED_END"
eval "$SED_START 's/clearProxyConfigs()/clearProxyConfig()/g' $SED_END"
eval "$SED_START 's/isVideoSupported()/videoSupported()/g' $SED_END"
eval "$SED_START 's/VideoDefinition().toDisplayableString()/VideoDefinition().getName()/g' $SED_END"
eval "$SED_START 's/isAccountUsed/isAccountExist()/g' $SED_END"
eval "$SED_START 's/loadXmlFile(/loadFromXmlFile(/g' $SED_END"
eval "$SED_START 's/activatePhoneNumberLink()/activateAlias()/g' $SED_END"
188 189
eval "$SED_START 's/isPhoneNumberUsed()/isAliasUsed()/g' $SED_END"
eval "$SED_START 's/recoverPhoneAccount()/recoverAccount()/g' $SED_END"
190
eval "$SED_START 's/isLimeEncryptionAvailable()/limeAvailable()/g' $SED_END"
191 192 193 194 195 196 197 198
eval "$SED_START 's/getUseRfc2833ForDtmfs/getUseRfc2833ForDtmf/g' $SED_END"
eval "$SED_START 's/setUseRfc2833ForDtmfs/setUseRfc2833ForDtmf/g' $SED_END"
eval "$SED_START 's/getUseSipInfoForDtmfs/getUseInfoForDtmf/g' $SED_END"
eval "$SED_START 's/setUseSipInfoForDtmfs/setUseInfoForDtmf/g' $SED_END"
eval "$SED_START 's/getIncomingTimeout/getIncTimeout/g' $SED_END"
eval "$SED_START 's/setIncomingTimeout/setIncTimeout/g' $SED_END"
eval "$SED_START 's/migrateCallLogs()/migrateLogsFromRcToDb()/g' $SED_END"
eval "$SED_START 's/setRLSUri/setRlsUri/g' $SED_END"
199 200 201 202 203

# Removed methods
eval "$SED_START 's/.isRegistered()/.getState() == RegistrationState.Ok/g' $SED_END"
eval "$SED_START 's/getBool(/getInt(/g' $SED_END"
eval "$SED_START 's/setBool(/setInt(/g' $SED_END"
204
eval "$SED_START 's/isInConference()/(getConference() != null)/g' $SED_END"
205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223
eval "$SED_START 's/getAudioStats()/getStats(StreamType.Audio)/g' $SED_END"
eval "$SED_START 's/getVideoStats()/getStats(StreamType.Video)/g' $SED_END"
eval "$SED_START 's/getVcardToString()/getVcard().asVcard4String()/g' $SED_END"
eval "$SED_START 's/getVideoAutoInitiatePolicy()/getVideoActivationPolicy().getAutomaticallyInitiate()/g' $SED_END"
eval "$SED_START 's/setFamilyName(/getVcard().setFamilyName(/g' $SED_END"
eval "$SED_START 's/setGivenName(/getVcard().setGivenName(/g' $SED_END"
eval "$SED_START 's/setOrganization(/getVcard().setOrganization(/g' $SED_END"
eval "$SED_START 's/getFamilyName()/getVcard().getFamilyName()/g' $SED_END"
eval "$SED_START 's/getGivenName()/getVcard().getGivenName()/g' $SED_END"
eval "$SED_START 's/getOrganization()/getVcard().getOrganization()/g' $SED_END"
eval "$SED_START 's/enableAvpf(/setAvpfMode(AVPFMode.Enabled)/g' $SED_END"
eval "$SED_START 's/transports.udp = /transports.setUdpPort(/g' $SED_END"
eval "$SED_START 's/transports.tcp = /transports.setTcpPort(/g' $SED_END"
eval "$SED_START 's/transports.tls = /transports.setTlsPort(/g' $SED_END"
eval "$SED_START 's/transports.udp/transports.getUdpPort()/g' $SED_END"
eval "$SED_START 's/transports.tcp/transports.getTcpPort()/g' $SED_END"
eval "$SED_START 's/transports.tls/transports.getTlsPort()/g' $SED_END"
eval "$SED_START 's/getPrimaryContactUsername()/getPrimaryContactParsed().getUsername()/g' $SED_END"
eval "$SED_START 's/getPrimaryContactDisplayName()/getPrimaryContactParsed().getDisplayName()/g' $SED_END"
224
eval "$SED_START 's/.sendDtmf(/.getCurrentCall().sendDtmf(/g' $SED_END"
225 226 227
eval "$SED_START 's/content.getData() == null/content.getSize() == 0/'g $SED_END"
eval "$SED_START 's/lc.downloadOpenH264Enabled()/OpenH264DownloadHelper.isOpenH264DownloadEnabled()/g' $SED_END"
eval "$SED_START 's/enableDownloadOpenH264(/OpenH264DownloadHelper.enableDownloadOpenH264(/g' $SED_END"
228
eval "$SED_START 's/mLc.destroy()/mLc = null/g' $SED_END"
Sylvain Berfini's avatar
Sylvain Berfini committed
229 230
eval "$SED_START 's/getAllDialPlan()/getDialPlans()/g' $SED_END"
eval "$SED_START 's/getCountryName()/getCountry()/g' $SED_END"
231
eval "$SED_START 's/getMSFactory()/getMediastreamerFactory()/g' $SED_END"
232 233
eval "$SED_START 's/accountCreator.getPrefix(/org.linphone.core.Utils::getPrefixFromE164(/g' $SED_END"
eval "$SED_START 's/proxyConfig.lookupCCCFromIso(/org.linphone.core.Utils::getCccFromIso(/g' $SED_END"
234 235
eval "$SED_START 's/linkPhoneNumberWithAccount()/linkAccount()/g' $SED_END"
eval "$SED_START 's/zoomVideo(/zoom(/g' $SED_END"
236 237

#Changes in library required
238
#Tunnel
239
#LinphoneBuffer
240
#AccountCreator.updatePassword
241 242

#Android specifics not wrapped automatically
243 244
#Core.needsEchoCalibration()
#Core.hasCrappyOpenGL()
245
#Core.startEchoCalibration
246 247
#Core.startEchoTester
#Core.stopEchoTester
248 249 250 251 252 253 254

# For the payloads, get the list from the Core, call the method on the object directly and set it back if required
#Core.enablePayloadType()
#Core.isPayloadTypeEnabled()
#Core.payloadTypeIsVbr()
#Core.setPayloadTypeBitrate()

255 256 257 258 259
#Factory.createLpConfigFromString => Config.newFromBuffer
#Factory.createLpConfig => Config.newWithFactory or Core.createConfig
#Core.getVideoDevice and Core.setVideoDevice now takes/returns String instead of int
#Factory.createAccountCreator() => Core.createAccountCreator()
#Factory.createPresenceModel() => Core.createPresenceModel()
260 261 262
#CallParams.getJitterBufferSize() => CallStatsImpl.getJitterBufferSizeMs()
#Core.getSupportedVideoSizes() => Factory.getSupportedVideoDefinitions()
#Core.removeFriend() => FriendList.removeFriend()
263
#Core.getFriendsLists() => now returns a FriendList[] instead of a Friend[]
264
#Core.enableSpeaker / isSpeakerEnabled() => mAudioManager.setSpeakerphoneOn(speakerOn);
265
#Core.enableVideo(true, true) => Core.enableVideoCapture(bool) & Core.enableVideoDisplay(bool)
266
#Core.setCpuCount() => Not needed anymore, can be removed
267 268 269
#Factory.instance().setLogCollectionPath(getFilesDir().getAbsolutePath()); => Core.setLogCollectionPath
#Factory.instance().enableLogCollection(isDebugEnabled); => COre.enableLogCollection
#Factory.instance().setDebugMode(isDebugEnabled, getString(R.string.app_name)); => Core.setLogLevelMask