[TUT] Debugging apps Via VS 2013 and Visual GDB - Android Q&A, Help & Troubleshooting

Maybe there is some clever people that wants to debugg with the VS debugger.
Here is an small guide debugging the psx app
Normally i use Ida Pro but this works also.
Download visual studio 2013
then visual gdb http://visualgdb.com/download/
Download Strongname helper https://anonfiles.com/file/0d112810bd62abe748957ae142402211
Download app
1) fire up StrongNameHelper4ANDROID
Drag apk into right posision
{
"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"
}
press decompile
2) If we rebuild it the gdb debugger wont debugg since the apk have no debugg flags we have to set that before rebuilding it.
open the decompiled folder an locate the manifest.xml
edit manifest.xml and put in the debug flag
Code:
<application android:debuggable="true" /application>
like this.
Code:
<application android:theme="@style/AppTheme" android:label="@string/app_name" android:icon="@drawable/drawable_launcher" android:name=".CustomApplication" [COLOR=#ff0000]android:debuggable="true"[/COLOR] android:allowBackup="true" android:largeHeap="true">
<activity android:name=".activity.DebugMainActivity" android:exported="true" android:screenOrientation="portrait" />
3) we have to put gdbserver in the app also.
ill upload it here.
put it in the decompile app.
com.scee.psxandroid\build\apk\lib\armeabi\gdbserver
com.scee.psxandroid\build\apk\lib\mips\gdbserver
com.scee.psxandroid\build\apk\lib\x86\gdbserver
com.scee.psxandroid\build\apk\lib\armeabi-v7a\gdbserver
3) back to the StrongNameHelper4ANDROID
Press sign
The tool creates an com.scee.psxandroid-crk.apk
Now this is important !!!
Drag the crk-apk into the StrongNameHelper4ANDROID
Then press sign for debug.tool creates com.scee.psxandroid-crkSigned.apk
Not sure why but it only gets signed correctly this way.
ill upload my debugg ready with gdbserver APK here also.
4) Fire up visual studio 2013
Remember to install visual gdb first.
WE now have a new tool
5)press debugg an custom APK file
It will ask you to install some tools the debugger need but when your done it would look like this
Set the shared library to the decompile folder \lib
6)
Now we can choose wich part we want to start debugg.
I find CompanionUtilConnectingActivity interesting so we try this, i see there is also Second screen
7) press debug and wait for an minut
It woul be here we would get alot off errors about the manifest.xml and gdbserver but we fixed that.
8)
Connected
Hit the Break (pause)
Now you can set break points and wait to it hits or step 9
9) Use the phone here
connect to console with the app when it does hit break, then set the break point where it connect to console.
then run them to courser.
ITs pretty extended and you can get a ton off info from the debugger
Regards
app_with_debug_manifest_and_gdbserver.rar
https://anonfiles.com/file/05aac478549663ab46ae0b92d305de75

LOL i noticed after i made the thread it was suppose to go here >>> Android Software and Hacking General [Developers Only] :fingers-crossed:

Working Very nicely

Related

[TUTORIAL] How to Decompile and Recompile ICS .Apk Files][Easy ONE]

This is an Easy Tutorial, How to Decompile .apk and Recompile .apk Files​If u like this Tutorial, Hit THANKS Button​CREDITS
Memnoc - For Gud Ideas.
Xavierjohn22 - the amazing author of AutoApktool go Here, Hit thanks to Him Too.
Sandy7-For Motivation.
Requirements
Java (last version)
JDK (last version)
JDR (last version, usually included in JDK or Java)
Auto_Apktool 2.0.0 (DOWNLOAD THIS ONE NOT OTHERS)
HOW TO DO
NOTE: before start, select Apktool version with option 21, YOU MUST CHOOSE 1.4.1 version
1) Download and simply unpack Auto_ApkTool
2)Click on "autoapktoolmain.bat", prompt will open
{
"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"
}
3)put the apk you want to EDIT, in "_INPUT_APK"
4) Nw u Should Choose "option 6" for 'decompiling .apk
5) when option 6 is being selected, drag the apk from _INPUT_APK folder into the windows prompt and click enter
6) A Note window will appear, and will show IF the decompiling process has been done properly. Once you close that window, you will see the decompiled folder in _INPUT_APK folder
7) do your edits (xml, smali, or png, WHATEVER)
8) recompile with option 7 (NOTE: this time you MUST drag all the FOLDER, NOT the apk)
9) Once recompiling finished, u will Get a Dcompiled NOTE window that Shows your apk is sucessfully Compiled, Close that Window, Once open the decompiled folder, go to "dist" folder, and here you got your edited apk
10) NOW this is the Last step, since u cannot Sign System app, u will have to Copy the META-INF foldrer frm the Orginal apk to the edited apk, for more Info See the "Screen"
11) Rename the apk if Needed, and push it.
Reserved for tutorial on editing, decompiling/recompiling .jar files :thumbup:
For video tutorial!:thumbup:
FAQ's​Why can't we use Apktool???
Well, you can, but it's more difficult, that's it.
Why do you say "must use 1.4.1 apktool version"??
The reason why is that since 1.4.2 version, apktool generate java code while recompiling process is going on, and this lead to errors that 9/10 makes decompile process fail

Android Wear apps to work with Android Read with APK Easy Tool

I guess a lot are aware of the thread http://roundandroidwatches.pr which shows how to port Android Wear apps to Android in order to run them on the Amazfit pace watch. The above mentioned threads describes the principle solution on a mobile with the help of an App "APK Editor" which works only with the paid version.
Therefore I was looking for a free and easy GUI controlled solution running on WIndows which serves the same issue which I found with "APK Easy Tool v.1.41".
1) you have to ensure that JDK and JAVA are refences by your Windows PATH variable and that they run on the same version. I am using java build 1.80.. and javac build 1.8.0....
2) You install APK Easy Tool v.1.41
after start-up you need to do the following setting for APK signing:
https://ibb.co/he7Gmb
{
"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"
}
3) Select the downloaded APK, decompile it and modify open the APK directory
https://ibb.co/hdXcsG
4) Open the "Decompiled APK directory", step on the first level of app and open the *Manifest.xml file in a XML editor (e.g. Notepad++) and modify the data according to http://roundandroidwatches.pr
change min sdk version to, e.g.:
Code:
<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="24" />
change screen resolution to:
Code:
<application android:theme="@android:style/Theme.NoTitleBar.Fullscreen" ...
remove if available hardware line, e.g. :
Code:
<uses-feature android:name"android.hardware.type.watch" />
5) Click the Compile button the APP get assigned too
6) Transfer it to the watch. I used Apk Installer 3.5 on Windows to do do on a rounded up GUI solution (of course one can use ADB shell too)
PS: I have tried this with Invaders Android Wear APP and the entire process worked with any issues and the App is running perfectly on the watch.
i will give it a try later today
Here you can find some Wear Apps which have been already converted and can be used on Amazfit.
http://amazfitcentral.com/2017/08/31/free-apps-amazfit-pace/
In addition I ported a flashlight App too. It worked but the light is not very bright: https://www.apkmirror.com/apk/googl...elease/flashlight-7-1-1-android-apk-download/

Extract content from android backup

Hello everyone...
I find the phone with the non-working tuch ..
From the recoveri mode I managed to make a complete backup of the phone on sd and generated these 3 files:
userdata_20160101_000035.backup
userdata_20160101_000035.backup1
userdata_20160101_000035.backup2
is there a possibility to extract the content ???
I would be interested in contacts.
I state the phone is a Majestic
Thank you.
recovering contacts is not easy. you need SQLite Forensic Explorer to view the database file. the database is separated in many different tables, each table has a column "raw_contact_id" which contain always the unique id-no of contacts (one table contains phone nos, another table contains names, etc... you must query tables by id).
once you have extracted the backup, the file "contacts.db" is located "/data/data/com.android.providers.contacts/databases/"
from the backup I made, how do I extract the contacts.db file ??
remove the checksum(s) and merge the files. you need linux
don't be scared, i will explain you step by step. first step: do you have linux? if yes, press CTRL + ALT + T this is the terminal where you can do it. if no, please download unetbootin and prepare a bootable usb stick. you can run ubuntu on your pc without installing. don't hesitate to ask if you need help regarding unetbootin
scacco728 said:
finally I was able to understand something of the terminal in place ..
I move to the folder where the files are, I open the terminal I enter the commands and I generate this error .. why do you think ???
{
"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"
}
Click to expand...
Click to collapse
"dd" does not accept wildcards. press <TAB> instead of * for word completion. you must type the full file name. remove the stars in this example code.
edit: i will answer in this thread, because this are linux basics. so lets open a "beginner" thread here, and leave the other thread open for more advanced questions. finally, your goal is to extract contacts, what we should not discuss in main thread

How to fix app crashing when using the showFloatWindow API on Huawei devices running EMUI before version 9.1

A number of reports were received about crashes when the showFloatWindow API is called on devices running older versions of EMUI. Let's take a look at this crash today and how we can fix the issue.
Start by integrating version 6.1.0.301 of the Game Service SDK into a project and successfully implemented the floating window function.
Then, when testing the game on devices running a version of EMUI earlier than 9.1, the game crashed when showFloatWindow API is called. The crash logs are as follows.
{
"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"
}
The error logs suggested that the issue was caused by missing layout files during layout implementation. This error suggests that c_buoycircle_window_small.xml, c_buoycircle_hide_notice.xml, and c_buoycircle_hide_guide_dialog.xml layout files were not found in this project. However, they had been saved under the layout folder as displayed in the following figure.
The next possible issue could have been that the layout files were obfuscated. So, let's check the build file to be sure:
As you can see minifyEnabled was set to true, indicating that the obfuscation function was enabled. This was also the case for shrinkResources, which meant that resource files were excluded during package creation.
One option of course would be to simply disable the shrinking of resources. By commenting out this line the game would run fine and the API call wouldn’t crash, however, the resource files are no longer compressed and will take up much more space.
To compress the resources, you can create an XML file that contains the resources tag in the project or use the keep.xml file in the res/raw directory, and specify the resources to be reserved in the tools:keep attribute as follows:
XML:
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools"
tools:keep="@layout/c_buoycircle*" />
This solution allows the floating window function to work and is able to compress the resource files.
Note: If you have integrated the Game Service SDK, Huawei suggests that you add the following resources and configure the following obfuscation scripts.
@drawable/c_buoycircle*
@drawable/hms_game*
@Layout/c_buoycircle*
@Layout/hms_game*
@StRiNgS/hms_game*
@StRiNgS/c_buoycircle*
nice article

Development [STABLE] Windows All-In-One Tool Batch File

[BETA] Windows All-In-One Tool Batch File​
{
"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"
}
A good tool based on Windows batch commands. It has a few commands for now, (already 200 lines, but alright ...) but I will keep updating it and make a good release. It works for now, but not everything is correctly yet.
Download​Source #1: GitHub
How to use​Opening program​All tools/options​1. DISM and SFC Repair - Use this option if you want to check your computer of corrupted Windows files, and recover them if needed.
2. Create Restore Point - Creates a restore point with the name 'Restore Point'. (I might update the name in the future to use something like the date, need to look into that...)
3. Windows IP Configuration - Checks the network settings and show information about the network adapters using the IPCONFIG command.
4. User List - Shows a list of all users that exist on the PC.
5. Check Windows Version - Opens WINVER.exe, from where you can check information about the version of Windows.
6. Ping Tool - Allows you to ping a website.
NOTE: don't add ping before the command! So 'ping -t google.com' becomes '-t google.com' here.
7. N/A yet.
8. Open Terminal - Allows you to open a Windows Command Prompt. (Still need to fix something there).
9. Credits - Shows all the credits for the program (Currently me and Microsoft. Microsoft for developing the possibility to make those easily-to-develop programs)
10. Tool Information - Shows information about the batch file/tool.
11. Exit - Closes the tool.

Categories

Resources