I've been trying to add a custom accent to my Focus S. Most tools available don't yet work (advance config is one) but the interlop unlock by using a provxml does work.
I've tried this
Code:
<wap-provisioningdoc>
<characteristic type="Registry">
<characteristic type="HKLM\ControlPanel\Themes\1\Accents">
<parm name="11" value="4286808708" datatype="integer" />
</characteristic>
<characteristic type="HKLM\ControlPanel\Themes\0\Accents">
<parm name="11" value="4286808708" datatype="integer" />
</characteristic>
<characteristic type="HKLM\ControlPanel\Themes\AccentsDisplayName\ 0409">
<parm name="11" value="Gray" datatype="string" />
</characteristic>
</characteristic>
</wap-provisioningdoc>
and this to eliminate variables
Code:
<wap-provisioningdoc>
<characteristic type="Registry">
<characteristic type="HKLM\ControlPanel\Themes\1\Accents">
<parm name="1" value="-8158588" datatype="integer" />
</characteristic>
<characteristic type="HKLM\ControlPanel\Themes\0\Accents">
<parm name="1" value="-8158588" datatype="integer" />
</characteristic>
<characteristic type="HKLM\ControlPanel\Themes\AccentsDisplayName\ 0409">
<parm name="1" value="Gray" datatype="string" />
</characteristic>
<characteristic type="HKLM\ControlPanel\Themes\1\Accents">
<parm name="2" value="FF838284" datatype="integer" />
</characteristic>
<characteristic type="HKLM\ControlPanel\Themes\0\Accents">
<parm name="2" value="FF838284" datatype="integer" />
</characteristic>
<characteristic type="HKLM\ControlPanel\Themes\AccentsDisplayName\ 0409">
<parm name="2" value="Gray" datatype="string" />
</characteristic>
<characteristic type="HKLM\ControlPanel\Themes\1\Accents">
<parm name="3" value="4286808708" datatype="integer" />
</characteristic>
<characteristic type="HKLM\ControlPanel\Themes\0\Accents">
<parm name="3" value="4286808708" datatype="integer" />
</characteristic>
<characteristic type="HKLM\ControlPanel\Themes\AccentsDisplayName\ 0409">
<parm name="3" value="Gray" datatype="string" />
</characteristic>
<characteristic type="HKLM\ControlPanel\Themes\1\Accents">
<parm name="4" value="0xFF838284" datatype="integer" />
</characteristic>
<characteristic type="HKLM\ControlPanel\Themes\0\Accents">
<parm name="4" value="0xFF838284" datatype="integer" />
</characteristic>
<characteristic type="HKLM\ControlPanel\Themes\AccentsDisplayName\ 0409">
<parm name="4" value="Gray" datatype="string" />
</characteristic>
</characteristic>
</wap-provisioningdoc>
but it doesn't work.
Any help would gratefully be appreciated.
Quick question: did you save the file as Unicode? I think the Samsung tools expect Unicode provxml files. Or maybe it's the other way around, I forget.
GoodDayToDie said:
Quick question: did you save the file as Unicode? I think the Samsung tools expect Unicode provxml files. Or maybe it's the other way around, I forget.
Click to expand...
Click to collapse
I edited other provxml files that I know work. I edited them with notepad and with visual studio, lol I've tried everything.
I tried to do this myself when I had a Focus S with no success.
I wonder how Marvin_S's On-Device ProvXML TOOL gets this to work.
Hopefully he can chime in, hopefully he can get the tool working on the Focus S
ManelScout4Life said:
I wonder how Marvin_S's On-Device ProvXML TOOL gets this to work.
Hopefully he can chime in, hopefully he can get the tool working on the Focus S
Click to expand...
Click to collapse
Im using first gen dlls so a small chance it will work... Are u saying anything trough this app worked on the focus s? If non of the default edits work than dont even bother, ill need to update the app for the samsung s than.
Samsung indeed uses Unicode. Otherwise it wont work. Again there are no focus s dlls in there so idk if it will work, but let me know, otherwise I can add a focus s dll.
Marvin_S said:
Im using first gen dlls so a small chance it will work... Are u saying anything trough this app worked on the focus s? If non of the default edits work than dont even bother, ill need to update the app for the samsung s than.
Samsung indeed uses Unicode. Otherwise it wont work. Again there are no focus s dlls in there so idk if it will work, but let me know, otherwise I can add a focus s dll.
Click to expand...
Click to collapse
No, your tool does not work at all on the S, it opens but none of the functions work.
However, I can add provxml files with the filedeployer xaps.
I'm also unsure what the proper provxml file should look like for changing accents.
ManelScout4Life said:
No, your tool does not work at all on the S, it opens but none of the functions work.
However, I can add provxml files with the filedeployer xaps.
I'm also unsure what the proper provxml file should look like for changing accents.
Click to expand...
Click to collapse
As expected.
Very simple just save it in Unicode, than it should work man.
Also if you want to bind it in an app, I've found some native stuff to work with on the Samsung S
Code:
Nevermind
EDIT:
The api is listed here, there might be a way to update the app
EDIT2:
Code:
public void Initialize()
{
ComBridge.RegisterComDll("WirelessManager_SecProxyClient.dll", new Guid("6992E452-12CB-4cb7-A9C8-5CC548159A69"));
this.m_CoClass = new COSecWin32Proxy();
this.m_CoInterface = (ISecProxyWin32Interface) this.m_CoClass;
}
[ComImport, Guid("6992E452-12CB-4cb7-A9C8-5CC548159A69"), ClassInterface(ClassInterfaceType.None)]
public class COSecWin32Proxy
{
}
[ComImport, Guid("2A9C50C0-77AC-4a12-9E26-17395ADF8870"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface ISecProxyWin32Interface
{
void GetProxyVersion(out uint version);
void Reserved();
void ChekcAPI(uint apiID, out uint result);
void RegistrySetString(uint HKEY, string pwszPath, string valueName, string value);
void RegistryGetString(uint HKEY, string pwszPath, string valueName, out string value);
void RegistrySetDWORD(uint HKEY, string pwszPath, string valueName, uint value);
void RegistryGetDWORD(uint HKEY, string pwszPath, string valueName, out uint value);
void CreateFile(string lpFileName, uint dwDesiredAccess, uint dwShareMode, uint dwCreationDisposition, uint dwFlagsAndAttributes, out uint phCreateFile);
void CloseHandle(uint hObject);
void ReadFile(uint hFile, out byte[] lpBuffer, uint nNumberOfBytesToRead, out uint lpNumberOfBytesRead);
void WriteFile(uint hFile, byte[] lpBuffer, uint nNumberOfBytesToWrite, out uint lpNumberOfBytesWritten);
void GetFileSize(uint hFile, out uint lpFileSizeHigh);
void CopyFile(string lpExistingFileName, string lpNewFileName, int bFailIfExists);
void DeleteFile(string lpFileName);
void LaunchExe(string szExe, string szArg);
}
Should be the code Ill need to add to the app (not sure if it will work though, ill have to scan the app further).
Marvin_S said:
As expected.
Very simple just save it in Unicode, than it should work man.
Also if you want to bind it in an app, I've found some native stuff to work with on the Samsung S
Code:
namespace Samsung.Phone.Native
{
public class Con
{
// Fields
private COSecCONProxy m_CoClass;
private ISecProxyCONInterface m_CoInterface;
private static Con m_single;
// Methods
static Con();
private Con();
public static void BluetoothCloseAudio();
public static void BluetoothOpenAudio();
public static ISecProxyCONInterface CallInterface();
public ISecProxyCONInterface GetComInterface();
public static Con GetInstance();
public static void GetRadioState(int device, out bool state);
public static void GetWirelessState(out bool state);
public void Initialize();
public static void SetRadioState(int device, bool state);
public static void SetWirelessState(bool state);
public static void WlanGetIpInfo(out string IpAddr, out string Subnet, out string Gateway, out string Dns, out string Wins, out bool DhcpMode);
public static void WlanGetStatus(out string macAddr, out string ssid, out int status, out int rssi, out int security);
public static void WlanSetIpInfo(string IpAddr, string Subnet, string Gateway, string Dns, string Wins, bool DhcpMode);
}
[ComImport, ClassInterface(ClassInterfaceType.None), Guid("3E16DD96-1BB8-4ed4-A74F-EE16307A147E")]
public class COSecCONProxy
{
}
[ComImport, ClassInterface(ClassInterfaceType.None), Guid("89DE267C-9F5A-43f5-895C-B891F0F64C6E")]
public class COSecRILProxy
{
}
[ComImport, Guid("A1EF1A51-6156-4882-A9D3-202881BC7A05"), ClassInterface(ClassInterfaceType.None)]
public class COSecSYSProxy
{
}
[ComImport, Guid("6992E452-12CB-4cb7-A9C8-5CC548159A69"), ClassInterface(ClassInterfaceType.None)]
public class COSecWin32Proxy
{
}
[ComImport, Guid("9ADD1CCA-FB7B-4f31-A496-9FC565DB0272"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface ISecProxyCONInterface
{
void GetProxyVersion(out uint version);
void Reserved();
void ChekcAPI(uint apiID, out uint result);
void WlanGetIpInfo(out string IpAddr, out string Subnet, out string Gateway, out string Dns, out string Wins, out bool DhcpMode);
void WlanSetIpInfo(string IpAddr, string Subnet, string Gateway, string Dns, string Wins, bool DhcpMode);
void WlanGetStatus(out string macAddr, out string ssid, out int status, out int rssi, out int security);
void SetRadioState(int device, bool state);
void GetRadioState(int device, out bool state);
void SetWirelessState(bool state);
void GetWirelessState(out bool state);
void BluetoothOpenAudio();
void BluetoothCloseAudio();
}
[ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("CA785B58-3211-46ee-B2B8-13F0CFA18C17")]
public interface ISecProxyRILInterface
{
void GetProxyVersion(out uint version);
void Reserved();
void ChekcAPI(uint apiID, out uint result);
void GetIMSI(out string IMSI);
void GetIMEI(out string IMEI);
void GetLockingStatus(uint m_dwLockFacility, out uint pdwLockStatus, out uint pdwResult);
void GetCallWaitingStatus(out uint pdwInfoClass, out uint pdwResult);
void SetCallWaitingStatus(uint dwInfoClass, uint dwStatus, out uint pdwResult);
void GetOperatorList([MarshalAs(UnmanagedType.SafeArray)] out byte[] info, out uint pdwCount, out uint pdwResult);
void SetCurrentOperator(uint dwMode, IntPtr info, out uint pdwResult);
void GetCallForwardingSettings(uint dwReason, uint dwAddressID, out uint pdwStatus, out uint pdwNumType, out string pwszAddress, out uint pdwDelayTime, out uint pdwResult);
void AddCallForwardingSettings(uint dwReason, uint dwInfoClass, string wszAddress, uint dwDelayTime, out uint pdwResult);
void RemoveCallForwardingSettings(uint dwReason, uint dwInfoClass, out uint pdwResult);
void RIL_Devspecific2DWORD(uint dwCmdID, out uint pdwParam1, out uint pdwParam2, out uint pdwResult);
void GetCallBarringStatus(uint dwType, uint dwInfoClass, string szPassword, out uint pdwBarringStatus, out uint pdwResult);
void SetCallBarringStatus(uint dwType, uint dwInfoClass, string szPassword, uint dwBarringStatus, out uint pdwResult);
void GetAudioMute(out uint dwEnable);
void SetAudioMute(uint dwEnable);
void Hangup();
void PerformImeiCompare(out string strSalesCode, out uint dwResult, out string strErrorMessage);
void SetLockingStatus(uint m_dwLockFacility, string pPasswd, out uint m_dwStatus, out uint pdwResult);
void CallBlockerUpdateInfo(string pwszUpdatedUserInfo, uint dwOpMode, out uint dwResult);
void GetCBConfig(out uint dwTotal, out uint dwSize, out byte[] lpBuffer);
void SetCBConfig(uint dwTotal, uint dwSize, byte[] lpBuffer);
}
[ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("E05255E0-ED8F-4898-B3C3-4F8C5E29A2C1")]
public interface ISecProxySYSInterface
{
void ChekcAPI(uint apiID, out uint result);
}
[ComImport, Guid("2A9C50C0-77AC-4a12-9E26-17395ADF8870"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface ISecProxyWin32Interface
{
void GetProxyVersion(out uint version);
void Reserved();
void ChekcAPI(uint apiID, out uint result);
void RegistrySetString(uint HKEY, string pwszPath, string valueName, string value);
void RegistryGetString(uint HKEY, string pwszPath, string valueName, out string value);
void RegistrySetDWORD(uint HKEY, string pwszPath, string valueName, uint value);
void RegistryGetDWORD(uint HKEY, string pwszPath, string valueName, out uint value);
void CreateFile(string lpFileName, uint dwDesiredAccess, uint dwShareMode, uint dwCreationDisposition, uint dwFlagsAndAttributes, out uint phCreateFile);
void CloseHandle(uint hObject);
void ReadFile(uint hFile, out byte[] lpBuffer, uint nNumberOfBytesToRead, out uint lpNumberOfBytesRead);
void WriteFile(uint hFile, byte[] lpBuffer, uint nNumberOfBytesToWrite, out uint lpNumberOfBytesWritten);
void GetFileSize(uint hFile, out uint lpFileSizeHigh);
void CopyFile(string lpExistingFileName, string lpNewFileName, int bFailIfExists);
void DeleteFile(string lpFileName);
void LaunchExe(string szExe, string szArg);
}
public class RIL
{
// Fields
private COSecRILProxy m_CoClass;
private ISecProxyRILInterface m_CoInterface;
private static RIL m_single;
// Methods
static RIL();
private RIL();
public static void AddCallForwardingSettings(uint dwReason, uint dwInfoClass, string wszAddress, uint dwDelayTime, out uint pdwResult);
public static void CallBlockerUpdateInfo(string pwszUpdatedUserInfo, uint dwOpMode, out uint dwResult);
public static ISecProxyRILInterface CallInterface();
public static void GetAudioMute(out uint dwEnable);
public static void GetCallBarringStatus(uint dwType, uint dwInfoClass, string szPassword, out uint pdwBarringStatus, out uint pdwResult);
public static void GetCallForwardingSettings(uint dwReason, uint dwAddressID, out uint pdwStatus, out uint pdwNumType, out string pwszAddress, out uint pdwDelayTime, out uint pdwResult);
public static void GetCallWaitingStatus(out uint pdwInfoClass, out uint pdwResult);
public ISecProxyRILInterface GetComInterface();
public static void GetIMEI(out string IMEI);
public static void GetIMSI(out string IMSI);
public static RIL GetInstance();
public static void GetLockingStatus(uint m_dwLockFacility, out uint pdwLockStatus, out uint pdwResult);
public static void GetOperatorList(out byte[] info, out uint pdwCount, out uint pdwResult);
public void Initialize();
public static void PerformImeiCompare(out string strSalesCode, out uint dwResult, out string strErrorMessage);
public static void RemoveCallForwardingSettings(uint dwReason, uint dwInfoClass, out uint pdwResult);
public static void RIL_Devspecific2DWORD(uint dwCmdID, out uint pdwParam1, out uint pdwParam2, out uint pdwResult);
public static void SetAudioMute(uint dwEnable);
public static void SetCallBarringStatus(uint dwType, uint dwInfoClass, string szPassword, uint dwBarringStatus, out uint pdwResult);
public static void SetCallWaitingStatus(uint dwInfoClass, uint dwStatus, out uint pdwResult);
public static void SetCurrentOperator(uint dwMode, IntPtr info, out uint pdwResult);
}
public class RilCBMsgConfig
{
// Fields
public uint cbSize;
public List<RILRANGE> channelList;
public uint dwBroadcastMsgLangs;
public uint dwParams;
public bool fAccept;
// Methods
public RilCBMsgConfig();
public void AddChannel(RILRANGE range);
public bool Contains(RILRANGE range);
public uint GetCbSize();
public RILCBMSGCONFIG GetConfigStruct();
public static RILRANGE GetRange(int channel);
public static byte[] MakeRawData(RilCBMsgConfig cbConfg);
public static RilCBMsgConfig ParseData(uint total, uint size, byte[] rawData);
public override string ToString();
// Nested Types
[StructLayout(LayoutKind.Sequential)]
public struct RILCBMSGCONFIG
{
public uint cbSize;
public uint dwParams;
public uint dwBroadcastMsgLangs;
public bool fAccept;
[MarshalAs(UnmanagedType.ByValArray, SizeConst=1)]
public byte[] channelList;
}
[StructLayout(LayoutKind.Sequential)]
public struct RILRANGE
{
public uint dwMin;
public uint dwMax;
}
}
[StructLayout(LayoutKind.Sequential)]
public struct RILOPERATORNAMES
{
public uint cbSize;
public uint dwParams;
public string szLongName;
public string szShortName;
public string szNumName;
public string szCountryCode;
}
public class Sys
{
// Fields
private COSecSYSProxy m_CoClass;
private ISecProxySYSInterface m_CoInterface;
private static Sys m_single;
// Methods
static Sys();
private Sys();
public static ISecProxySYSInterface CallInterface();
public ISecProxySYSInterface GetComInterface();
public static Sys GetInstance();
public void Initialize();
}
public class Win32
{
// Fields
public static uint CREATE_ALWAYS;
public static uint CREATE_NEW;
public static uint FILE_ATTRIBUTE_ARCHIVE;
public static uint FILE_ATTRIBUTE_COMPRESSED;
public static uint FILE_ATTRIBUTE_DIRECTORY;
public static uint FILE_ATTRIBUTE_ENCRYPTED;
public static uint FILE_ATTRIBUTE_HIDDEN;
public static uint FILE_ATTRIBUTE_INROM;
public static uint FILE_ATTRIBUTE_NORMAL;
public static uint FILE_ATTRIBUTE_NOT_CONTENT_INDEXED;
public static uint FILE_ATTRIBUTE_OFFLINE;
public static uint FILE_ATTRIBUTE_READONLY;
public static uint FILE_ATTRIBUTE_REPARSE_POINT;
public static uint FILE_ATTRIBUTE_ROMMODULE;
public static uint FILE_ATTRIBUTE_ROMSTATICREF;
public static uint FILE_ATTRIBUTE_SPARSE_FILE;
public static uint FILE_ATTRIBUTE_SYSTEM;
public static uint FILE_ATTRIBUTE_TEMPORARY;
public static uint FILE_FLAG_BACKUP_SEMANTICS;
public static uint FILE_FLAG_DELETE_ON_CLOSE;
public static uint FILE_FLAG_NO_BUFFERING;
public static uint FILE_FLAG_OVERLAPPED;
public static uint FILE_FLAG_POSIX_SEMANTICS;
public static uint FILE_FLAG_RANDOM_ACCESS;
public static uint FILE_FLAG_SEQUENTIAL_SCAN;
public static uint FILE_FLAG_WRITE_THROUGH;
public static uint FILE_SHARE_DELETE;
public static uint FILE_SHARE_READ;
public static uint FILE_SHARE_WRITE;
public static uint GENERIC_ALL;
public static uint GENERIC_EXECUTE;
public static uint GENERIC_READ;
public static uint GENERIC_WRITE;
public static uint HKEY_CLASSES_ROOT;
public static uint HKEY_CURRENT_USER;
public static uint HKEY_LOCAL_MACHINE;
public static uint HKEY_USERS;
private COSecWin32Proxy m_CoClass;
private ISecProxyWin32Interface m_CoInterface;
private static Win32 m_single;
public static uint MODULE_ATTR_NODEBUG;
public static uint MODULE_ATTR_NOT_TRUSTED;
public static uint OPEN_ALWAYS;
public static uint OPEN_EXISTING;
public static uint OPEN_FOR_LOADER;
public static string REG_WM_BUSY_FLAG;
public static string REG_WM_GPRS_ALWAYSON;
public static string REG_WM_GPRS_APN;
public static string REG_WM_GPRS_AUTH_TYPE;
public static string REG_WM_GPRS_NAME;
public static string REG_WM_GPRS_PASSWORD;
public static string REG_WM_GPRS_PROFILES_TO_DELETE;
public static string REG_WM_GPRS_UNAME;
public static string REG_WM_MMS_APN;
public static string REG_WM_MMS_MMSC;
public static string REG_WM_MMS_MSGSIZE;
public static string REG_WM_MMS_NAME;
public static string REG_WM_MMS_PROFILES_TO_DELETE;
public static string REG_WM_MMS_PROXY;
public static string REG_WM_PROXY_ADDR;
public static string REG_WM_PROXY_APN;
public static string REG_WM_PROXY_DOMAIN;
public static string REG_WM_PROXY_NAME;
public static string REG_WM_PROXY_PORT;
public static string REG_WM_PROXY_PROFILES_TO_DELETE;
public static string REG_WM_ROOT;
public static uint TRUNCATE_EXISTING;
// Methods
static Win32();
private Win32();
public static ISecProxyWin32Interface CallInterface();
public static void CloseHandle(uint hObject);
public static void CopyFile(string lpExistingFileName, string lpNewFileName, int bFailIfExists);
public static void CreateFile(string lpFileName, uint dwDesiredAccess, uint dwShareMode, uint dwCreationDisposition, uint dwFlagsAndAttributes, out uint phCreateFile);
public static void DeleteFile(string lpFileName);
public ISecProxyWin32Interface GetComInterface();
public static void GetFileSize(uint hFile, out uint lpFileSizeHigh);
public static Win32 GetInstance();
public void Initialize();
public static void LaunchExe(string szExe, string szArg);
public static void ReadFile(uint hFile, out byte[] lpBuffer, uint nNumberOfBytesToRead, out uint lpNumberOfBytesRead);
public static void RegistryGetDWORD(uint HKEY, string pwszPath, string valueName, out uint value);
public static void RegistryGetString(uint HKEY, string pwszPath, string valueName, out string value);
public static void RegistrySetDWORD(uint HKEY, string pwszPath, string valueName, uint value);
public static void RegistrySetString(uint HKEY, string pwszPath, string valueName, string value);
public static void WriteFile(uint hFile, byte[] lpBuffer, uint nNumberOfBytesToWrite, out uint lpNumberOfBytesWritten);
}
}
It seems the API I need to make DiagProvXML work is still there. I might give it an update to support the Focus S (also Focus W & co.)
Ill need somebody with a Focus S to test it for me also.
Click to expand...
Click to collapse
I can test it but which one of the codes in the opening post is done correctly?
@Marvin_S: If you do a search you can find my post from a couple weeks back with various tests for the Samsung gen2 DLLs. They are indeed different from the gen1 DLLs, but offer a lot of exciting new capabilities. Unfortunately, there's also some kind of check or block on third-party use of the DLLs. I'm not yet sure exactly what caused it to not work. I'm still working on that, though.
EDIT: You've been able to make that work? My test app either produced an error message (file not found, of all things) or simply crashed each time I tried to use one of those APIs.
GoodDayToDie said:
@Marvin_S: If you do a search you can find my post from a couple weeks back with various tests for the Samsung gen2 DLLs. They are indeed different from the gen1 DLLs, but offer a lot of exciting new capabilities. Unfortunately, there's also some kind of check or block on third-party use of the DLLs. I'm not yet sure exactly what caused it to not work. I'm still working on that, though.
EDIT: You've been able to make that work? My test app either produced an error message (file not found, of all things) or simply crashed each time I tried to use one of those APIs.
Click to expand...
Click to collapse
No, untested, just inspected the samsung xap. I already assumed it would not work, but I posted it here for future reference for myself.
Ah too bad, can you call any api at all? For example the launchexe? it seems like they renamed rapiconfig.exe into ConfigXML.exe (or maybe rapiconfig is still there) it seems that ConfigXML.exe does not accept raw xml indeed but rather canned commands.
I included the source for the app, so feel free to take a look (and read the thread of tester comments, since I don't have a suitable device for testing).
Registry access: failed.
Filesystem access (yes the new DLLs seem to offer it): failed.
Provxml: failed
Other, trivial things: failed.
The OEM apps all contain a file simply called "_" which is a simple text file containing hex data as a string. I suspect the problems may be related to this file. If it's some kind of signature, that's going to be very hard to fake.
Here is the test app and source
[XAP][SOURCE][MANGO] Samsung gen2 interop test app v2
Any news from anyone?
Hi,
I have hooked into afterHookedMethod to read some fields from an object but I'm getting java.lang.NoSuchFieldError and I don't understand why.
Say I have these files:
Code:
package com.android.demo;
public class Bar {
public boolean mBoolean;
public Bar() {
mBoolean = false;
}
}
Code:
package com.android.sample;
public class Foo {
Bar getBar() {
Bar bar = new Bar();
bar.mBoolean = true;
return bar;
}
}
And my Xposed hook:
Code:
findAndHookMethod(
"com.android.sample",
lpparam.classLoader,
"getBar",
new XC_MethodHook() {
@Override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
// This is supposed to be `bar`, right?
Object result = param.getResult();
// Throws java.lang.NoSuchFieldError: com.android.demo.Bar#mBoolean
Log.d(TAG, "mBoolean: " + String.valueOf(getBooleanField(result, "mBoolean")));
// In the end this is what I'm trying to do...
//setBooleanField(result, "mBoolean", false);
//Log.d(TAG, "mBoolean: " + String.valueOf(getBooleanField(result, "mBoolean")));
//param.setResult(result);
}
}
);
One thing that I should mention is that the real code I'm trying to change is obfuscated with Proguard. But I decoded it and looked for the method name - which was just "f" and use that instead of "getBar". I know I got the method name right because the error outputs the package name and class name correctly for the result object which is not obfuscated. And I'm sure this object has many public fields, but I can't access (or change for that matter) any of them without an exception being thrown.
What am I missing?
Whenever I've used this method, the first parameter has been the instance of the class (param.thisObject). I'm curious to know if it's possible to make it work the way you're trying to do with param.getResult().
But if you hook the constructor of the Bar class and try getObjectField with (param.thisObject, mBoolean) it should work.
PunchUp said:
Whenever I've used this method, the first parameter has been the instance of the class (param.thisObject). I'm curious to know if it's possible to make it work the way you're trying to do with param.getResult().
But if you hook the constructor of the Bar class and try getObjectField with (param.thisObject, mBoolean) it should work.
Click to expand...
Click to collapse
Maybe, but I'm not sure that allows me to achieve my end goal...
To be more specific, I'm trying to change the result of this:
https://github.com/android/platform...rc/com/android/email/SecurityPolicy.java#L120
Tried something simpler:
Code:
findAndHookMethod(
"com.android.emailcommon.provider.Policy",
lpparam.classLoader,
"a",
"android.database.Cursor",
new XC_MethodHook() {
@Override
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
Log.d(TAG, "mPasswordMode = " +
String.valueOf(XposedHelpers.getIntField(param.thisObject, "mPasswordMode")));
}
}
);
Got this:
Code:
06-28 21:45:11.133 7201-7824/? E/Xposed: java.lang.NoSuchFieldError: com.android.emailcommon.provider.Policy#mPasswordMode
I don't understand what I'm missing...
I feel like an idiot...
I've been focusing on the methods and the fact that they are obfuscated that I forgot that the instance variables also are obfuscated.
It makes perfect sense now why none of this was working... Back to the drawing board.
Great Your question made me learn something new
PunchUp said:
Great Your question made me learn something new
Click to expand...
Click to collapse
Cool But what was that?
Save