gt:     if (paramString1.length > 3)
context: package org.vidogram.VidogramUi.WebRTC;
  
  import android.content.Context;
  import android.os.Environment;
  import android.os.ParcelFileDescriptor;
  import java.io.File;
  import java.nio.ByteBuffer;
  import java.util.EnumSet;
  import java.util.Iterator;
  import java.util.LinkedList;
  import java.util.List;
  import java.util.Timer;
  import java.util.TimerTask;
  import java.util.concurrent.Executors;
  import java.util.concurrent.ScheduledExecutorService;
  import java.util.regex.Matcher;
  import java.util.regex.Pattern;
  import org.json.JSONException;
  import org.json.JSONObject;
  import org.vidogram.VidogramUi.WebRTC.a.a.b;
  import org.vidogram.messenger.FileLog;
  import org.webrtc.AudioSource;
  import org.webrtc.AudioTrack;
  import org.webrtc.CameraVideoCapturer;
  import org.webrtc.DataChannel;
  import org.webrtc.DataChannel.Buffer;
  import org.webrtc.DataChannel.Init;
  import org.webrtc.DataChannel.Observer;
  import org.webrtc.EglBase.Context;
  import org.webrtc.IceCandidate;
  import org.webrtc.Logging;
  import org.webrtc.Logging.Severity;
  import org.webrtc.Logging.TraceLevel;
  import org.webrtc.MediaConstraints;
  import org.webrtc.MediaConstraints.KeyValuePair;
  import org.webrtc.MediaStream;
  import org.webrtc.MediaStreamTrack;
  import org.webrtc.PeerConnection;
  import org.webrtc.PeerConnection.BundlePolicy;
  import org.webrtc.PeerConnection.ContinualGatheringPolicy;
  import org.webrtc.PeerConnection.IceConnectionState;
  import org.webrtc.PeerConnection.IceGatheringState;
  import org.webrtc.PeerConnection.KeyType;
  import org.webrtc.PeerConnection.Observer;
  import org.webrtc.PeerConnection.RTCConfiguration;
  import org.webrtc.PeerConnection.RtcpMuxPolicy;
  import org.webrtc.PeerConnection.SignalingState;
  import org.webrtc.PeerConnection.TcpCandidatePolicy;
  import org.webrtc.PeerConnectionFactory;
  import org.webrtc.PeerConnectionFactory.Options;
  import org.webrtc.RtpParameters;
  import org.webrtc.RtpParameters.Encoding;
  import org.webrtc.RtpSender;
  import org.webrtc.SdpObserver;
  import org.webrtc.SessionDescription;
  import org.webrtc.StatsObserver;
  import org.webrtc.StatsReport;
  import org.webrtc.VideoCapturer;
  import org.webrtc.VideoRenderer;
  import org.webrtc.VideoRenderer.Callbacks;
  import org.webrtc.VideoSource;
  import org.webrtc.VideoTrack;
  import org.webrtc.voiceengine.WebRtcAudioManager;
  import org.webrtc.voiceengine.WebRtcAudioUtils;
  
  public class d
  {
    private static final d b = new d();
    private d A;
    private LinkedList<IceCandidate> B;
    private c C;
    private boolean D;
    private SessionDescription E;
    private MediaStream F;
    private VideoCapturer G;
    private boolean H;
    private VideoTrack I;
    private VideoTrack J;
    private RtpSender K;
    private VideoRenderer L;
    private boolean M;
    private AudioTrack N;
    private DataChannel O;
    private boolean P;
    PeerConnectionFactory.Options a = null;
    private final b c = new b(null);
    private final e d = new e(null);
    private final ScheduledExecutorService e = Executors.newSingleThreadScheduledExecutor();
    private Context f;
    private PeerConnectionFactory g;
    private PeerConnection h;
    private AudioSource i;
    private VideoSource j;
    private boolean k;
    private boolean l;
    private String m;
    private boolean n;
    private boolean o;
    private Timer p;
    private VideoRenderer.Callbacks q;
    private List<VideoRenderer.Callbacks> r;
    private a.b s;
    private MediaConstraints t;
    private int u;
    private int v;
    private int w;
    private MediaConstraints x;
    private ParcelFileDescriptor y;
    private MediaConstraints z;
  
    public static d a()
    {
      return b;
    }
  
    private VideoTrack a(VideoCapturer paramVideoCapturer)
    {
      this.j = this.g.createVideoSource(paramVideoCapturer);
      paramVideoCapturer.startCapture(this.u, this.v, this.w);
      this.I = this.g.createVideoTrack("ARDAMSv0", this.j);
      this.I.setEnabled(false);
      g();
      this.L = new VideoRenderer(this.q);
      this.I.addRenderer(this.L);
      return this.I;
    }
  
    private void a(Context paramContext)
    {
      PeerConnectionFactory.initializeInternalTracer();
      if (this.A.b)
        PeerConnectionFactory.startInternalTracingCapture(Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + "webrtc-trace.txt");
      FileLog.d("PCRTCClientCreate peer connection factory. Use video: " + this.A.a);
      this.o = false;
      label151: boolean bool;
      if (this.A.i)
      {
        PeerConnectionFactory.initializeFieldTrials("WebRTC-FlexFEC-03/Enabled/");
        FileLog.d("PCRTCClientEnable FlexFEC field trial.");
        this.m = "VP8";
        if ((this.k) && (this.A.g != null))
        {
          if (!this.A.g.equals("VP9"))
            break label390;
          this.m = "VP9";
        }
        FileLog.d("PCRTCClientPreferred video codec: " + this.m);
        if ((this.A.k == null) || (!this.A.k.equals("ISAC")))
          break label416;
        bool = true;
        label205: this.l = bool;
        if (this.A.n)
          break label421;
        FileLog.d("PCRTCClientDisable OpenSL ES audio even if device supports it");
        WebRtcAudioManager.setBlacklistDeviceForOpenSLESUsage(true);
        label230: if (!this.A.o)
          break label434;
        FileLog.d("PCRTCClientDisable built-in AEC even if device supports it");
        WebRtcAudioUtils.setWebRtcBasedAcousticEchoCanceler(true);
        label250: if (!this.A.p)
          break label447;
        FileLog.d("PCRTCClientDisable built-in AGC even if device supports it");
        WebRtcAudioUtils.setWebRtcBasedAutomaticGainControl(true);
        label270: if (!this.A.q)
          break label460;
        FileLog.d("PCRTCClientDisable built-in NS even if device supports it");
        WebRtcAudioUtils.setWebRtcBasedNoiseSuppressor(true);
      }
      while (true)
      {
        if (!PeerConnectionFactory.initializeAndroidGlobals(paramContext, true, true, this.A.h))
          this.C.b("Failed to initializeAndroidGlobals");
        if (this.a != null)
          FileLog.d("PCRTCClientFactory networkIgnoreMask option: " + this.a.networkIgnoreMask);
        this.f = paramContext;
        this.g = new PeerConnectionFactory(this.a);
        FileLog.d("PCRTCClientPeer connection factory created.");
        return;
        PeerConnectionFactory.initializeFieldTrials("");
        break;
        label390: if (!this.A.g.equals("H264"))
          break label151;
        this.m = "H264";
        break label151;
        label416: bool = false;
        break label205;
        label421: FileLog.d("PCRTCClientAllow OpenSL ES audio if device supports it");
        WebRtcAudioManager.setBlacklistDeviceForOpenSLESUsage(false);
        break label230;
        label434: FileLog.d("PCRTCClientEnable built-in AEC if device supports it");
        WebRtcAudioUtils.setWebRtcBasedAcousticEchoCanceler(false);
        break label250;
        label447: FileLog.d("PCRTCClientEnable built-in AGC if device supports it");
        WebRtcAudioUtils.setWebRtcBasedAutomaticGainControl(false);
        break label270;
        label460: FileLog.d("PCRTCClientEnable built-in NS if device supports it");
        WebRtcAudioUtils.setWebRtcBasedNoiseSuppressor(false);
      }
    }
  
    private void a(EglBase.Context paramContext)
    {
      if ((this.g == null) || (this.o))
      {
        FileLog.e("PCRTCClientPeerconnection factory is not created");
        return;
      }
      FileLog.d("PCRTCClientCreate peer connection.");
      FileLog.d("PCRTCClientPCConstraints: " + this.t.toString());
      this.B = new LinkedList();
      if (this.k)
      {
        FileLog.d("PCRTCClientEGLContext: " + paramContext);
        this.g.setVideoHwAccelerationOptions(paramContext, paramContext);
      }
      paramContext = new PeerConnection.RTCConfiguration(this.s.a);
      paramContext.tcpCandidatePolicy = PeerConnection.TcpCandidatePolicy.DISABLED;
      paramContext.bundlePolicy = PeerConnection.BundlePolicy.MAXBUNDLE;
      paramContext.rtcpMuxPolicy = PeerConnection.RtcpMuxPolicy.REQUIRE;
      paramContext.continualGatheringPolicy = PeerConnection.ContinualGatheringPolicy.GATHER_CONTINUALLY;
      paramContext.keyType = PeerConnection.KeyType.ECDSA;
      this.h = this.g.createPeerConnection(paramContext, this.t, this.c);
      if (this.P)
      {
        paramContext = new DataChannel.Init();
        paramContext.ordered = d.a(this.A).a;
        paramContext.negotiated = d.a(this.A).e;
        paramContext.maxRetransmits = d.a(this.A).c;
        paramContext.maxRetransmitTimeMs = d.a(this.A).b;
        paramContext.id = d.a(this.A).f;
        paramContext.protocol = d.a(this.A).d;
        this.O = this.h.createDataChannel("Vidogram WebRTC data", paramContext);
      }
      this.D = false;
      Logging.enableTracing("logcat:", EnumSet.of(Logging.TraceLevel.TRACE_DEFAULT));
      Logging.enableLogToDebugOutput(Logging.Severity.LS_INFO);
      this.F = this.g.createLocalMediaStream("ARDAMS");
      if (this.k)
        this.F.addTrack(a(this.G));
      this.F.addTrack(m());
      this.h.addStream(this.F);
      if (this.k)
        n();
      if (this.A.m);
      try
      {
        this.y = ParcelFileDescriptor.open(new File(Environment.getExternalStorageDirectory().getPath() + File.separator + "Download/audio.aecdump"), 1006632960);
        this.g.startAecDump(this.y.getFd(), -1);
        FileLog.d("PCRTCClientPeer connection created.");
        return;
      }
      catch (java.io.IOException paramContext)
      {
        while (true)
          FileLog.e("PCRTCClientCan not open aecdump file", paramContext);
      }
    }
  
    private static String b(String paramString1, String paramString2, boolean paramBoolean)
    {
      int i4 = 0;
      String[] arrayOfString = paramString1.split("\r\n");
      String str2 = null;
      Pattern localPattern = Pattern.compile("^a=rtpmap:(\\d+) " + paramString2 + "(/\\d+)+[\r]?$");
      String str1 = "m=video ";
      if (paramBoolean)
        str1 = "m=audio ";
      int i1 = 0;
      int i2 = -1;
      if ((i1 < arrayOfString.length) && ((i2 == -1) || (str2 == null)))
      {
        int i3;
        if (arrayOfString[i1].startsWith(str1))
          i3 = i1;
        while (true)
        {
          i1 += 1;
          i2 = i3;
          break;
          Matcher localMatcher = localPattern.matcher(arrayOfString[i1]);
          i3 = i2;
          if (!localMatcher.matches())
            continue;
          str2 = localMatcher.group(1);
          i3 = i2;
        }
      }
      if (i2 == -1)
      {
        FileLog.w("PCRTCClientNo " + str1 + " line, so can't prefer " + paramString2);
        return paramString1;
      }
      if (str2 == null)
      {
        FileLog.w("PCRTCClientNo rtpmap for " + paramString2);
        return paramString1;
      }
      FileLog.d("PCRTCClientFound " + paramString2 + " rtpmap " + str2 + ", prefer at " + arrayOfString[i2]);
      paramString1 = arrayOfString[i2].split(" ");
  