Skip to content

Commit

Permalink
Added necisary files
Browse files Browse the repository at this point in the history
  • Loading branch information
tankcr committed Jul 28, 2014
1 parent 7793330 commit 45b5921
Show file tree
Hide file tree
Showing 98 changed files with 103,413 additions and 0 deletions.
20 changes: 20 additions & 0 deletions MediaLib.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MediaLib", "MediaLib\MediaLib.csproj", "{56FF88C5-3857-4773-93DA-EA584E786355}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x86 = Debug|x86
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{56FF88C5-3857-4773-93DA-EA584E786355}.Debug|x86.ActiveCfg = Debug|x86
{56FF88C5-3857-4773-93DA-EA584E786355}.Debug|x86.Build.0 = Debug|x86
{56FF88C5-3857-4773-93DA-EA584E786355}.Release|x86.ActiveCfg = Release|x86
{56FF88C5-3857-4773-93DA-EA584E786355}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
StartupItem = MediaLib\MediaLib.csproj
EndGlobalSection
EndGlobal
19 changes: 19 additions & 0 deletions MediaLib.userprefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Properties>
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|x86" />
<MonoDevelop.Ide.Workbench ActiveDocument="MediaLib\MainWindow.cs">
<Files>
<File FileName="MediaLib\Program.cs" Line="1" Column="1" />
<File FileName="MediaLib\GetAndroidDevices.cs" Line="130" Column="1" />
<File FileName="MediaLib\Properties\AssemblyInfo.cs" Line="27" Column="1" />
<File FileName="MediaLib\app.config" Line="1" Column="1" />
<File FileName="MediaLib\DeviceInfo.cs" Line="1" Column="1" />
<File FileName="MediaLib\MainWindow.cs" Line="24" Column="4" />
</Files>
</MonoDevelop.Ide.Workbench>
<MonoDevelop.Ide.DebuggingService.Breakpoints>
<BreakpointStore>
<Breakpoint file="C:\Users\kriroy\Documents\GitHub\MediaLib\MediaLib\GetAndroidDevices.cs" line="130" column="1" />
</BreakpointStore>
</MonoDevelop.Ide.DebuggingService.Breakpoints>
<MonoDevelop.Ide.DebuggingService.PinnedWatches />
</Properties>
Binary file added MediaLib.v12.suo
Binary file not shown.
22 changes: 22 additions & 0 deletions MediaLib/DeviceInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MediaLib
{
public class Device
{
public int size;
public int used;
public string free;
public string SerialNumber;
public string model;
public string State;
public string Brand;
public string language;
public string version;
public string country;
}
}
132 changes: 132 additions & 0 deletions MediaLib/GetAndroidDevices.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using RegawMOD.Android;
using System.Management;
using System.Text.RegularExpressions;
using System.Diagnostics;


namespace MediaLib
{
public class Devices
{

AndroidController android;
Device device;

public event EventHandler TableDataChanged;

private List<Device> tableData;
public List<Device> TableData
{
get { return tableData; }
set
{
tableData = value;
if (TableDataChanged != null)
{
TableDataChanged(this, EventArgs.Empty);
}
}
}
public Devices()
{

}
}
public class GetDevices
{
public static Devices GetDeviceData()
{
Devices table = new Devices ();
table.TableData = new List<Device> ();
DeviceState state;
AndroidController android;
RegawMOD.Android.Device device;
android = AndroidController.Instance;
if (android.HasConnectedDevices)
{
int num = android.ConnectedDevices.Count;
for (int i = 0; i < android.ConnectedDevices.Count; i++) {
string serial = android.ConnectedDevices [i];
device = android.GetConnectedDevice (serial);
string devserial = device.SerialNumber;
state = device.State;
string prodcmd = "shell cat /system/build.prop | grep \"product\"";
AdbCommand adbCmdCard = Adb.FormAdbCommand (device, "shell df /storage/*Card*");
AdbCommand adbCmdcard = Adb.FormAdbCommand (device, "shell df /storage/*card*");
AdbCommand adbCmddesc = Adb.FormAdbCommand (device, prodcmd);
string exp = @"\s+";
string expdesc = @"\r\n";
//AdbCommand cmd;
//cmd = Adb.FormAdbCommand(device, "shell df /storage/*card*", null);
string Card = Adb.ExecuteAdbCommand (adbCmdCard);
string card = Adb.ExecuteAdbCommand (adbCmdcard);
string descript = Adb.ExecuteAdbCommand (adbCmddesc);
string[] Card1 = Regex.Split (Card, exp);
string[] Card2 = Regex.Split (card, exp);
string[] myphone = Regex.Split (descript, expdesc, RegexOptions.ExplicitCapture);
Device item = new Device ();
string expmodel = @"^(.*model.*)";
string expbrand = @"^(.*brand.*)";
string explanguage = @"^(.*language.*)";
string expver = @"^(.*version.*)";
string expregion = @"^(.*region.*)";

foreach (string line in myphone) {
try {
Match mymodel = Regex.Match (line, expmodel);
if (mymodel.Success) {
item.model = line;
}
} catch {
}
;
try {
Match mybrand = Regex.Match (line, expbrand);
if (mybrand.Success) {
item.Brand = line;
}
} catch {
}
;
try {
Match mylanguage = Regex.Match (line, explanguage);
if (mylanguage.Success) {
item.language = line;
}
} catch {
}
;
try {
Match myversion = Regex.Match (line, expver);
if (myversion.Success) {
item.version = line;
}
} catch {
}
;
try {
Match myregion = Regex.Match (line, expregion);
if (myregion.Success) {
item.country = line;
}
} catch {
}
;
item.free = Card1 [8];
item.SerialNumber = serial;

}
item.Brand = myphone [2];
table.TableData.Add (item);
item.State = state.ToString();
}
}
return table;
}
}
}
27 changes: 27 additions & 0 deletions MediaLib/MainWindow.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System;
using Gtk;
using System.Runtime.InteropServices;

namespace MediaLib
{
public partial class MainWindow : Gtk.Window
{

public MainWindow()
: base(Gtk.WindowType.Toplevel)
{
Build();
}
protected void OnDeleteEvent(object sender, DeleteEventArgs a)
{
Application.Quit();
a.RetVal = true;
}

private void button6_Click(object sender, EventArgs e)
{
GetDevices.GetDeviceData ();
}

}
}
108 changes: 108 additions & 0 deletions MediaLib/MediaLib.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProjectGuid>{56FF88C5-3857-4773-93DA-EA584E786355}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>MediaLib</RootNamespace>
<AssemblyName>MediaLib</AssemblyName>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
<ConsolePause>false</ConsolePause>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<DebugType>full</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
<ConsolePause>false</ConsolePause>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="AndroidLib">
<HintPath>..\..\My Libraries\AndroidLib.dll</HintPath>
</Reference>
<Reference Include="Mono.CSharp">
<HintPath>..\packages\Mono.CSharp.3.4.0\lib\net40\Mono.CSharp.dll</HintPath>
</Reference>
<Reference Include="Mono.Posix, Version=4.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Mono.Posix.4.0.0.0\lib\net40\Mono.Posix.dll</HintPath>
</Reference>
<Reference Include="Mono.Zeroconf">
<HintPath>..\packages\Mono.Zeroconf.0.9.0.0\lib\Net20\Mono.Zeroconf.dll</HintPath>
</Reference>
<Reference Include="Mono.Zeroconf.Providers.Bonjour">
<HintPath>..\packages\Mono.Zeroconf.0.9.0.0\lib\Net20\Mono.Zeroconf.Providers.Bonjour.dll</HintPath>
</Reference>
<Reference Include="OxyPlot">
<HintPath>..\packages\OxyPlot.WindowsForms.2014.1.319.1\lib\NET45\OxyPlot.dll</HintPath>
</Reference>
<Reference Include="OxyPlot.GtkSharp">
<HintPath>..\packages\OxyPlot.GtkSharp.2014.1.319.1\lib\NET40\OxyPlot.GtkSharp.dll</HintPath>
</Reference>
<Reference Include="OxyPlot.WindowsForms">
<HintPath>..\packages\OxyPlot.WindowsForms.2014.1.319.1\lib\NET45\OxyPlot.WindowsForms.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="gtk-sharp, Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
<SpecificVersion>False</SpecificVersion>
<Private>True</Private>
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="gdk-sharp, Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="glib-sharp, Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="glade-sharp, Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="pango-sharp, Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="atk-sharp, Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
<SpecificVersion>False</SpecificVersion>
</Reference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="gtk-gui\gui.stetic">
<LogicalName>gui.stetic</LogicalName>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<Compile Include="DeviceInfo.cs" />
<Compile Include="GetAndroidDevices.cs" />
<Compile Include="gtk-gui\generated.cs" />
<Compile Include="MainWindow.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="gtk-gui\MediaLib.MainWindow.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Resource Include="libgtk-win32-2.0-0.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CustomToolNamespace>MediaLib</CustomToolNamespace>
</Resource>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>
19 changes: 19 additions & 0 deletions MediaLib/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System;
using Gtk;


namespace MediaLib
{
class MainClass
{

public static void Main (string[] args)
{

Application.Init ();
MainWindow win = new MainWindow ();
win.Show ();
Application.Run ();
}
}
}
3 changes: 3 additions & 0 deletions MediaLib/app.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1"/></startup></configuration>
Binary file added MediaLib/bin/Debug/AndroidLib.dll
Binary file not shown.
Binary file added MediaLib/bin/Debug/AndroidLib.pdb
Binary file not shown.
Loading

0 comments on commit 45b5921

Please sign in to comment.