How to hard code a url and port number into existing android application APKTOOL - General Questions and Answers

I am attempting to learn more about SMALI and reverse engineering android apks. I am using apktool to decompile the application. I am working with an app that allows you to enter the url and port thru an input box, but my question is, How do I hard code the server URL in so I dont need to type it in the input box? Can I create a string name called "host" in strings.xml and somehow point to that string in another file? Also if that does work, or not, is it possible to remove the actual input box from the application thru smali?? If I can add "host" to strings.xml, what other files needs to point to that string xml? I am n00b, but curious about modifying smali, but I cant find much info related to smali in a way I can understand. Also, i read about creating an android sql database file and entering in the url and port there and adding it into assets, but how would I point to the database so the app uses my server url and port I put in the database file and skip the input box where user types in url and port???

Related

VB.net How to change images in an imagebox with code?

As the title suggests, I use Visual Basic and was wondering how to change what image is shown in an imagebox through code?
Most of the suggestions google found me only work with the normal .net framework, not the compact version >.<
Any ideas anyone?
The following code will change it.
Code:
pictureBox1.Image = new Bitmap("\\windows\\bt_tran.bmp");
I only code in C#, but in this case the code is almost identical for VB and C#
VB: Use single slashes in the pathname, and drop the C# end of line character ';'
Insert your pathname in the function.
Note that the 'Image' property is itself an 'Image' object, you can't just stuff a path to your file in it, as you do when it is created in design mode. The path is a string, the object types won't match, and the compiler will throw it out. You have to create a new image from the pathname first and pass it that instead.
The pathname must exist on the emulator or on your device, or it will throw an error. Don't make the mistake of referring to a file on your PC, your device can't see it.
Cheers
You have no idea how helpful you are lol

[Q] how execute/apply xml file?

Hello,
I have a lot of problems with omnia 7 due to app profile network of samsung haven´t got the profile of my operator. I can set it thanks to a post of here, but I think that it is a bit difficult and you need the computer to set it. As I have studied some of programming c#, I decided to make an app that set mms and internet. I have already done the screen and I´ve get to make that app create the file xml with the code in order to set mms and internet, but I haven´t found information about how execute/apply the file xml with the app. Where can I find about it?
PD: Sorry, I do not control English very well
Hi,
I guess it's a topic a bit complex, but can not someone help me with this?
You use an OEM COM interface, accessed from C# by using Microsoft.Phone.InteropServices.ComBridge. One easy way to see how this is done is to look at the source of an app that does it. If you can't get the source to DiagProvXML, you could always just decompile it (decompiling .NET code is pretty easy and there are several tools that can do it). There are several other apps that also use provxml; one or more of them may offer source access.
Hi,
Thank for your help and I can select the services that I have load, but I have a small problem that I hadn't taken into account. I know c# but my apps are a lot of more easy that diagprovxml, and I can´t find the part of program that I´m interested. I use "JustDecompile" to decompile the app. Could you tell me what class(or classes) is (are) what I'm looking for?
Thank you very much again
Hmm... it's not linked in my SIG because it's out-o-date, but you could try using Search to find my old DeployProvXml app. It includes a pretty straightforward example of using provxml.
Essentially, you need the following things:
The interopservices DLL (allows you to use the ComBridge class).
The OEM DLLs (DMXMLCOM.dll and such).
COM class and interface definitions for them in C# (this is the stuff with the [ComImport] attributes and the GUIDs).
ID_CAP_INTEROPSERVICES in your WMAppManifest.
WPInteropManifest.xml file in your project.
Use the ComBridge to register the COM interfaces, then create an instance of the COM class(es), cast to the appropriate interface type(s), and use a variable of the interface type like any other .NET object.
You can read a bit more about COM and native code in Heathcliff74's guide. It's aimed at making your own native libraries, so skip all the stuff about creating your own COM classes and writing native code. http://forum.xda-developers.com/showthread.php?t=1299134
Hi again, Does the method WP7RootToolsSDK.Environment.ProcessConfigXml allow to set the parameters that have a tipical xml file?
thank you again
I'm not sure what you mean by "set the parameters" but the Root Tools SDK does in fact allow you to consume ProvXML files now (I think it even supports the query provXML and returns the output, though I haven't tried).

[IDEA] And what about file association ?

When I search in the wp7 forum I see few thread about file association in wp7 but I just remark that it's not so difficult to do using the excellent wp7 root tools SDK:
Code:
string Me = "1ff297cf-853f-4c7c-b9ca-1d255cb4c387".ToUpper(); //our Application's AppId
string Format = ".xml";
//set the defaut file association for .xml to FileAssoc instead of xmlfile
Registry.SetValue(RegistryHyve.ClassesRoot, Format, "Default", "FileAssoc");
//create the corresponding registry key
try { Registry.DeleteKey(RegistryHyve.ClassesRoot, "FileAssoc"); }
catch { }
Registry.CreateKey(RegistryHyve.ClassesRoot, "FileAssoc");
//create the key BrowseInPlace (I don't know why, I just do it, it takes one line)
Registry.SetValue(RegistryHyve.ClassesRoot, "FileAssoc", "BrowseInPlace", 0x0);
//and the app that must open .xml file (our app)
Registry.CreateKey(RegistryHyve.ClassesRoot, "FileAssoc\\shell\\open\\command");
Registry.SetValue(RegistryHyve.ClassesRoot, "FileAssoc\\shell\\open\\command", "Default", "app://" + Me + "/_default?type=FileAssoc&file=%s");
But if each application try to play with those settings it wil be the mess in the phone that's why I suggest that someone create an app that manage file associations for the user to choose what application he want use for a given file type and to support more file type (like .epub or .rar).
moreover the application that create File association must use native code but it's not necessarily the case for the application that read the file it would allow developers to publish this app on the marketplace (by adding an other source like skydrive or url) and the application that create File association would just be a big plus for Interop-unlocked phones.
Here is an app that display xml file in a textbox it's just an exemple of how it works:
fbe.am/8ld ==> xap
fbe.am/8le ==> source
What do you think ?
I actually knocked up an app very similar to this a little while ago, I didn't get around to finishing it but it was fully capable of searching the registry and compiling a list of known file extensions. As well as searching the installation directories of app's for certain .xml which contained the file extension that the app wanted to be associated with.
It was all written as a managed app, and I don't know if someone would want to look at it, but if there is some interest I can put it up.

[Q] To which language does the following code belong to ?

Hey Guys,
Recently I was planning to learn to code android apps, so I decompiled an app I wanted to modify & was going through the source code. All of the .smali files were un-encrypted. I would like to know if this code is Objective-C or Java.
I tried to add the code snippets & also tried to pastie it but apparently the posts doesn't seem to accept foreign links so I'll try to post it in the comments.
File Names: h, h$a
Also, I wanted to know what do these file names represent & what does the "dollar" sign stand for in the file names.
Thanks in Advance,
Netguy
Update: I tried posting it via comments but it wasn't possible. Let me know how can I share the code over here. Thanks.
Smali is disassembled Dalvik virtual machine byte code.
The source of it is Java, although you can't easily reconstruct the original source.
MyClass.smali is the class file for MyClass
MyClass$SubClass.smali is the class file for the nested subclass SubClass
MyClass$1.smali is the class file for an anonymous nested subclass.
ab.smali and ab$bd.smali are obfuscated file names.
Some companies rename everything using automatic tools to hide the intent.
Yes, you can write in smali if you like.
Usually such use is limited to small changes in an existing program.
Thanks a lot for the information Renate NST. While digging through some of the smali files, I found some URLs related to the google ads. So will changing the URL to something else disable the ads or will it just result in malfunctioning of the app ? Thanks a lot once again.

How to decompile library .so android?

Good morning to the whole forum;
maybe it will be a stupid question, but I need to solve this problem; I'll try to be brief:
I have an android app, developed and running only on the Lollipop version and created to communicate with the server, remotely, via a static public IP address;
now, with the change from analogue to fiber adsl, they changed my public ip address, so the app no longer works. I contacted my developer friend who created the app, but he tells me that he no longer has the source and no longer even has the necessary tools to compile it again, so I'll have to do it myself ...
The string to be modified is located on this path:
lib
armeabi-v7a
library.so
Is there a way to decompile, just change that string and recompile everything?
Or some other procedure to solve this problem?
Thanks

Categories

Resources