示例#1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            if (ApplicationObject == null)
            {
                try
                {
                    ApplicationObject = AndroidAppParser.ReadApk(ApkPath);
                }
                catch (Exception)
                {
                    MessageBox.Show("Decompile error!", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    Application.Exit();
                    Environment.Exit(-1);
                }
            }

            apkPath.Text = ApplicationObject.ApkPath;
            pkgName.Text = ApplicationObject.PackageName;
            appName.Text = ApplicationObject.AppName;

            if (ApplicationObject.Logo != null)
            {
                appLogo.Image = ApplicationObject.Logo;
            }

            if (APKMain.sw != null)
            {
                APKMain.sw.Hide();
            }
        }
示例#2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            AndroidApplication = Application as AndroidApplication;
            AndroidApplication.Logger.Debug(() => $"DownloadActivity:OnCreate");

            base.OnCreate(savedInstanceState);

            // Set our view from the layout resource
            SetContentView(Resource.Layout.activity_download);

            RvDownloads     = FindViewById <EmptyRecyclerView>(Resource.Id.rvDownloads);
            ProgressSpinner = FindViewById <ProgressSpinnerView>(Resource.Id.progressBar);
            NoDataView      = FindViewById <LinearLayout>(Resource.Id.layNoData);

            RvDownloads.SetLayoutManager(new LinearLayoutManager(this));
            RvDownloads.AddItemDecoration(new DividerItemDecoration(this, DividerItemDecoration.Vertical));
            RvDownloads.SetEmptyView(NoDataView);
            Adapter = new SyncItemRecyclerAdapter(this);
            RvDownloads.SetAdapter(Adapter);

            var factory = AndroidApplication.IocContainer.Resolve <ViewModelFactory>();

            ViewModel = new ViewModelProvider(this, factory).Get(Java.Lang.Class.FromType(typeof(DownloadViewModel))) as DownloadViewModel;
            Lifecycle.AddObserver(ViewModel);
            SetupViewModelObservers();

            ViewModel.Initialise(AndroidApplication.ControlFile);
            Task.Run(() => ViewModel.FindEpisodesToDownload());

            AndroidApplication.Logger.Debug(() => $"DownloadActivity:OnCreate - end");
        }
示例#3
0
        private static AndroidApplication GetApplicationObject(string outPath, string valueXml, string apkPath)
        {
            string manifestXml = outPath + "\\AndroidManifest.xml";

            ReturnStruct rs = GetPathsAndPackageName(manifestXml);

            string appNV   = rs.appNameV;
            string package = rs.packageName;
            string appN    = rs.nameWritesDirectly ? rs.appNameV : GetAppNameByVariableName(valueXml, appNV);
            string logoPath;

            try
            {
                logoPath = GetLogoPath(rs.logoV, outPath);
            }
            catch (Exception)
            {
                logoPath = null;
            }


            AndroidApplication appO = new AndroidApplication(appN, package, apkPath, logoPath);

            return(appO);
        }
        private void ApkDetails_Click(object sender, EventArgs e)
        {
            MessageBox.Show("This action will take a while, please wait patiently.", "Hint");

            string apkP = (string)apps.Items[apps.SelectedIndex];

            AndroidApplication app = AndroidAppParser.ReadApk(apkP);

            new ApkWindow(app, false).Show();
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            RequestWindowFeature(WindowFeatures.NoTitle);
            Window.SetFlags(WindowManagerFlags.Fullscreen, WindowManagerFlags.Fullscreen);

            var config = new AndroidApplicationConfig(this);

            _application = new AndroidApplication(config);
            _game        = new DemoGame(_application);
            _application.Run(_game);
            SetContentView(_application.View);
        }
示例#6
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            AndroidApplication.CreateDefault(this)
            .UseEmbededResourceProvider("quasar\\dist\\spa", typeof(SpiderEye.Sample.WeatherForecast).Assembly)
            .Run("http://local/index.html");



            //AndroidApplication.Run(this);
        }
示例#7
0
        public override void OnCreate(Bundle savedInstanceState)
        {
            AndroidApplication = Activity.Application as AndroidApplication;
            AndroidApplication.Logger.Debug(() => $"SettingsFragment:OnCreate");

            base.OnCreate(savedInstanceState);

            var factory = AndroidApplication.IocContainer.Resolve <ViewModelFactory>();

            ViewModel = new ViewModelProvider(this, factory).Get(Java.Lang.Class.FromType(typeof(SettingsViewModel))) as SettingsViewModel;
            Lifecycle.AddObserver(ViewModel);
            SetupViewModelObservers();

            ViewModel.Initialise();
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            AndroidApplication = Application as AndroidApplication;
            AndroidApplication.Logger.Debug(() => $"DownloadActivity:OnCreate");

            base.OnCreate(savedInstanceState);

            // Set our view from the layout resource
            SetContentView(Resource.Layout.activity_download);

            RvDownloads     = FindViewById <EmptyRecyclerView>(Resource.Id.rvDownloads);
            NoDataView      = FindViewById <LinearLayout>(Resource.Id.layNoData);
            NoDataText      = FindViewById <TextView>(Resource.Id.txtNoData);
            ProgressSpinner = FindViewById <ProgressSpinnerView>(Resource.Id.progressBar);
            DownloadButton  = FindViewById <FloatingActionButton>(Resource.Id.fab_download);

            RvDownloads.SetLayoutManager(new LinearLayoutManager(this));
            RvDownloads.AddItemDecoration(new DividerItemDecoration(this, DividerItemDecoration.Vertical));
            RvDownloads.SetEmptyView(NoDataView);

            var factory = AndroidApplication.IocContainer.Resolve <ViewModelFactory>();

            ViewModel = new ViewModelProvider(this, factory).Get(Java.Lang.Class.FromType(typeof(DownloadViewModel))) as DownloadViewModel;

            Adapter = new DownloadRecyclerItemAdapter(this, ViewModel);
            RvDownloads.SetAdapter(Adapter);

            Lifecycle.AddObserver(ViewModel);
            SetupViewModelObservers();

            ViewModel.Initialise();
            Task.Run(() => ViewModel.FindEpisodesToDownload());

            DownloadButton.Click += (sender, e) => ViewModel.DownloadAllPodcastsWithNetworkCheck();

            ExitPromptDialogFragment = SupportFragmentManager.FindFragmentByTag(EXIT_PROMPT_TAG) as OkCancelDialogFragment;
            SetupFragmentObservers(ExitPromptDialogFragment);
            NetworkPromptDialogFragment = SupportFragmentManager.FindFragmentByTag(NETWORK_PROMPT_TAG) as OkCancelDialogFragment;
            SetupFragmentObservers(NetworkPromptDialogFragment);

            AndroidApplication.Logger.Debug(() => $"DownloadActivity:OnCreate - end");
        }
示例#9
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            AndroidApplication = Application as AndroidApplication;
            AndroidApplication.Logger.Debug(() => $"ExampleActivity:OnCreate");

            base.OnCreate(savedInstanceState);

            // Set our view from the layout resource
            SetContentView(Resource.Layout.activity_example);

            var factory = AndroidApplication.IocContainer.Resolve <ViewModelFactory>();

            ViewModel = new ViewModelProvider(this, factory).Get(Java.Lang.Class.FromType(typeof(ExampleViewModel))) as ExampleViewModel;
            Lifecycle.AddObserver(ViewModel);
            SetupLiveDataViewModelObservers();
            SetupViewModelObservers();

            ViewModel.Initialise();

            AndroidApplication.Logger.Debug(() => $"ExampleActivity:OnCreate - end");
        }
示例#10
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            AndroidApplication = Application as AndroidApplication;
            AndroidApplication.Logger.Debug(() => $"OpenSourceLicensesActivity:OnCreate");

            base.OnCreate(savedInstanceState);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            SetContentView(Resource.Layout.activity_opensourcelicenses);

            LicenseTextScroller = FindViewById <ScrollView>(Resource.Id.license_scroller);
            LicenseText         = FindViewById <TextView>(Resource.Id.license_text);

            var factory = AndroidApplication.IocContainer.Resolve <ViewModelFactory>();

            ViewModel = new ViewModelProvider(this, factory).Get(Java.Lang.Class.FromType(typeof(OpenSourceLicensesViewModel))) as OpenSourceLicensesViewModel;
            Lifecycle.AddObserver(ViewModel);
            SetupViewModelObservers();

            ViewModel.Initialise();

            AndroidApplication.Logger.Debug(() => $"OpenSourceLicensesActivity:OnCreate - end");
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            AndroidApplication = Application as AndroidApplication;
            AndroidApplication.Logger.Debug(() => $"PurgeActivity:OnCreate");

            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            base.OnCreate(savedInstanceState);

            // Set our view from the layout resource
            SetContentView(Resource.Layout.activity_purge);

            RvPurgeItems    = FindViewById <EmptyRecyclerView>(Resource.Id.rvPurge);
            NoDataView      = FindViewById <LinearLayout>(Resource.Id.layNoDataPurge);
            ProgressSpinner = FindViewById <ProgressSpinnerView>(Resource.Id.progressBarPurge);
            DeleteButton    = FindViewById <FloatingActionButton>(Resource.Id.fab_delete);

            RvPurgeItems.SetLayoutManager(new LinearLayoutManager(this));
            RvPurgeItems.AddItemDecoration(new DividerItemDecoration(this, DividerItemDecoration.Vertical));
            RvPurgeItems.SetEmptyView(NoDataView);

            var factory = AndroidApplication.IocContainer.Resolve <ViewModelFactory>();

            ViewModel = new ViewModelProvider(this, factory).Get(Java.Lang.Class.FromType(typeof(PurgeViewModel))) as PurgeViewModel;

            Adapter = new PurgeRecyclerItemAdapter(this, ViewModel);
            RvPurgeItems.SetAdapter(Adapter);

            Lifecycle.AddObserver(ViewModel);
            SetupViewModelObservers();

            ViewModel.Initialise();
            Task.Run(() => ViewModel.FindItemsToDelete());

            DeleteButton.Click += (sender, e) =>
                                  Task.Run(() => ViewModel.PurgeAllItems())
                                  .ContinueWith(t => ViewModel.PurgeComplete());

            AndroidApplication.Logger.Debug(() => $"PurgeActivity:OnCreate - end");
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            AndroidApplication = Application as AndroidApplication;
            AndroidApplication.Logger.Debug(() => $"HelpActivity:OnCreate");

            base.OnCreate(savedInstanceState);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            SetContentView(Resource.Layout.activity_help);

            HelpTextScroller = FindViewById <ScrollView>(Resource.Id.help_scroller);
            HelpText         = FindViewById <TextView>(Resource.Id.help_text);
            // make links clickable
            HelpText.MovementMethod = LinkMovementMethod.Instance;

            var factory = AndroidApplication.IocContainer.Resolve <ViewModelFactory>();

            ViewModel = new ViewModelProvider(this, factory).Get(Java.Lang.Class.FromType(typeof(HelpViewModel))) as HelpViewModel;
            Lifecycle.AddObserver(ViewModel);
            SetupViewModelObservers();

            ViewModel.Initialise();

            AndroidApplication.Logger.Debug(() => $"HelpActivity:OnCreate - end");
        }
            public bool MoveNext()
            {
                uint num = (uint)this.$PC;

                this.$PC = -1;
                switch (num)
                {
                case 0:
                    this.$current = PlayerView.Binder.MenuSystem.waitForMenuToBeClosed(MenuType.TechPopupMenu);
                    this.$PC      = 1;
                    goto Label_0093;

                case 1:
                    this.< ie > __0 = TimeUtil.WaitForUnscaledSeconds(0.1f);
                    break;

                case 2:
                    break;

                default:
                    goto Label_0091;
                }
                if (this.< ie > __0.MoveNext())
                {
                    this.$current = this.< ie > __0.Current;
                    this.$PC      = 2;
                    goto Label_0093;
                }
                AndroidApplication.Suspend();
                this.$PC = -1;
Label_0091:
                return(false);

Label_0093:
                return(true);
            }
示例#14
0
 public ApkWindow(AndroidApplication aa, bool exitApp) : this(aa)
 {
     isExitApp = exitApp;
 }
示例#15
0
 public ApkWindow(AndroidApplication andApp)
 {
     ApkPath           = andApp.ApkPath;
     ApplicationObject = andApp;
     InitializeComponent();
 }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            AndroidApplication = Application as AndroidApplication;
            AndroidApplication.Logger.Debug(() => "MainActivity:OnCreate");
            base.OnCreate(savedInstanceState);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            DriveInfoProvider   = AndroidApplication.IocContainer.Resolve <IDriveInfoProvider>();
            FileSystemHelper    = AndroidApplication.IocContainer.Resolve <IFileSystemHelper>();
            PreferencesProvider = AndroidApplication.IocContainer.Resolve <IPreferencesProvider>();
            ControlFileUri      = PreferencesProvider.GetPreferenceString(ApplicationContext.GetString(Resource.String.prefs_control_uri_key), "");
            AndroidApplication.Logger.Debug(() => $"MainActivity:OnCreate Conrol Uri = {ControlFileUri}");

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.activity_main);

            // Get our UI controls from the loaded layout
            List <string> envirnment = WindowsEnvironmentInformationProvider.GetEnvironmentRuntimeDisplayInformation();
            StringBuilder builder    = new StringBuilder();

            builder.AppendLine(AndroidApplication.DisplayVersion);
            foreach (string line in envirnment)
            {
                builder.AppendLine(line);
            }
            SetTextViewText(Resource.Id.txtVersions, builder.ToString());

            builder.Clear();

            builder.AppendLine($"Personal Folder = {System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal)}");
            builder.AppendLine($"AppData Folder = {System.Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData)}");
            builder.AppendLine($"CommonAppData Folder = {System.Environment.GetFolderPath(System.Environment.SpecialFolder.CommonApplicationData)}");
            Java.IO.File[] files = ApplicationContext.GetExternalFilesDirs(null);
            foreach (Java.IO.File file in files)
            {
                builder.AppendLine($"ExternalFile = {file.AbsolutePath}");
                OverrideRoot = file.AbsolutePath;
            }
            builder.AppendLine($"Podcasts Folder = {Android.OS.Environment.GetExternalStoragePublicDirectory(Android.OS.Environment.DirectoryPodcasts).AbsolutePath}");
            SetTextViewText(Resource.Id.txtAppStorage, builder.ToString());

            ProgressSpinner = FindViewById <ProgressSpinnerView>(Resource.Id.progressBar);

            Button btnLoad = FindViewById <Button>(Resource.Id.btnLoadConfig);

            btnLoad.Click += (sender, e) => LoadConfig();

            Button btnFind = FindViewById <Button>(Resource.Id.btnFindPodcasts);

            // works
            btnFind.Click += (sender, e) => Task.Run(() => FindEpisodesToDownload());
            // crash - java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
            //btnFind.Click += async (sender, e) => await Task.Run(() => FindEpisodesToDownload());
            // blocks UI thread
            //btnFind.Click += async (sender, e) => FindEpisodesToDownload();

            Button btnSetRoot = FindViewById <Button>(Resource.Id.btnSetRoot);

            btnSetRoot.Click += (sender, e) => SetRoot();

            Button btnDownload = FindViewById <Button>(Resource.Id.btnDownload);

            btnDownload.Click += (sender, e) => Task.Run(() => Download());

            bool isReadonly  = Android.OS.Environment.MediaMountedReadOnly.Equals(Android.OS.Environment.ExternalStorageState);
            bool isWriteable = Android.OS.Environment.MediaMounted.Equals(Android.OS.Environment.ExternalStorageState);

            if (!string.IsNullOrEmpty(ControlFileUri))
            {
                try
                {
                    // TODO - we need to ask permission if the file has been edited by another app
                    Android.Net.Uri uri = Android.Net.Uri.Parse(ControlFileUri);
                    AndroidApplication.ControlFile = OpenControlFile(uri);
                }
                catch (Exception ex)
                {
                    AndroidApplication.Logger.LogException(() => $"MainActivity: OnCreate", ex);
                    SetTextViewText(Resource.Id.txtConfigFilePath, $"Error {ex.Message}");
                }
            }
        }