Esempio n. 1
0
        public override void OnCreate()
        {
            base.OnCreate();

            messenger      = new Messenger(new VpnServiceHandler(this));
            currentService = this;
        }
Esempio n. 2
0
        public override void OnDestroy()
        {
            Log.Debug(TAG, "OnDestroy");
            messenger.Dispose();
            currentService = null;

            base.OnDestroy();

            // kill this service to reset memory, otherwise libtrojan.so won't work
            Android.OS.Process.KillProcess(Android.OS.Process.MyPid());
        }
Esempio n. 3
0
        public static void ShowAutoNotification(Context context, string title)
        {
            NotificationCompat.Builder builder = new NotificationCompat.Builder(context, TrojanPlusMainActivity.AutoChannelID)
                                                 .SetContentTitle(title)
                                                 .SetContentIntent(TrojanPlusVPNService.CreatePendingIntent())
                                                 .SetSmallIcon(Resource.Mipmap.notification_small_icon)
                                                 .SetPriority((int)NotificationPriority.Low)
                                                 .SetAutoCancel(true);

            NotificationManagerCompat notificationManager = NotificationManagerCompat.From(context);

            notificationManager.Notify(TrojanPlusMainActivity.AutoNotificationId, builder.Build());
        }
        public TrojanPlusNotification(TrojanPlusVPNService service)
        {
            this.service = service;

            CreateNotificationChannel();

            builder = new NotificationCompat.Builder(service, ChannelID)
                      .SetWhen(0)
                      .SetContentTitle(Resx.TextResource.Notification_Title)
                      .SetContentIntent(TrojanPlusVPNService.CreatePendingIntent())
                      .SetSmallIcon(Resource.Mipmap.notification_small_icon)
                      .SetCategory(NotificationCompat.CategoryService)
                      .SetPriority((int)NotificationPriority.High);
        }
Esempio n. 5
0
 public string GetTrojanPlusLibVersion()
 {
     return(TrojanPlusVPNService.GetTrojanPlusLibVersion());
 }
Esempio n. 6
0
 public VpnServiceHandler(TrojanPlusVPNService service)
 {
     this.service = service;
 }
Esempio n. 7
0
 public WorkerThread(TrojanPlusVPNService service)
 {
     this.service = service;
 }