ALL Visual Studio .dll Codes Extract - Windows Phone 7 Development and Hacking

I think everyone will be useful for
All program codes
DllImport
Microsoft.Devices.Sensors
Microsoft.Phone
Microsoft.Phone.Controls
Microsoft.Phone.Controls.Toolkit
Microsoft.Phone.Interop
Microsoft.Phone.InteropServices
Microsoft.Phone.Media.Extended
Microsoft.Phone.Reactive
mscorlib
mscorlib.Extensions
NativeCodeTest
System
System.Core
system.data.linq
System.Device
System.Net
System.Observable
System.Runtime.Serialization
System.Servicemodel
System.Servicemodel.Web
System.Windows
System.Xml
System.Xml.Linq
System.Xml.Serialization
Click to expand...
Click to collapse

camera code samples
using Microsoft.Phone.Shell;
using Microsoft.Phone.TaskModel.Interop;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Globalization;
using System.IO;
using System.IO.IsolatedStorage;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Threading;
using System.Windows;
using System.Windows.Media.Imaging;
namespace Microsoft.Phone
{
[SecuritySafeCritical]
public abstract class Camera : IDisposable
{
private object _lock = new object();
private ManagedEventCallback _pinnedCallback;
private string _isolatedStoreRoot;
private CameraSource _sourceDevice;
private int _previewWidth = 640;
private int _previewHeight = 480;
private int _sequenceNumber;
private CameraMode _mode;
private ReadOnlyCollection<CaptureResolution> _resolutions;
public event EventHandler Initialized
{
[MethodImpl(MethodImplOptions.Synchronized)]
add
{
this.Initialized = (EventHandler)Delegate.Combine(this.Initialized, value);
}
[MethodImpl(MethodImplOptions.Synchronized)]
remove
{
this.Initialized = (EventHandler)Delegate.Remove(this.Initialized, value);
}
}
public event EventHandler ShutterPressed
{
[MethodImpl(MethodImplOptions.Synchronized)]
add
{
this.ShutterPressed = (EventHandler)Delegate.Combine(this.ShutterPressed, value);
}
[MethodImpl(MethodImplOptions.Synchronized)]
remove
{
this.ShutterPressed = (EventHandler)Delegate.Remove(this.ShutterPressed, value);
}
}
public event EventHandler AutoFocusButtonPressed
{
[MethodImpl(MethodImplOptions.Synchronized)]
add
{
this.AutoFocusButtonPressed = (EventHandler)Delegate.Combine(this.AutoFocusButtonPressed, value);
}
[MethodImpl(MethodImplOptions.Synchronized)]
remove
{
this.AutoFocusButtonPressed = (EventHandler)Delegate.Remove(this.AutoFocusButtonPressed, value);
}
}
public event EventHandler AutoFocusButtonReleased
{
[MethodImpl(MethodImplOptions.Synchronized)]
add
{
this.AutoFocusButtonReleased = (EventHandler)Delegate.Combine(this.AutoFocusButtonReleased, value);
}
[MethodImpl(MethodImplOptions.Synchronized)]
remove
{
this.AutoFocusButtonReleased = (EventHandler)Delegate.Remove(this.AutoFocusButtonReleased, value);
}
}
public event EventHandler<OperationFailedEventArgs> OperationFailed
{
[MethodImpl(MethodImplOptions.Synchronized)]
add
{
this.OperationFailed = (EventHandler<OperationFailedEventArgs>)Delegate.Combine(this.OperationFailed, value);
}
[MethodImpl(MethodImplOptions.Synchronized)]
remove
{
this.OperationFailed = (EventHandler<OperationFailedEventArgs>)Delegate.Remove(this.OperationFailed, value);
}
}
internal int SequenceNumber
{
get
{
return this._sequenceNumber;
}
}
internal string IsolatedStoreRoot
{
get
{
return this._isolatedStoreRoot;
}
}
public void AddMediaToCameraRoll(string relativeMediaPath, string relativeThumbnailPath)
{
IntPtr intPtr;
NativeMethods.MediaApi_AddCapturedFile(relativeMediaPath, null, relativeThumbnailPath, out intPtr);
}
static Camera()
{
NativeMethods.CapMan_InitializeApi();
}
internal Camera(CameraSource source, CameraMode mode)
{
this._sourceDevice = source;
this._mode = mode;
if (PhoneApplicationService.Current != null)
{
PhoneApplicationService.Current.Closing += new EventHandler<ClosingEventArgs>(this.OnAppClosing);
HostInfo hostInfo = new HostInfo();
this._isolatedStoreRoot = hostInfo.AppIsolatedStorePath;
string text = Guid.NewGuid().ToString();
using (IsolatedStorageFile userStoreForApplication = IsolatedStorageFile.GetUserStoreForApplication())
{
using (IsolatedStorageFileStream isolatedStorageFileStream = new IsolatedStorageFileStream(text, FileMode.Create, userStoreForApplication))
{
using (StreamWriter streamWriter = new StreamWriter(isolatedStorageFileStream))
{
streamWriter.WriteLine("[...] and the number of the counting shall be three.");
}
}
userStoreForApplication.DeleteFile(text);
}
return;
}
throw new InvalidOperationException("PhoneApplicationService must be registered before constructing a Camera object.");
}
internal void SetVideoSessionHandle(int hVideoSession)
{
this._pinnedCallback = new ManagedEventCallback(this.RouteEventBase);
new Thread(delegate
{
NativeMethods.CapMan_Connect(hVideoSession, this._sourceDevice, this._mode, this._pinnedCallback, out this._sequenceNumber);
if (this.Initialized != null)
{
this.Initialized(this, EventArgs.Empty);
}
}).Start();
}
private void OnAppClosing(object sender, ClosingEventArgs args)
{
this.Dispose();
}
[AllowReversePInvokeCalls]
private void RouteEventBase(CaptureEvent eventId)
{
Console.WriteLine("routing p/invoke event - {0}", eventId);
try
{
switch (eventId)
{
case CaptureEvent.ShutterClick:
if (this.ShutterPressed != null)
{
this.ShutterPressed(this, EventArgs.Empty);
}
break;
case CaptureEvent.AutoFocusDown:
if (this.AutoFocusButtonPressed != null)
{
this.AutoFocusButtonPressed(this, EventArgs.Empty);
}
break;
case CaptureEvent.AutoFocusUp:
if (this.AutoFocusButtonReleased != null)
{
this.AutoFocusButtonReleased(this, EventArgs.Empty);
}
break;
default:
switch (eventId)
{
case CaptureEvent.DiskFull:
if (this.OperationFailed != null)
{
this.OperationFailed(this, new OperationFailedEventArgs(new IOException("Disk full")));
}
break;
case CaptureEvent.FatalException:
if (this.OperationFailed != null)
{
this.OperationFailed(this, new OperationFailedEventArgs(new Exception("Fatal error")));
}
break;
}
break;
}
this.RouteEvent(eventId);
}
catch (Exception ex)
{
Application.OnPlatformAssemblyUnhandledException(ex, true);
}
}
internal abstract void RouteEvent(CaptureEvent eventId);
private void DisposeImpl()
{
NativeMethods.CapMan_Disconnect(this._sequenceNumber);
}
~Camera()
{
this.DisposeImpl();
}
public virtual void Dispose()
{
this.DisposeImpl();
GC.SuppressFinalize(this);
}
public IEnumerable<CaptureResolution> GetAvailableResolutions()
{
if (this._resolutions != null)
{
return this._resolutions;
}
object @lock;
Monitor.Enter(@lock = this._lock);
try
{
if (this._resolutions != null)
{
return this._resolutions;
}
uint num = 64u;
CaptureResolutionNative[] array = new CaptureResolutionNative[num];
try
{
NativeMethods.CapMan_GetResolutions(this._sequenceNumber, ref num, array);
}
catch (COMException ex)
{
if (ex.ErrorCode != -2147024774)
{
throw;
}
array = new CaptureResolutionNative[num];
NativeMethods.CapMan_GetResolutions(this._sequenceNumber, ref num, array);
}
List<CaptureResolution> list = new List<CaptureResolution>();
int num2 = 0;
while ((long)num2 < (long)((ulong)num))
{
list.Add(new CaptureResolution
{
Width = array[num2].Width,
Height = array[num2].Height
});
num2++;
}
this._resolutions = list.AsReadOnly();
}
finally
{
Monitor.Exit(@lock);
}
return this._resolutions;
}
public void SetResolution(CaptureResolution resolution)
{
CaptureResolutionNative size = new CaptureResolutionNative
{
Width = resolution.Width,
Height = resolution.Height
};
NativeMethods.CapMan_SetResolution(this._sequenceNumber, size);
if (9 * size.Width == 16 * size.Height)
{
this._previewHeight = 360;
return;
}
this._previewHeight = 480;
}
public void ZoomIn()
{
NativeMethods.CapMan_ZoomIn(this._sequenceNumber);
}
public void ZoomOut()
{
NativeMethods.CapMan_ZoomOut(this._sequenceNumber);
}
public void GetCurrentFrame(WriteableBitmap bmp)
{
if (bmp.PixelWidth != this._previewWidth || bmp.PixelHeight != this._previewHeight)
{
throw new ArgumentException(string.Format(CultureInfo.InvariantCulture, "WriteableBitmap must match the dimensions of the preview frame, currently {0}x{1}", new object[]
{
this._previewWidth,
this._previewHeight
}));
}
int[] pixels = bmp.Pixels;
uint cbBuffer = (uint)(pixels.Length * 4);
NativeMethods.CapMan_GetCurrentFrame(this._sequenceNumber, cbBuffer, pixels);
}
public void SetCustomProperty(Guid propertyId, long value)
{
if (value > (long)((ulong)-1) || value < 0L)
{
throw new ArgumentException(string.Format(CultureInfo.InvariantCulture, "Invalid value ({0}) for custom property '{1}'", new object[]
{
value,
propertyId
}));
}
uint dwValue = (uint)value;
NativeMethods.CapMan_SetCustomProperty(this._sequenceNumber, propertyId, dwValue);
}
public long GetCustomProperty(Guid propertyId)
{
uint num;
NativeMethods.CapMan_GetCustomProperty(this._sequenceNumber, propertyId, out num);
return (long)((ulong)num);
}
}
}
Click to expand...
Click to collapse

well yeah, the leak's great, but i found all the codes were an empty brackets

Great stuff! Thanks!

aramadsanar said:
well yeah, the leak's great, but i found all the codes were an empty brackets
Click to expand...
Click to collapse
Not all.. SOME are but not that many.

aramadsanar said:
the leak's great
Click to expand...
Click to collapse
Is it a leak, or I just didn't understand you?

Useless guy said:
Is it a leak, or I just didn't understand you?
Click to expand...
Click to collapse
Of course it's not a leak; just a reflection of public declarations.

sensboston said:
Of course it's not a leak; just a reflection of public declarations.
Click to expand...
Click to collapse
Exactly .

sensboston said:
Of course it's not a leak; just a reflection of public declarations.
Click to expand...
Click to collapse
It means that aramadsanar talked a nonsense, as I thought.
P.S. Okay, what is a purpose for this? I don't find it useful, 'cuz the same assemblies are in an any ROM, not dummys.

Useless guy said:
It means that aramadsanar talked a nonsense, as I thought.
P.S. Okay, what is a purpose for this? I don't find it useful, 'cuz the same assemblies are in an any ROM, not dummys.
Click to expand...
Click to collapse
ouch, i tought it was a full code

Related

Scrolling list

Hi guys,
Anyone have experience with lists? I've made one that seems to work fine (enough for now), but my problem is that it isn't scrolling in the emulator. I can see one item partially, and I can scroll up just enough to see this, but I cannot see any more items. I know there are like 41 items in the list, so I cannot figure why it's not showing.
Here's my xaml
Code:
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<StackPanel Name="SearchPanel">
<Image Height="150" HorizontalAlignment="Left" Margin="0,6,0,0" Name="image1" Stretch="Fill" VerticalAlignment="Top" Width="450" Source="/Prissøk;component/Images/partner_teknofil.png" />
<TextBox Height="72" HorizontalAlignment="Left" Name="textBox1" VerticalAlignment="Top" Width="493" />
<Button Content="Button" Height="72" HorizontalAlignment="Center" Name="button1" VerticalAlignment="Top" Width="381" Click="button1_Click" ManipulationStarted="button1_ManipulationStarted" />
</StackPanel>
<ScrollViewer Name="SearchResultPanel" Visibility="Collapsed">
<!--<StackPanel>-->
<ListBox Name="ProductList">
<ListBox.ItemTemplate>
<DataTemplate>
<Button Width="460" Height="120">
<StackPanel Orientation="Horizontal" Height="80" Width="400">
<Image Source="{Binding img}" Width="80" Height="80"/>
<StackPanel Orientation="Horizontal" Height="40">
<TextBlock Width="100" FontSize="22" Text="Navn: " Height="40"/>
<TextBlock Width="200" FontSize="22" Text="{Binding title}" Height="40"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Height="40">
<TextBlock Width="100" FontSize="22" Text="Pris: " Height="40"/>
<TextBlock Width="200" FontSize="22" Text="{Binding price}" Height="40"/>
</StackPanel>
</StackPanel>
</Button>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<!--</StackPanel>-->
</ScrollViewer>
</Grid>
</Grid>
I've tried putting the listbox directly in a stackpanel, I've tried putting this inside a scrollviewer etc etc.
Anyone got any good tips for me?
Cheers!
It looks like you're trying to get your ListBox to be clickable by adding a Button which contains everything. Your ListBox as a whole should use an event, like SelectionChanged, unless you want a ListBox to have multiple things in the same list item you can click on. (say a list of a album, and a play button, where the album opens a detail page and the play button plays the album)
Here's a ListBox i'm using:
Code:
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<ListBox Margin="0,10,0,6" ItemsSource="{Binding Items}" Name="serverListBox" SelectionChanged="serverListBox_SelectionChanged" d:LayoutOverrides="VerticalAlignment">
<ListBox.ItemTemplate>
<DataTemplate>
<toolkit:WrapPanel Margin="0,0,0,17" Width="400">
<TextBlock Text="{Binding servername}" TextWrapping="Wrap" Style="{StaticResource PhoneTextExtraLargeStyleWithoutForeground}"/>
<toolkit:WrapPanel x:Name="Layout" Width="380" Orientation="Horizontal">
<TextBlock Text="{Binding ip}" Style="{StaticResource PhoneTextSubtleStyleWithoutForeground}"/>
<TextBlock Text="{Binding isDefault}" Style="{StaticResource PhoneTextSubtleStyleWithoutForeground}"/>
</toolkit:WrapPanel>
</toolkit:WrapPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
This is the corresponding list it generates:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
in code, you would define the SelectionChanged event handler, and have something like this.
Code:
private void serverListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (serverListBox.SelectedIndex == -1)
return;
MyItem item = (MyItem)serverListBox.SelectedItem;
}
Thanks, still doesn't scroll, though :S
One other thing - what's that toolkit your code refers to?
tiwas said:
Thanks, still doesn't scroll, though :S
One other thing - what's that toolkit your code refers to?
Click to expand...
Click to collapse
http://silverlight.codeplex.com/releases/view/52297
The silverlight toolkit has a ton of features, and a pretty great solution you can download which shows you what everything is.
If you aren't able to scroll, are you seeing more than 1 item on the screen? You may not be having the ListBox update properly.
Are you using a List as your ItemsSource? You should be using an ObservableCollection instead. (using System.Collections.ObjectModel
What is the type your storing? You may need to make it implement INotifyPropertyChanged.
https://soumya.wordpress.com/2010/0...tifypropertychanged-and-observablecollection/
Thanks for helping me out.
I have an array of Product, which contain all the details I need. The list is just an example I found on the net that I changed the bindings for, so I guess that part should work.
When I populate the list, it shows me 8 items, which is 7 fully displayed and the last one is partially displayed. It will let me scroll just enough to see the last one of the 8, but not the 30+ more in my Array. Could this be a binding problem?
This is what I have in the callback function to my WebClient downloader
Code:
if (e.Error == null)
{
Stream responseStream = e.Result;
DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(Products));
Products prods = (Products)ser.ReadObject(responseStream);
if (prods.Count() > 0)
{
SearchPanel.Visibility = System.Windows.Visibility.Collapsed;
SearchResultPanel.Visibility = System.Windows.Visibility.Visible;
ProductList.ItemsSource = prods;
}
}
tiwas said:
Thanks for helping me out.
I have an array of Product, which contain all the details I need. The list is just an example I found on the net that I changed the bindings for, so I guess that part should work.
When I populate the list, it shows me 8 items, which is 7 fully displayed and the last one is partially displayed. It will let me scroll just enough to see the last one of the 8, but not the 30+ more in my Array. Could this be a binding problem?
This is what I have in the callback function to my WebClient downloader
Code:
if (e.Error == null)
{
Stream responseStream = e.Result;
DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(Products));
Products prods = (Products)ser.ReadObject(responseStream);
if (prods.Count() > 0)
{
SearchPanel.Visibility = System.Windows.Visibility.Collapsed;
SearchResultPanel.Visibility = System.Windows.Visibility.Visible;
ProductList.ItemsSource = prods;
}
}
Click to expand...
Click to collapse
If you put a Breakpoint after ProductList.ItemsSource = prods, is the Count 8 or the number you're expecting?
The Products Object is a container for a array of Product? If it's that easy, I'd try just changing it into an ObservableCollection and seeing if that fixes your problem.
You might want to post this on create.msdn.com and see if you get any responses there too.
Thanks
Guess I'll have to - the reason I posted here is that most of the time people around here are more interested in helping people And...I don't have a developer account, so I wasn't sure if people would help me over there, but I'll give it a shot
Did the breakpoint to be sure
prods.Count(): 75
ProductList.Items.Count: 74
Visible items: 8 :S
Guess I will have to take a look at what the ObservableCollection is all about...never heard of it
Your problem seems to be that you have a listbox inside a scrollviewer...
Listboxes allready have scroll viewers inside them, so you dont need it.
And use x:Name rather than Name for naming xaml elements.

Launch Internet Connection or any other Application from Desktop

Well I have been trying to interop unlock my Dell Venue Pro by using the Microsoft.SmartDevice.connectivity Library. Now while I have had no luck with that I did find a way to execute internet sharing on any device. Only downside is on devices that it is not supposed to work it will display a "Connection not shared" "Internet sharing isn't currently available." MessageBox.
I am going to be generating more GUID's tonight but It would be nice to know if anyone knows of the GUID for cool things. Here is my code:
Code:
using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Reflection;
using Microsoft.SmartDevice.Connectivity;
namespace RemoteExecute
{
class Program
{
public static DatastoreManager manager = new DatastoreManager(CultureInfo.CurrentCulture.LCID);
public static DatastoreManager datastoremanager = new DatastoreManager(1033);
public static Collection<Platform> platforms = datastoremanager.GetPlatforms();
public static ObjectId PlatformObjectID = new ObjectId("7E6B29E6-AAE1-41dc-9849-049507CBA2B0");
static void Main(string[] args)
{
LaunchApplication(GetGUID(Applications.InternetSharing));
Console.WriteLine();
}
private enum Applications
{
[Description("5B04B775-356B-4AA0-AAF8-6491FFEA561A")]Documents,
[Description("5B04B775-356B-4AA0-AAF8-6491FFEA561B")]UnknownB,
[Description("5B04B775-356B-4AA0-AAF8-6491FFEA561C")]PhoneSettings,
[Description("5B04B775-356B-4AA0-AAF8-6491FFEA561D")]OfficeConnection,
[Description("5B04B775-356B-4AA0-AAF8-6491FFEA561E")]Office,
[Description("5B04B775-356B-4AA0-AAF8-6491FFEA561F")]Cellular,
[Description("5B04B775-356B-4AA0-AAF8-6491FFEA5600")]FileBrowser,
[Description("5B04B775-356B-4AA0-AAF8-6491FFEA5601")]Settings,
[Description("5B04B775-356B-4AA0-AAF8-6491FFEA5602")]Start,
[Description("5B04B775-356B-4AA0-AAF8-6491FFEA5603")]Calculator,
[Description("5B04B775-356B-4AA0-AAF8-6491FFEA5605")]About,
[Description("5B04B775-356B-4AA0-AAF8-6491FFEA5606")]DateTime,
[Description("5B04B775-356B-4AA0-AAF8-6491FFEA5607")]LockWallpaper,
[Description("5B04B775-356B-4AA0-AAF8-6491FFEA5608")]Keyboard,
[Description("5B04B775-356B-4AA0-AAF8-6491FFEA5610")]Messaging,
[Description("5B04B775-356B-4AA0-AAF8-6491FFEA5611")]Calling,
[Description("5B04B775-356B-4AA0-AAF8-6491FFEA5612")]Calendar,
[Description("5B04B775-356B-4AA0-AAF8-6491FFEA5613")]AddAccount,
[Description("5B04B775-356B-4AA0-AAF8-6491FFEA5614")]AddAccount2,
[Description("5B04B775-356B-4AA0-AAF8-6491FFEA5615")]People,
[Description("5B04B775-356B-4AA0-AAF8-6491FFEA5616")]EmailAccounts,
[Description("5B04B775-356B-4AA0-AAF8-6491FFEA5617")]Word,
[Description("5B04B775-356B-4AA0-AAF8-6491FFEA5618")]Excel,
[Description("5B04B775-356B-4AA0-AAF8-6491FFEA5619")]Unknown19,
[Description("5B04B775-356B-4AA0-AAF8-6491FFEA5620")]Bluetooth,
[Description("5B04B775-356B-4AA0-AAF8-6491FFEA5621")]AirplaneMode,
[Description("5B04B775-356B-4AA0-AAF8-6491FFEA5622")]OfficeSettings,
[Description("5B04B775-356B-4AA0-AAF8-6491FFEA5623")]WiFi,
[Description("5B04B775-356B-4AA0-AAF8-6491FFEA5624")]Speech,
[Description("5B04B775-356B-4AA0-AAF8-6491FFEA5625")]FindMyPhone,
[Description("5B04B775-356B-4AA0-AAF8-6491FFEA5628")]Zip,
[Description("5B04B775-356B-4AA0-AAF8-6491FFEA5629")]InternetSharing,
[Description("5B04B775-356B-4AA0-AAF8-6491FFEA5630")]Zune,
[Description("5B04B775-356B-4AA0-AAF8-6491FFEA5631")]Camera,
[Description("5B04B775-356B-4AA0-AAF8-6491FFEA5632")]Pictures,
[Description("5B04B775-356B-4AA0-AAF8-6491FFEA5633")]Marketplace,
[Description("5B04B775-356B-4AA0-AAF8-6491FFEA5634")]Games,
[Description("5b04b775-356b-4aa0-aaf8-6491ffea5640")]PhoneUpdate,
[Description("5b04b775-356b-4aa0-aaf8-6491ffea5642")]Location,
[Description("5b04b775-356b-4aa0-aaf8-6491ffea5660")]InternetExplorer,
[Description("5b04b775-356b-4aa0-aaf8-6491ffea5661")]Maps,
[Description("5b04b775-356b-4aa0-aaf8-6491ffea5663")]InternetExplorerSettings,
[Description("5b04b775-356b-4aa0-aaf8-6491ffea5664")]SearchSettings,
[Description("5b04b775-356b-4aa0-aaf8-6491ffea5666")]InternetExplorer2,
[Description("5b04b775-356b-4aa0-aaf8-6491ffea5670")]Feedback,
}
private static string GetGUID(object item)
{
FieldInfo fi = item.GetType().GetField(item.ToString());
if (fi == null) return null;
DescriptionAttribute[] attributes = (DescriptionAttribute[])fi.GetCustomAttributes(typeof(DescriptionAttribute), false);
return (attributes.Length > 0) ? attributes[0].Description : item.ToString();
}
private static void LaunchApplication(string GUID)
{
try
{
Platform platform = datastoremanager.GetPlatform(PlatformObjectID);
Collection<Device> devices = platform.GetDevices();
Device device = devices.FirstOrDefault(x => x.Name.Contains("Device"));
device.Connect();
RemoteApplication ApplicationToLaunch = device.GetApplication(new Guid(GUID));
ApplicationToLaunch.Launch();
WriteConsoleDebug(string.Format("{0}\tLaunched {1}", DateTime.Now, GUID));
}
catch (Exception ex)
{
WriteConsoleDebug(string.Format("{0}\tFailed to launch {1}", DateTime.Now, GUID));
}
}
private static void WriteConsoleDebug(string message)
{
Console.WriteLine(message);
Debug.WriteLine(message);
}
}
}
Is this internet sharing via USB tether?
No this is the wifi sharing option. And should launch for all Mango devices; however the button will ONLY WORK if your device SUPPORTS it. Sadly...
confirmed it works. but unfortunately ICS isn't enabled on my Mozart yet :/ good job though.
Do you think you can find the Battery Saver? That would be great.
Brute forcing these GUID will take a lifetime so I need a starting point.
I knew the ID for one of the screens so it was easy to find the range of 5B04B775-356B-4AA0-AAF8-6491FFEA5600 to 5b04b775-356b-4aa0-aaf8-6491ffea5670. I need some sort of reference
MJCS said:
Brute forcing these GUID will take a lifetime so I need a starting point.
I knew the ID for one of the screens so it was easy to find the range of 5B04B775-356B-4AA0-AAF8-6491FFEA5600 to 5b04b775-356b-4aa0-aaf8-6491ffea5670. I need some sort of reference
Click to expand...
Click to collapse
Oh ok :/ Thanks anyway
Well if someone wants to they can run multiple instances of this to generate and check to see if a GUID is valid. I would run this against the emulator.
Code:
public static void GUIDGenerator()
{
for (int a = 0; a < int.MaxValue; a++)
{
for (short b = 0; b < short.MaxValue; b++)
{
for (short c = 0; c < short.MaxValue; c++)
{
for (byte d = 0; d < byte.MaxValue; d++)
{
for (byte e = 0; e < byte.MaxValue; e++)
{
for (byte f = 0; f < byte.MaxValue; f++)
{
for (byte g = 0; g < byte.MaxValue; g++)
{
for (byte h = 0; h < byte.MaxValue; h++)
{
for (byte i = 0; i < byte.MaxValue; i++)
{
for (byte j = 0; j < byte.MaxValue; j++)
{
for (byte k = 0; k < byte.MaxValue; k++)
{
Guid guid = new Guid(a, b, c, d, e, f, g, h, i, j, k);
LaunchApplication(guid.ToString().ToUpper());
}
}
}
}
}
}
}
}
}
}
}
}
I know it is not really clean. Or you can try the random brute force:
Code:
while (true)
{
LaunchApplication(Guid.NewGuid().ToString().ToUpper());
count++;
}
Fun with math and stupidly large numbers: (2^8)^16 combinations (or 2^128, simply).
Let's assume you've got a blazing fast CPU - 4GHz (2^32) per core. You're only using one core with this code, of course.
Next let's assume there is no overhead, and you can run one instruction per clock cycle. In practice this is not even close to true, though.
Now let's assume that checking the GUID somehow only requires three instructions to construct and check. This is an outrageous lie, probably off by multiple orders of magnitude.
Each GUID now takes 4 instructions in total (counting the increment). You can check 2^30 of them each second.
It will take 2^98 seconds to check all possible options. It will take 10^22 years (10,042,630,836,632,069,628,000 years, rounded to the nearest millennium) to check them all. Better get cracking! ;-)
GoodDayToDie said:
Fun with math and stupidly large numbers: (2^8)^16 combinations (or 2^128, simply).
Let's assume you've got a blazing fast CPU - 4GHz (2^32) per core. You're only using one core with this code, of course.
Next let's assume there is no overhead, and you can run one instruction per clock cycle. In practice this is not even close to true, though.
Now let's assume that checking the GUID somehow only requires three instructions to construct and check. This is an outrageous lie, probably off by multiple orders of magnitude.
Each GUID now takes 4 instructions in total (counting the increment). You can check 2^30 of them each second.
It will take 2^98 seconds to check all possible options. It will take 10^22 years (10,042,630,836,632,069,628,000 years, rounded to the nearest millennium) to check them all. Better get cracking! ;-)
Click to expand...
Click to collapse
Yeah you are better off running a random brute force. I was just using that code to generate the entire sets of byte ranges for known guids. That is how I generated the GUIDS you see on here
singularity0821 said:
Do you think you can find the Battery Saver? That would be great.
Click to expand...
Click to collapse
Microsoft.Themes"="{165705CD-200B-4b23-961D-E3F66F844514}"
"Microsoft.Sounds"="{92F34415-4D78-4430-9933-D2DEEA0C9D3D}"
"Microsoft.FlightMode"="{1DEF9B7D-2322-40eb-A007-16A75D5CDA62}"
"Microsoft.Accessibility"="{C5A90F1C-112F-43d3-8C80-C5D1746F3B68}"
"Microsoft.WiFi"="{291A7CF3-48C4-4319-A6F6-E4BABFCCB8E8}"
"Microsoft.Bluetooth"="{BFBBBF37-35E3-447b-BE65-DFC149EF614F}"
"Microsoft.Location"="{41954AAF-E1C4-4b81-A5EC-A5C8961FE34C}"
"Microsoft.CellularConn"="{FD427838-F373-40a3-9FEC-76C6CFFAFC04}"
"Microsoft.Accounts"="{87F5E764-4AB3-4664-B2A3-BE00A2E8AF4A}"
"Microsoft.Brightness"="{B7AFEE4D-7738-48df-8CA4-588D14AE256B}"
"Microsoft.TouchKeyboard"="{071692BE-EC17-463e-94C7-64FB874A6180}"
"Microsoft.Regional"="{E37398A2-CEAD-423c-9EC2-F43251C0B2CE}"
"Microsoft.DateTime"="{9CB05CAE-D2CF-4409-8E64-352DD8F6FDE2}"
"Microsoft.PhoneLock"="{37966764-79C8-4090-A8CF-FB65D638E529}"
"Microsoft.Updates"="{C956380A-087F-4548-A5F6-CEF3616A55DA}"
"Microsoft.About"="{9DAD8821-3F8C-474f-AB2B-D120BA03AFDC}"
"Microsoft.Speech"="{7D878951-E418-46a3-AF6B-DCB45CD375B9}"
"Microsoft.Contacts"="{2D267C1E-C53A-4718-8032-FAC545DDDF8C}"
"Microsoft.Photos"="{864AAEB9-9419-40f9-BA88-03E986859450}"
"Microsoft.Messaging"="{D651D70D-B141-4d71-8FFB-1004C24FB12B}"
"Microsoft.Phone"="{83171528-D3B9-49b6-BC05-BBB3B4B25460}"
"Microsoft.IE"="{A7DD1D7D-C7CA-4566-A5E7-015C7940276E}"
"Microsoft.Maps"="{21EF1D0A-5EBE-4056-9622-2D9615C967E1}"
"Microsoft.Search"="{90A593C1-F945-4bf7-AB56-A999E425F16F}"
"Microsoft.OfficeMobile"="{5962CFCF-8008-4d55-B048-BDCDD7A90EAB}"
"Microsoft.Games"="{B193A538-115B-4789-93D1-F3981B9D7B11}"
"Microsoft.Radio"="{18916419-df98-4042-bb27-6ae39dbc3310}"
"Microsoft.FindMyPhone"="{1691B767-686D-4934-A844-C0057C6024A0}"
"Microsoft.Feedback"="{BF0D001A-1988-4cf3-81E1-16A1CCAB5DA3}"
"Microsoft.Marketplace"="{1D36BBB8-9EEE-4e30-A72B-77ED9CFF11D1}"
"Microsoft.BatterySaver"="{F49426E4-5DC9-460e-8A85-B578B5D11387}"
"Microsoft.BGServices"="{483611F8-92D9-42d3-B5FA-B7252696F66A}"
abhilaksh said:
Microsoft.Themes"="{165705CD-200B-4b23-961D-E3F66F844514}"
"Microsoft.Sounds"="{92F34415-4D78-4430-9933-D2DEEA0C9D3D}"
"Microsoft.FlightMode"="{1DEF9B7D-2322-40eb-A007-16A75D5CDA62}"
"Microsoft.Accessibility"="{C5A90F1C-112F-43d3-8C80-C5D1746F3B68}"
"Microsoft.WiFi"="{291A7CF3-48C4-4319-A6F6-E4BABFCCB8E8}"
"Microsoft.Bluetooth"="{BFBBBF37-35E3-447b-BE65-DFC149EF614F}"
"Microsoft.Location"="{41954AAF-E1C4-4b81-A5EC-A5C8961FE34C}"
"Microsoft.CellularConn"="{FD427838-F373-40a3-9FEC-76C6CFFAFC04}"
"Microsoft.Accounts"="{87F5E764-4AB3-4664-B2A3-BE00A2E8AF4A}"
"Microsoft.Brightness"="{B7AFEE4D-7738-48df-8CA4-588D14AE256B}"
"Microsoft.TouchKeyboard"="{071692BE-EC17-463e-94C7-64FB874A6180}"
"Microsoft.Regional"="{E37398A2-CEAD-423c-9EC2-F43251C0B2CE}"
"Microsoft.DateTime"="{9CB05CAE-D2CF-4409-8E64-352DD8F6FDE2}"
"Microsoft.PhoneLock"="{37966764-79C8-4090-A8CF-FB65D638E529}"
"Microsoft.Updates"="{C956380A-087F-4548-A5F6-CEF3616A55DA}"
"Microsoft.About"="{9DAD8821-3F8C-474f-AB2B-D120BA03AFDC}"
"Microsoft.Speech"="{7D878951-E418-46a3-AF6B-DCB45CD375B9}"
"Microsoft.Contacts"="{2D267C1E-C53A-4718-8032-FAC545DDDF8C}"
"Microsoft.Photos"="{864AAEB9-9419-40f9-BA88-03E986859450}"
"Microsoft.Messaging"="{D651D70D-B141-4d71-8FFB-1004C24FB12B}"
"Microsoft.Phone"="{83171528-D3B9-49b6-BC05-BBB3B4B25460}"
"Microsoft.IE"="{A7DD1D7D-C7CA-4566-A5E7-015C7940276E}"
"Microsoft.Maps"="{21EF1D0A-5EBE-4056-9622-2D9615C967E1}"
"Microsoft.Search"="{90A593C1-F945-4bf7-AB56-A999E425F16F}"
"Microsoft.OfficeMobile"="{5962CFCF-8008-4d55-B048-BDCDD7A90EAB}"
"Microsoft.Games"="{B193A538-115B-4789-93D1-F3981B9D7B11}"
"Microsoft.Radio"="{18916419-df98-4042-bb27-6ae39dbc3310}"
"Microsoft.FindMyPhone"="{1691B767-686D-4934-A844-C0057C6024A0}"
"Microsoft.Feedback"="{BF0D001A-1988-4cf3-81E1-16A1CCAB5DA3}"
"Microsoft.Marketplace"="{1D36BBB8-9EEE-4e30-A72B-77ED9CFF11D1}"
"Microsoft.BatterySaver"="{F49426E4-5DC9-460e-8A85-B578B5D11387}"
"Microsoft.BGServices"="{483611F8-92D9-42d3-B5FA-B7252696F66A}"
Click to expand...
Click to collapse
Wow, thank you~
MJCS, good idea! But you forgot to attach project and executable. I'll do it for you (just slightly modified your source code)
Usage: RemoteExecute.exe [app name] or [app guid]
sensboston said:
MJCS, good idea! But you forgot to attach project and executable. I'll do it for you (just slightly modified your source code)
Usage: RemoteExecute.exe [app name] or [app guid]
Click to expand...
Click to collapse
I figured everyone in the hacking forum would have Visual Studio installed
MJCS said:
I figured everyone in the hacking forum would have Visual Studio installed
Click to expand...
Click to collapse
Mostly But having a ready-to-go exe with command line params not bad at all, what do you think?
MJCS said:
Well if someone wants to they can run multiple instances of this to generate and check to see if a GUID is valid. I would run this against the emulator.
Code:
public static void GUIDGenerator()
{
for (int a = 0; a < int.MaxValue; a++)
{
for (short b = 0; b < short.MaxValue; b++)
{
for (short c = 0; c < short.MaxValue; c++)
{
for (byte d = 0; d < byte.MaxValue; d++)
{
for (byte e = 0; e < byte.MaxValue; e++)
{
for (byte f = 0; f < byte.MaxValue; f++)
{
for (byte g = 0; g < byte.MaxValue; g++)
{
for (byte h = 0; h < byte.MaxValue; h++)
{
for (byte i = 0; i < byte.MaxValue; i++)
{
for (byte j = 0; j < byte.MaxValue; j++)
{
for (byte k = 0; k < byte.MaxValue; k++)
{
Guid guid = new Guid(a, b, c, d, e, f, g, h, i, j, k);
LaunchApplication(guid.ToString().ToUpper());
}
}
}
}
}
}
}
}
}
}
}
}
I know it is not really clean. Or you can try the random brute force:
Code:
while (true)
{
LaunchApplication(Guid.NewGuid().ToString().ToUpper());
count++;
}
Click to expand...
Click to collapse
GoodDayToDie said:
Fun with math and stupidly large numbers: (2^8)^16 combinations (or 2^128, simply).
Let's assume you've got a blazing fast CPU - 4GHz (2^32) per core. You're only using one core with this code, of course.
Next let's assume there is no overhead, and you can run one instruction per clock cycle. In practice this is not even close to true, though.
Now let's assume that checking the GUID somehow only requires three instructions to construct and check. This is an outrageous lie, probably off by multiple orders of magnitude.
Each GUID now takes 4 instructions in total (counting the increment). You can check 2^30 of them each second.
It will take 2^98 seconds to check all possible options. It will take 10^22 years (10,042,630,836,632,069,628,000 years, rounded to the nearest millennium) to check them all. Better get cracking! ;-)
Click to expand...
Click to collapse
This is true. But all of Microsoft's WP7 GUIDs start with "5B04B775-356B-4AA0-AAF8-6491FFEA5", so this actually only leads 4 HEX digits to work with.. so 15^4? A little better
@Jaxbot:
Could you code a simple shortcut-xap for calling the Internet Sharing settings page using the here provided GUID ?
The GUID works well with your folders app...
Best regards
contable
contable said:
@Jaxbot:
Could you code a simple shortcut-xap for calling the Internet Sharing settings page using the here provided GUID ?
The GUID works well with your folders app...
Best regards
contable
Click to expand...
Click to collapse
I think you can with the folders app
MJCS said:
I think you can with the folders app
Click to expand...
Click to collapse
As written before the GUID works well with the folder app, but I meant a standalone shortcut, not a shortcut inside a folder...
BTW thx a lot for the GUID´s !
contable said:
As written before the GUID works well with the folder app, but I meant a standalone shortcut, not a shortcut inside a folder...
BTW thx a lot for the GUID´s !
Click to expand...
Click to collapse
Ok nothing fancy here, but I'll just put up this Visual Studio test project that's modified to launch the internet sharing page. It can be used for other things, too, but this one's for you contable
(You'll need to build it and make a pretty icon for it, but that's all easy relevant code is in App.xaml.cs)

Passing Parameters in Windows Phone 7

Hey All,
Quite a simple question but I can't seem to find a decent answer for it. Let's say I have a button on one xaml page and want to pass some parameters through to the next page. So I build a button that goes to another view with a parameter, say the Uri is "/Views/TwitterPage.xaml?id=1"
Now my question is, how do I pull that id variable from the parameters on the next page and put it into a text box?
Monotoko
You have try this
protected override void OnNavigatedTo(NavigationEventArgs e)
{
if (base.NavigationContext.QueryString.ContainsKey("id"))
{
var id = base.NavigationContext.QueryString["id"];
// Use the id
}
}
titi66200 said:
You have try this
protected override void OnNavigatedTo(NavigationEventArgs e)
{
if (base.NavigationContext.QueryString.ContainsKey("id"))
{
var id = base.NavigationContext.QueryString["id"];
// Use the id
}
}
Click to expand...
Click to collapse
Thanks, but how do I then put it into a box in the xaml file? I've tried using binding but it isn't working.
For textbox must be String not Var
string id = base.NavigationContext.QueryString["id"];
Textbox1.Text = id;

*$20.00 Bounty* I need help with *Awesome Note*

Here's the deal. I'm killing my self with Awesome Note. I can't get the text color on the right side to match the rest of the app. I will pay 20 bucks to the first person who gets everything on the right side to match the left side.
This is what I do. I change every single line that has textcolor="# or @ or @* or ? To textcolor="@color/caltextcol555. This way I can change one line in the color xml to any value and it changes every text color.
This has been done already, I've changed the theme to every possibility I know in the manifest and style xml. Still no change to the right side. This tells me it's getting the color from framework or smali. I never did smali.
This is where I'm at. The value I have set for all text is ff33be5, id# for caltextcol555 is 0x7f070009.
What I want is, somehow have all the text point to color/caltextcol555. I want to be able to change all text color with 1 edit, at most 2.
Here is the apk, it's a click to install, you must unistall your current one. If anyone just wants to use it as is. There is so much going on in this app, feel free to test and leave comments. It is usable, just a little hard to see the bronze color text
Awesome Note
http://db.tt/bJE6ld7V
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
I want pages like this changed to blue text
I'll deal with the images after the text gets fixed
Oh haha, didn't know some1 like you need help!
leprophotography said:
Oh haha, didn't know some1 like you need help!
Click to expand...
Click to collapse
I know when I've been beat. I hate calendar apps, I think it just pulls colors from who knows where.
Show Some Love
This is awesome Fox, i would even help with donation if the rest of the colors get done, but i will be using this now until the final version is released......
your the goto app guy.....lol
dafoxs said:
I know when I've been beat. I hate calendar apps, I think it just pulls colors from who knows where.
Show Some Love
Click to expand...
Click to collapse
Some apps will be working off of the framework. Therefore you would have to rewrite the program to get it to work..
Plus I am finding out alot. That android colors is being used for the text color. Its a pain in the ass. Thats what it is. Hope this helped you
Sent from my SCH-I605 using Xparent BlueTapatalk 2
ezgoing2406 said:
Some apps will be working off of the framework. Therefore you would have to rewrite the program to get it to work..
Plus I am finding out alot. That android colors is being used for the text color. Its a pain in the ass. Thats what it is. Hope this helped you
Sent from my SCH-I605 using Xparent BlueTapatalk 2
Click to expand...
Click to collapse
Yep, android colors can be changed. Any color that has the ="@*, just change it to what ever you want either a # number or an @color/ value, it's deeper then just that. I've changed the theme and everything, no luck
Show Some Love
dafoxs said:
Yep, android colors can be changed. Any color that has the ="@*, just change it to what ever you want either a # number or an @color/ value, it's deeper then just that. I've changed the theme and everything, no luck
Show Some Love
Click to expand...
Click to collapse
Send me the apk. And the color code you went. Unthemed.. I will see what I can do..
Sent from my SCH-I605 using Xparent BlueTapatalk 2
Decompile....open up the smali folder/subfolders..and use notepad++ to search for all color codes in the file, you could "select all" in said folder and do a search "all" using notepad++...they start with "-0x" in the smali files and are 6 characters following that code...
from there, it will help you narrow down the culprit.
EDIT:
Screenshots of the first culprits I ran across...both light and darker shades of grey...change them, recompile, and try it...
Edit2: check all the folders and subfolders in "AwesomeNote_base8\smali\com\brid\awesomenote\ui\notelist" I am betting your answer is in there.
Naddict said:
Decompile....open up the smali folder/subfolders..and use notepad++ to search for all color codes in the file, you could "select all" in said folder and do a search "all" using notepad++...they start with "-0x" in the smali files and are 6 characters following that code...
from there, it will help you narrow down the culprit.
EDIT:
Screenshots of the first culprits I ran across...both light and darker shades of grey...change them, recompile, and try it...
Edit2: check all the folders and subfolders in "AwesomeNote_base8\smali\com\brid\awesomenote\ui\notelist" I am betting your answer is in there.
Click to expand...
Click to collapse
Wow, thanks. Is there anything special you have to do to compile smali?
Show Some Love
What are you using to compile?
Sent from my SAMSUNG-SGH-I317 using Tapatalk 2
dafoxs said:
Wow, thanks. Is there anything special you have to do to compile smali?
Show Some Love
Click to expand...
Click to collapse
When you decompile apk smali is open for edit.
Compile apk smail will be as well
---------- Post added at 07:57 PM ---------- Previous post was at 07:48 PM ----------
Cracked it open finding R$color.smali needs your attention.
Folllow path - smali / touchwiz / R$color.smali
bigfau said:
What are you using to compile?
Sent from my SAMSUNG-SGH-I317 using Tapatalk 2
Click to expand...
Click to collapse
Apk multi tool
Show Some Love
You can cross reference tw_color make I = value change
tw_color001 = #ffebebeb
tw_color002 = #ff000000
tw_color003 = #ff6e9cba
tw_color004 = #ffed5f00
tw_color005 = #ffbebebe
tw_color006 = #ffa0a0a0
tw_color007 = #ff787878
tw_color008 = #ff60c0ff
tw_color009 = #ff91dcff
tw_color010 = #ffb1e0ff
tw_color011 = #ffbebebe
tw_color012 = #ff636363
tw_color013 = #ffffffff
tw_color014 = #ffbebebe
tw_color015 = #ff00a2ff
tw_color016 = #ff636363
tw_color017 = #ff000000
tw_color018 = #ff656f4f
tw_color019 = #ff000000
tw_color020 = #fff6af7f
tw_color021 = #ff91dcff
tw_color022 = #ff60c0ff
tw_color023 = #ff91dcff
tw_color024 = #ffb1e0ff
tw_color025 = #ffcccccc
tw_color026 = #ff767676
tw_color027 = #ff90e2f7
tw_color028 = #ffebebeb
tw_color029 = #ffc8c8c8
tw_color030 = #ff3484c8
tw_color031 = #ff428eba
tw_color032 = #ffffcc00
tw_color033 = #ffffffff
tw_color034 = #ff3e91ff
tw_color035 = #ff000000
tw_color036 = #ffd43f16
tw_color037 = #ff009ff2
tw_color038 = #ff555555
tw_color039 = #ffa3a3a3
tw_color040 = #ffeb2c00
tw_color041 = #ff46a7fe
tw_color042 = #ffd1d1d1
tw_color043 = #ff595959
tw_color044 = #ff808080
tw_color045 = #ff3b5998
tw_color046 = #ff5a8ca5
tw_color047 = #ff646464
tw_color048 = #ff8bc500
tw_color049 = #ffe60000
tw_color050 = #ffffffff
tw_color051 = #ff10a5ff
tw_color052 = #fff00101
tw_color053 = #ff0036ff
tw_color054 = #ff000000
tw_color055 = #ffffff00
tw_color056 = #ff909090
tw_color057 = #ffffffff
tw_color058 = #ffffffff
tw_color059 = #ff000000
tw_color060 = #ff656f4f
tw_color061 = #ff00baff
tw_color062 = #ff84e902
tw_color063 = #ffbfbfbf
tw_color064 = #ff7f7f7f
tw_color065 = #ff0091ff
tw_color066 = #ffff0000
tw_color067 = #fff77501
tw_color068 = #ff000000
tw_color069 = #ffa4d7ff
tw_color070 = #ff00bad7
tw_color071 = #ff216ae4
tw_color072 = #ff000000
tw_color073 = #fffff60a
tw_color074 = #ffe84c00
tw_color075 = #ffc221b5
tw_color076 = #ff0d89b0
tw_color077 = #ff688f0c
tw_color078 = #ff33cc00
tw_color079 = #ffff0000
tw_color080 = #ff0070b7
tw_color081 = #ff0091ff
tw_color082 = #ffababab
tw_color083 = #ffdcdcdc
tw_color084 = #ff110503
tw_color085 = #ff505050
tw_color086 = #ff969696
tw_color087 = #ffc8c8c8
tw_color088 = #ff75d0ff
tw_color089 = #ffffffff
tw_color090 = #ffb1ca00
tw_color091 = #ffff7e00
tw_color092 = #ff464646
tw_color093 = #ff1e1e1e
tw_color094 = #ff646464
tw_color095 = #ff242424
tw_color096 = #ff1c1f24
tw_color097 = #ff0097de
tw_color098 = #ff666666
tw_color099 = #ffed5f00
tw_color100 = #ff393939
tw_color101 = #ffff6015
tw_color102 = #ffffa816
tw_color103 = #fffff200
tw_color104 = #ff9cff00
tw_color105 = #ff00ffae
tw_color106 = #ff00d0f5
tw_color107 = #ff006cff
tw_color108 = #ff4729ff
tw_color109 = #ff9029ff
tw_color110 = #ffd929ff
tw_color111 = #ffff2988
tw_color112 = #ffffca99
tw_color113 = #fffff899
tw_color114 = #ffbcee97
tw_color115 = #ff97cef7
tw_color116 = #ffc5a6e8
tw_color117 = #fffca5d7
tw_color118 = #ff790000
tw_color119 = #ff7d4900
tw_color120 = #ff737b00
tw_color121 = #ff006918
tw_color122 = #ff005b7f
tw_color123 = #ff0d004c
tw_color124 = #ff4b0049
tw_color125 = #ffb39d7b
tw_color126 = #ff9d9d9d
tw_color127 = #ff00a1fd
tw_color128 = #ffe6e6e6
tw_color129 = #ff00b4ff
tw_color130 = #ff00dd00
tw_color131 = #ffff9600
tw_color132 = #ffcbf430
tw_color133 = #ff7a9cc6
tw_color134 = #ffffb400
tw_color135 = #ff137e08
tw_color136 = #ff1b7212
tw_color137 = #ff8b919d
tw_color138 = #ffc2c2c2
tw_color139 = #ff556872
tw_color140 = #ff009933
tw_color141 = #ff0099ff
tw_color142 = #ff089fe4
tw_color143 = #ff353636
tw_color144 = #ffd4dadf
tw_color145 = #ff606060
tw_color146 = #ff373737
tw_color147 = #ff323a41
tw_color148 = #ff7c7c7c
tw_color149 = #ff393939
tw_color150 = #ff393939
tw_color151 = #ff00aeef
tw_color200 = #ffe2e2e2
tw_color201 = #ff122438
tw_color210 = #ff47ef47
tw_color211 = #ffa2a2a2
tw_color220 = #ff778390
tw_color221 = #ff4d4d4d
tw_color222 = #ffde0000
tw_color223 = #ff300000
tw_color224 = #ff333333
tw_color225 = #ffff5400
tw_color226 = #ff383838
tw_color227 = #fffcff00
tw_color228 = #ffd0d1d2
tw_color230 = #fffff000
tw_color231 = #ffa3a3a3
tw_color232 = #ffd43f16
tw_color233 = #ffd2d2d2
tw_color234 = #ff555555
tw_color235 = #ff818181
tw_color236 = #ff29333c
tw_color237 = #ff4b4b4b
tw_color238 = #ffa2a2a2
tw_color239 = #ff464646
tw_color240 = #ff898989
tw_color241 = #ff565656
tw_color242 = #ff281304
tw_color245 = #ff979797
tw_color246 = #ff171616
tw_color247 = #ff5f98b5
I'm going to do smali when I get back home or tomorrow, if this does the trick the bounty is yours, or if you can make all the text the same color. You probably saw how I mod aps now
Show Some Love
dafoxs said:
Apk multi tool
Show Some Love
Click to expand...
Click to collapse
If it's anything like Apktool you just decompile the apk like normal, make your smali edits, compile the apk and your good to go.
Sent from my SGH-T889 using Xparent Skyblue Tapatalk 2
Tiffany84 said:
If it's anything like Apktool you just decompile the apk like normal, make your smali edits, compile the apk and your good to go.
Sent from my SGH-T889 using Xparent Skyblue Tapatalk 2
Click to expand...
Click to collapse
Do I delete the resource file or no?
Show Some Love
dafoxs said:
Do I delete the resource file or no?
Show Some Love
Click to expand...
Click to collapse
I'm not sure how your tool works but I don't. Is the tool your using like apk manager where you have to delete anything you modified? If so you may need to delete classes.desc
Sent from my SGH-T889 using Xparent Skyblue Tapatalk 2
Tiffany84 said:
I'm not sure how your tool works but I don't. Is the tool your using like apk manager where you have to delete anything you modified? If so you may need to delete classes.desc
Sent from my SGH-T889 using Xparent Skyblue Tapatalk 2
Click to expand...
Click to collapse
I'll try it out tomorrow
Show Some Love
dafoxs said:
I'll try it out tomorrow
Show Some Love
Click to expand...
Click to collapse
Let me know how it goes. If there's anything I can do just send me a pm. If you have problems with your tool I've got a really good one that I could send you.
Sent from my SGH-T889 using Xparent Skyblue Tapatalk 2
Tiffany84 said:
Let me know how it goes. If there's anything I can do just send me a pm. If you have problems with your tool I've got a really good one that I could send you.
Sent from my SGH-T889 using Xparent Skyblue Tapatalk 2
Click to expand...
Click to collapse
Will do, send me one anyway, I like to try them all.
Show Some Love

[FIX][MOD] Mi Note 2 Camera Blobs

tl;dr
I opened the blobs in a hex editor and changed two numbers
Magic!
Preface
This is my attempt at an explanation of what I think is wrong with the Mi Note 2 camera. My overall knowledge of all subjects involved is pretty limited and i may be downright wrong.
But, as wrong as I may be, what I found seems to actually fix something.
This development was motivated by the lack of working Google Camera mods on the Mi Note 2.
And I was, fortunately, somewhat successful!
If this is what you are looking for, go ahead and visit the Google Camera thread here https://forum.xda-developers.com/mi-note-2/how-to/fix-camera-sensor-gcam-mod-t3782495
My goal with this thread is to share what I did, not only the files, but also the thought process behind the changes. You are free to do with them as you wish.
I am also opening discussion on the topic, if anyone more knowledgeable then me wants to chime in and help, I'd be extremely thankful.
I'll keep updating and editing this post with new information and any developments.
Intro
Let's start with what we know about our phone.
The Xiaomi Mi Note 2 has a 22,5MP Sony IMX318 CMOS image sensor.
This sensor has:
an Active Resolution of 5488 x 4112.
an Unit Cell Size of 1µm
a 6,31x Crop Factor.
What's wrong
With this information in mind, let's take a look at the libmmcamera_imx318.so file:
Snippet of file opened in Hex Workshop:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
This is wrong.
Why it is wrong
Although I have no definitive answer as to why, I can make a few conjectures.
Only one Sony sensor has a 5344 x 4016 active resolution, a 1,12µm unit cell size and a 5,78x crop factor.
That's the Sony IMX230. Released in April 2015. Found inside a dozen phones and predecessor to the IMX318.
Maybe Xiaomi was planning to use this sensor inside the Mi Note 2 and on a last minute decision chose to go with the IMX318.
This change was hastily implemented and some leftover crumbs remained in the code.
The Fix
The only thing I changed was the active array size. I changed it from 5344 x 4016 to 5488 x 4112.
I'm currently testing the consequences of fixing the other incorrect values and further exploring the file for more inaccuracies.
Why it works
For this we need to take a look at the code for our Camera HAL3:
C++:
[B]Snippet from file: /QCamera2/HAL3/QCamera3CropRegionMapper.cpp[/B]
/*===========================================================================
* FUNCTION : update
*
* DESCRIPTION: update sensor active array size and sensor output size
*
* PARAMETERS :
* [user=285871]@active[/user]_array_w : active array width
* [user=285871]@active[/user]_array_h : active array height
* [user=8139033]@sensor_[/user]w : sensor output width
* [user=8139033]@sensor_[/user]h : sensor output height
*
* RETURN : none
*==========================================================================*/
void QCamera3CropRegionMapper::update(uint32_t active_array_w,
uint32_t active_array_h, uint32_t sensor_w,
uint32_t sensor_h)
{
// Sanity check
if (active_array_w == 0 || active_array_h == 0 ||
sensor_w == 0 || sensor_h == 0) {
ALOGE("%s: active_array size and sensor output size must be non zero",
__func__);
return;
}
if (active_array_w < sensor_w || active_array_h < sensor_h) {
ALOGE("%s: invalid input: active_array [%d, %d], sensor size [%d, %d]",
__func__, active_array_w, active_array_h, sensor_w, sensor_h);
return;
}
mSensorW = sensor_w;
mSensorH = sensor_h;
mActiveArrayW = active_array_w;
mActiveArrayH = active_array_h;
// Derive mapping from active array to sensor output size
// Assume the sensor first crops top/bottom, or left/right, (not both),
// before doing downscaling.
// sensor_w = (active_array_w - 2 * crop_w) / scale;
// sensor_h = (active_array_h - 2 * crop_y) / scale;
float scale_w = 1.0 * active_array_w / sensor_w;
float scale_h = 1.0 * active_array_h / sensor_h;
float scale = MIN(scale_w, scale_h);
uint32_t crop_w = 0, crop_h = 0;
if (scale_w > scale_h) {
crop_w = (active_array_w - sensor_w * active_array_h / sensor_h)/2;
} else {
crop_h = (active_array_h - sensor_h * active_array_w / sensor_w)/2;
}
mSensorCropW = crop_w;
mSensorCropH = crop_h;
mSensorScale = scale;
ALOGI("%s: active_array: %d x %d, sensor size %d x %d", __func__,
mActiveArrayW, mActiveArrayH, mSensorW, mSensorH);
ALOGI("%s: mSensorCrop is [%d, %d], and scale is %f", __func__,
mSensorCropW, mSensorCropH, mSensorScale);
}
This sanity check in particular
C++:
if (active_array_w < sensor_w || active_array_h < sensor_h) {
ALOGE("%s: invalid input: active_array [%d, %d], sensor size [%d, %d]", __func__, active_array_w, active_array_h, sensor_w, sensor_h);
return;
}
The active array size can never be smaller than the sensor output size.
The sensor output size is our desired output resolution. The resolution in which we want to take photos or capture videos.
The camera HAL then takes our active array size and crops it to the desired output size. It can't do the opposite. The active array size is the highest possible image size the CMOS is capable of outputting.
So what happens when the driver file is telling the camera HAL the active array size is 5344 x 4016 and the sensor output size is 5488 x 4112? It returns an exception.
Some software don't catch this exception and crash. The google camera for example.
Other software catch the exception and assume the 5488 x 4112 sensor output resolution isn't supported. That is what the Camera Hal is telling it. So they try capturing the photo with a lower resolution. This is why we get cropped photos in apps like WhatsApp.
And although I have only looked at the Camera HAL3 code. We can assume the Camera HAL1 code is affected by the same issue.
The other files
On my device the libmmcamera_imx318_primax.so file is the only I need to edit.
I can safely delete both libmmcamera_imx318.so and libmmcamera_imx318_semco.so files from my Mi Note 2 with no consequence.
But not every smartphone is built the same. For example, the Redmi Note 4 can have a Sony, Samsung or Omnivision camera sensor.
The Mi Note 2 isn't as drastic, every Mi Note 2 has a Sony IMX318. But it can come from a few different camera model vendors.
So, I'm assuming the different blobs are for camera models built and sold by Sony, Semco and Primax, all using the Sony IMX318 CMOS.
All these files have the incorrect active array size. The change was the same.
What about the front camera?
I'll edit this bit with info about the change to the front camera blobs. The change was similar but the reasoning was different.
Latest blobs
All these files are located inside /vendor/lib/
Original blobs were taken from MIUI 8.4.12. Edited on 03-05-2018.
https://mega.nz/#!JWoVBCTR!VrThENYfBBO4GMs31obnn4Z8QkBhEASEdNP3FBSOOjw
Hex Workshop Bookmark Files
libmmcamera_imx318_primax.so https://mega.nz/#!sfh2jSRK!pZJQ0dJIyJxv_yXeFMrkt3OkGyD7I0vPrxRobCQjBlw
Some sources
gmsarena page for the Mi Note 2 https://www.gsmarena.com/xiaomi_mi_note_2-8014.php
Sony IMX318 product brief https://www.sony-semicon.co.jp/products_en/IS/sensor1/img/products/ProductBrief_IMX318_20161122.pdf
Sony IMX230 product brief https://www.sony-semicon.co.jp/products_en/IS/sensor1/img/products/ProductBrief_IMX230_20150427.pdf
QCamera3 Crop Region Mapper source code https://source.codeaurora.org/quic/...ee/QCamera2/HAL3/QCamera3CropRegionMapper.cpp
Thanks
Thank you to everyone who participated on the Google Camera thread and helped get it to work.
Thank you @Psy_Man for the chat about this issue.
Thank you @defcomg. Your work on the OP3 sent me in the right direction. https://www.celsoazevedo.com/files/android/google-camera/op3fix/
Amazing!!!
You've done a really great job!!! I changed all the file in /vendor/lib. Suddenly the external apps like whatsapp or instagram stopped to crop the photo taken!
In addiction HDR+ works in a lot of google camera! Thank you a lot!
Official lineage os
Doesn't appear to work in stock based ROMs.
Globe ROM latest weekly based on xiaomi.eu
After reboot fail to connect to camera in any app.
Just a heads up to others wanting to try this.
*Edit* flash able zip in other thread works perfectly though.
What the hell, what I'm supposed to do with this?
Can u make some more clear Tutorial or something?
Or maybe I'm just sleepy and I can't understand XD
Nvm, great job, maybe I'll be somehow able to do that tomorrow and check it
Yeah,great job but could you make it simple for the noobies like me? Thanks ?
all I can say is this is such a great work.
now gcam works even with portrait mode
only problem is the camera lags at rare times, don't know why
For me the camera in other apps such as WhatsApp, Instagram, etc keeps autocropping while in camera mode, instead when you make the photo it's correctly saved. I just applied the mod cam and followed all the steps in raccomandation notes, but I haven't solved. My phone is a Mi Note 2, I'm on Aosp extended. In GCam app it's working correctly
TWRP package, tested on miuiPOLSKA rom.
Reuplad, sorry.
V2 really copies files.
I tested, both photo, some random old ones and made after modification. Both have a size of 5488 x 4112. So nothing changed about the resolution.
@Mimi Mix
I did copy the provided files into /Vendor/lib folder, but for now, I can't open any camera apps.
Can you provide a simple step by step procedure in order to achieve your post please ?
Edit : did work back by manually copying @mstdzw uncompressed files to my /vendor/lib
Thanks
Maybe we need some transplants from other device?
Not so much devices https://www.kimovil.com/pl/lista-telefony-za-model-soczewki/sony-imx318-exmor-rs
@everyone
The point of this thread was mostly to share what I did and get more knowledgeable people to help.
If all you want is to copy the files and see what or if it fixes anything for you, just go grab the installer from my other thread: https://forum.xda-developers.com/mi-note-2/how-to/fix-camera-sensor-gcam-mod-t3782495
or use the one provided by @mstdzw
mstdzw said:
Maybe we need some transplants from other device?
Not so much devices https://www.kimovil.com/pl/lista-telefony-za-model-soczewki/sony-imx318-exmor-rs
Click to expand...
Click to collapse
This is what I'm gonna start looking into today! I've managed to get my hands on another device's blobs and I'm going to start hacking around.
macho_man said:
For me the camera in other apps such as WhatsApp, Instagram, etc keeps autocropping while in camera mode, instead when you make the photo it's correctly saved. I just applied the mod cam and followed all the steps in raccomandation notes, but I haven't solved. My phone is a Mi Note 2, I'm on Aosp extended. In GCam app it's working correctly
Click to expand...
Click to collapse
The viewfinder is bugged. I haven't found out why yet. Maybe something wrong inside the libchromatix files?
The good thing is, it's just that, the viewfinder, now photos get taken correctly!
I believe this is the same issue that's causing the smaller viewfinder in google camera's 4K video recording and the recently released Google Lens inside the Google App.

Categories

Resources