How to decompile library .so android? - General Questions and Answers

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

Related

Hyperlink code to force ftp download

What is the proper format for html hyperlink code that will cause a file to download to the phone and not have the browser try to open it? I have files that are text, they are GPS files, but they don't have a TXT extension and IE keeps opening the files as text.
If it matters (but I don't think so) I'm running a reasonably stock HTC WM 6.0 ROM on a Hermes.
Regards,
GPSGary
You want to do this server-side? Or client-side?
FTP download code
I'm trying to write html code that will cause a file on my web site to download directly to the phone file directory without the browser trying to open it. It would be extra useful if I could make it download to a specific existing directory.
Regards,
GPSGary
Well, I hate to say this but you can't. That's the simple answer.
The complicated answer is that you need to set up some sort of server-side script to place the headers manually, or you need to modify some of the settings for your server's remote access handler. On Apache servers, this can be done via a file called .htaccess.
If you have a .htaccess file that you can modify, just enter this at the top of it:
Code:
RewriteEngine on
RewriteCond %{REQUEST_URI} \.(gps|cab)$
RewriteRule .* - [T=application/octet-stream,L]
Note that I didn't know the extension you're talking about so I put "gps" up there. I also added "cab" because many servers have a tendency to not send the proper headers for cab files. Feel free to add other extensions using this same method.
Again, this is assuming you have an Apache server, and you have the privileges to modify a .htaccess file.
Forcing ftp type download
No Apache server so isn't there some other way?
Anyone got a good Java script?
Regards,
GPSGary
Hi there,
as far as I know, you don't need java:
ftp-links are always proposed to "Save File", so your link should be ftp://www.domain.com/folder/filename.txt
This will cause any browser to download the file instead of opening it.
In that case, you definitely need an real ftp access to your file ... (ftp = FIleTransferProtocol).
Best regards,
I've encountered this before and resorted to zipping the file. You can also spoof the system by renaming the file to *.AAA The user, of course, will have to rename the file on their end. I have better luck with .zip unless it's for my own use. Any file which is recognized natively by the browser will open within the browser. This includes .txt, .htm, .html, and any other file associations you've successfully loaded.
gepp said:
No Apache server so isn't there some other way?
Anyone got a good Java script?
Regards,
GPSGary
Click to expand...
Click to collapse
That's what I'm tellin' ya. It's IMPOSSIBLE to do this with client-side scripting, i.e., Javascript.
I'd like to help you get this resolved. Can you clarify some things for me?
Are you using Geocities, Fortunecity, Google Pages, or one of the other free site services out there?
Do you understand the distinction I'm making between client-side and server-side scripting?
What server software are you using, if not Apache?
Are you able to utilize a PHP or Perl engine? (I can tell you how to send the file headers manually through either of those.)
I promise I'm not trying to be rude or anything. I just want to make sure we're both on the same page here. I can tell you the best way of getting this resolved, but I need to know where you stand, and I need to know the extent of your web development knowledge.
PHP or Perl will work
I'm on a Yahoo small business server. I've used PHP so that will work on my site and I know enough to fiddle with it if need be. Less proficient with Perl but have some exposure.
Regards,
GPSGary
Awesome. That works. Here is what you will basically be doing with PHP then.
PHP:
ob_start()
$GPSFile = '/path/to/file.gps'; //This is where the file is located on your Yahoo Business server
$DownloadName = "File.gps"; //This is the name that pops up when you're prompted to download the file (it can be different than the name above).
$TypeOfFile = 'text/plain'; //If you still have issues, change this to 'application/octet-stream'
header("Cache-Control: public, must-revalidate");
header("Pragma: hack");
header("Content-Type: " . $TypeOfFile);
header("Content-Length: " .(string)(filesize($GPSFile)) );
header('Content-Disposition: attachment; filename=' . $DownloadName);
header("Content-Transfer-Encoding: binary\n");
od_end_clean();
readfile($GPSFile);

SQL CE 3.5 - First App

I'm working on developing my first WM 6 App using SQL CE 3.5 . I'm sure there are other apps out there that do what mine does, but I'm just wanting the experience of developing it.
I'm working on a fairly simple app to track gas mileage and such. But, for some reason, whenever I debug it, the app can't seem to find the database file. I get an error saying: "The database file cannot be found. Check the path to the database. [ Data Source = .\GasTrackerDB.sdf ]"
I can browse with file explorer on the device and find the database in the same directory as the deployed application, so I'm not really sure where to go from here..
I'm doing everything through the IDE, so all of the code is generated for me to connect to the database.
Anybody experienced enough to help me troubleshoot this stupid problem?
i have been looking for an app that does the same thing as the one you are working on.
when it is finished please pm me. i wish i knew more programing, if i did i would help you.
Try
Code:
string database = string.Format(@"{0}\GasTrackerDB.sdf", GetApplicationPath());
public static string GetApplicationPath()
{
string path = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase);
return path;
}
I did figure it out after messing around with it. I think it has to do with the way VS2008 deploys the app on the emulator...
When I hard-code the path to the database file, it works. So, my app will just have to be installed on the local device and not the SD card
Don't hard-code the path! The method GetApplicationPath() returns the application path. This is also important when installing on OS with different language.
heliosdev said:
Don't hard-code the path! The method GetApplicationPath() returns the application path. This is also important when installing on OS with different language.
Click to expand...
Click to collapse
How is that possible when the Connection String was generated by the IDE? Here's what the .xsd says:
Code:
<Connection ConnectionStringObject="Data Source=\program files\gastracker\GasTrackerDB.sdf" IsAppSettingsProperty="false" Modifier="Assembly" Name="GasTrackerDBConnectionString" ParameterPrefix="@" Provider="Microsoft.SqlServerCe.Client.3.5" />
On application start create the connection string "Data Source = " + database (like post #3)
This connection string can then be passed wherever you need to connect to the database.
That's the problem.. the IDE created all the stuff for the connection string and I don't know enough about it to create everything needed manually.
How do you connect to the db? What are you calling for retrieving data from db? How do you insert data to the db? All these actions need an object which somehow knows the connectionstring. And this string can/must be changed.
Hmm.. That doesn't seem to be a valid function name. I'm using .NET CF 3.5 .I'll keep looking.
Well, I wrote my own function to get the execution path, but I still can't figure out how to modify the connection string at runtime.
This crap is ridiculous. I don't understand why it doesn't "just work" when I let the IDE do everything...
Well, I FINALLY made it work.. i ended up going through the xsd file and changing all the code that creates queries. I had to replace every instance of:
Code:
CType(Me._commandCollection(0), Global.System.Data.SqlServerCe.SqlCeCommand).Connection = New Global.System.Data.SqlServerCe.SqlCeConnection("Data Source=.\GasTrackerDB.sdf;")
With:
Code:
CType(Me._commandCollection(0), Global.System.Data.SqlServerCe.SqlCeCommand).Connection = New Global.System.Data.SqlServerCe.SqlCeConnection("Data Source=" & GetAppPath() & "\GasTrackerDB.sdf;")
That had to be done for every one of my queries created through the designer. Thankfully I only had 5!
Great! Keep in mind that changes in generated code can get lost when the ide is recreating the code. Just keep an eye on it when doing changes in this area!
heliosdev said:
Great! Keep in mind that changes in generated code can get lost when the ide is recreating the code. Just keep an eye on it when doing changes in this area!
Click to expand...
Click to collapse
Yeah, I already ran into that one If it gets to be too much of a pain, I'll see if I can create some sort of compile time script to do a find and replace.. But I haven't spent enough time going back and fixing it yet
go to
http://www.connectionstrings.com/
They have everything you need to build your connection string. From my experience, it's okay to let the IDE build everything EXCEPT the connection string....

WiFi and 3g simultaneously Guide - need help following instructions

Hi,
I currently try to follow these instructions...
http://mobisocial.stanford.edu/news...together-by-hacking-connectivityservice-java/
Very hard for me. Don't know what to do.
The goal of COIN project is to use WiFi and 3G connections simultaneously. So it conflicts with the policy of Connectivity Service, but there is no configuration to edit the policy, and it is hard coded. You can find the clue in ConnectivityService.java:handleConnect function.
Our current solution is quite brutal, which is to mask the eyes of Connectivity Service by modifying its message handler entry like the following:
// must be stateless – things change under us.
private class MyHandler extends Handler {
@Override
public void handleMessage(Message msg) {
NetworkInfo info;
//added by COIN to disable Connectivity Service
int networkState = 8; //not any following state
/*use static google dns server for wifi and 3g*/
if (msg.what == NetworkStateTracker.EVENT_STATE_CHANGED) {
SystemProperties.set(“net.dns1″, “8.8.8.8″);
SystemProperties.set(“net.dns2″, “8.8.4.4″);
bumpDns();
}
//////////////////////////////////////////////
//switch (msg.what) {
switch (networkState) {
case NetworkStateTracker.EVENT_STATE_CHANGED:
info = (NetworkInfo) msg.obj;
int type = info.getType();
…..
And then compile the modified ConnectivityService.java in the android source code tree, you can get an new services.jar file in framework directory. Replace the existing services.jar on the cell phone with the following adb commands, then reboot the phone
adb shell “mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system”
adb shell “chmod 0777 /system/framework”
adb push services.jar /system/framework
adb shell “chmod 0644 /system/framework/services.jar”
adb shell “chmod 0755 /system/framework”
Click to expand...
Click to collapse
Does he mean I have to compile the whole Android source code again?
So I would need to learn first, how to compile Android, then change this file, compile Android, copy file?
Instant of adb shell, could I also use root explorer?
How device dependant is this? Or how android version dependant?
Could someone offer the compiled file?
No answer yet.
I believe so. This is actually what compelled me to go learn to compile android by myself-- the constant switching between 3g and wifi in a semi-strong wifi zone sucks. For now I am starting with CM7 since it is so popular.
Yes you would need to compile the whole OS and it will only work on an AOSP rom. It will also be very version dependent.
Please let me know if it worked ! I probably don't think it will. Read this on the page:
Pallas Says:
April 13, 2012 at 5:58 am
are you sure the packets are going thru both interfaces?
I think it doesn’t work, simply because you would need two default gateways, leading to some hard problems:
- how does the system choose where to send the packets?
- for outgoing packets: unless the two connections have both statically assigned public IP addresses, which is very unlikely, you will end up with two differently NATed paths, and the client will refuse packets coming from two different ip addresses on the same connection.
- for incoming packets: to let the client send packets to both interfaces, you would need to send them from both interfaces with different source ip addresses: it will not work, the client will get confused. and anyway you would need support at the application level.
to solve all this, you’d need to:
- make an ad-hoc application which understands all this and can send chuncks to both interfaces, then merge all the returning chunks. you’d need support at the application level: for example you’d need http byte range support on both client and server
- divide “equally” the single specific connections thru the two gateways. this may work but it’s pretty hard if you do not have access to advanced routing and traffic shaping at the kernel level. may be possible on a phone with custom compiled aosp rom and modified kernel
gouthamsn said:
Please let me know if it worked ! I probably don't think it will. Read this on the page:
Pallas Says:
April 13, 2012 at 5:58 am
are you sure the packets are going thru both interfaces?
I think it doesn’t work, simply because you would need two default gateways, leading to some hard problems:
- how does the system choose where to send the packets?
- for outgoing packets: unless the two connections have both statically assigned public IP addresses, which is very unlikely, you will end up with two differently NATed paths, and the client will refuse packets coming from two different ip addresses on the same connection.
- for incoming packets: to let the client send packets to both interfaces, you would need to send them from both interfaces with different source ip addresses: it will not work, the client will get confused. and anyway you would need support at the application level.
to solve all this, you’d need to:
- make an ad-hoc application which understands all this and can send chuncks to both interfaces, then merge all the returning chunks. you’d need support at the application level: for example you’d need http byte range support on both client and server
- divide “equally” the single specific connections thru the two gateways. this may work but it’s pretty hard if you do not have access to advanced routing and traffic shaping at the kernel level. may be possible on a phone with custom compiled aosp rom and modified kernel
Click to expand...
Click to collapse
(Probably for your Interest
This project works on a MultiPath-TCP Implementation (follow link to mptcp.info.ucl.ac.be). The hard times you get is compiling the Kernel with the additional files. This Protocol can only work effectively for download Purposes if the Server also has a MPTCP Kernel running. But on the other Hand you can shut down a single connection without loosing the active Connection (Downloads are not interrupted and improved Bandwidth Capacity if your Server is MPTCP-Ready)
Until now this Protocol is only working for Homeservers or similar Projects, where you have full access to the Server and the working Kernel of the system.
I am currently working on implementation of the Protocol for my Bachelor Thesis. I already compiled a working Kernel (Glados Nexus S) and now i'm working on keeping both Interfaces active. I hope this Tut can help me...
Has anybody tried other approaches to this topic? I tried manually loading the wifi-module and configuring it, but i only managed to ping via one Interface.
You managed to make it work?
bagers said:
No answer yet.
Click to expand...
Click to collapse
You managed to make it work? i want to make it also for my master thesis

[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 hard code a url and port number into existing android application APKTOOL

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???

Categories

Resources