[DEV RESOURCES][AMDL] P-ROM, Dump, Tools, Resources & Tips [5/18]

Nottach

Senior Member
Mar 20, 2008
1,587
3,934
0
New York
I have gathered pretty much all the things useful in modding our system.

I ask other developers to post their findings here also.
My aim is to allow people to learn how make their own edits and mods.

Happy modding,
As of now our only option for recovery from a screw up is flashing the stock image via Odin, so be careful.

Developer Tools:
AIO Tool Pack - The main tools I used in creating this deodexed package (Includes the following)
APK Manager with the compatible ApkTool and AAPT (Took me a while to find compatible versions of both due to strange qualifiers in resource APKs)
Dex2Jar with JD-Gui (Useful for checking out JavaCode in order to apply to ByteCode) (If you've got an extra Kilo-Dollar to spare check out Jeb)
Baksmali/Smali Manager for editting jar files
Odin 3.07 for flashing stock firmwares (available in dev thread)
Psuedo-ROM
Deodexed System Installer With Listed Mods
(Mirror) (MD5:108a5553c6ae82af9b0a3319ceffc8b8)
All Responsibility Are Belongs To You
Entire deodexed system with some mods already installed. Based on the AMDL ota update.
You must be rooted and updated to build number I337UCUAMDL.
I recommend a factory reset, fresh wipe via Odin, updating ota, rooting, then installing this package.
After installing it is recommended that you freeze the OTA apps in order to block OTA updates.
- LocalFOTA, AT&T Software Update, FWUpgrade

- Mod list:
5/18/13 -
Removed struck-out items from 5/8/13 change log for NottachXposed compatiblity
Integrated debloater into installer
Added extended power menu (scrosler)
Added init.d support (scrosler)
-Added zipAlign init.d script
Added 1% battery support for SystemUI
5/9/13 -
Tethering enabled via framework-res.apk, includes Bluetooth tethering (romracer)
Removed WiFi connected notification via SecSettings.apk
Enabled accessibility widgets via SecSettings.apk
Removed carrier label in status bar via SystemUI.apk
Removed full battery notification via SystemUI.apk
Removed loud volume warning via framework.jar
Option to unlock all AT&T APNs (In installer)
Unhid broadband APNs
Enabled scrolling wallpaper
Removed launcher help text
Removed multi-window help button
Removed boot sound
Redeodexed entire AMDL update
Fixed APKs for de/recompiling
More...
-Installation:
Copy "copy_to_sdcard" folder to internal sdcard
With USB debugging enabled run the Windows BAT file in the package.
Answer questions.
Profit...
Extra Downloads:
Debloater bat file - Removes AT&T, Google, and Samsung bloat (Open in any text editor to inspect/edit the files that will be removed)
I337UCUAMDL_RAW_SYSTEM_DUMP - The base from which this deodexed installer is created from
 

Attachments

Last edited:

Nottach

Senior Member
Mar 20, 2008
1,587
3,934
0
New York
Framework installation using ApkTool

In order to use Apk_Manager on System APKs you will first need to install the System Frameworks to your ApkTool.

Assuming you have downloaded both zips from the first post unzip the tools folder to a location of your choosing.

Next, extract the frameworks zip to your newly created Apk_Manager folder and place them in the 'other' folder so they are in scope of apktool.jar, also in the 'other' folder.
Now, with no files selected in the 'other' folder, Shift+RightClick an empty area of the folder and choose "Open command window here".

Do:
Code:
apktool if framework-res.apk
&&
Code:
apktool if twframework-res.apk
The frameworks should be installed as 1.apk and 2.apk respectively. Confirm by navigating to C:/Users/<YOU>/apktool/framework.

Example output:


You should see 1.apk and 2.apk, they will be a different file size of the res APK, this is because they only contain info pertaining to APKs that may utilize their resources.

Now you have your frameworks installed correctly and can continue using Apk-Manager to Mod your other, deodexed, APKs, such as SystemUI.apk.

I hope this will be helpful to some, if there are any additional steps I can add to make it clearer please let me know.
 
Last edited:

Nottach

Senior Member
Mar 20, 2008
1,587
3,934
0
New York
Reading source using Dex2Jar

Dex2Jar is a useful tool for generating Java source from APK/JAR dex files.

In order to use Dex2Jar first open your APK/JAR with WinRar or similar and extract the dex file to the Dex2Jar root directory.

Next drag-n-drop the dex file onto dex2jar.bat. This will create a jar archive in the same directory.
Next drag-n-drop that newly created jar onto jd-gui.exe.

This will open a tree view of the Java source.

Note that it is not always possible for Dex2Jar to reconstruct the source code and some classes may have errors.
Also, structure of the source may be in somewhat ByteCode format, still having gotos and labels...

For more information on Dalvik opcodes see here.
Another tool useful in reconstructing Java code is Virtuous Ten Studio.
 
Last edited:

Nottach

Senior Member
Mar 20, 2008
1,587
3,934
0
New York
Did you know?

A few additional places to look at are...

Enable "Find My Mobile" in Settings -
system/csc/feature.xml { CscFeature_Setting_DisableMenuFindMyMobile="false", CscFeature_Setting_FindMyMobile="true" }
Unhide 'broadband' APNs in Network Settings -
system/csc/feature.xml { CscFeature_Setting_HideApnList="" }
Enable APN edits -
SQL Editor - data/data/com.android.providers.telephony/databases/nwk_info.db_carriers - Δ editable to '1'
 
Last edited:

captawsm

Member
Mar 29, 2007
14
4
0
A few additional places to look at are...
That tip about enabling Find My Mobile is quite nice. After changing that, the option does show up in Settings -> More Tab -> Security; however it doesn't appear to work correctly. :( The phone never shows up as registered on my Samsung Account. I even tried creating a new Samsung account to test with and by enabling remote control when over wifi and cell data.
 

Nottach

Senior Member
Mar 20, 2008
1,587
3,934
0
New York
That tip about enabling Find My Mobile is quite nice. After changing that, the option does show up in Settings -> More Tab -> Security; however it doesn't appear to work correctly. :( The phone never shows up as registered on my Samsung Account. I even tried creating a new Samsung account to test with and by enabling remote control when over wifi and cell data.
Hmm, just checked it out and it seems they haven't added the S4 to the list of devices? Maybe in the future they will. :rolleyes:
 

captawsm

Member
Mar 29, 2007
14
4
0
I saw that the S III shows up in the list of devices on the Samsung Dive website. I still have my "stock" rooted S III so I might check to see if this trick works on there and if it will register on the site. I can post results if anyone is interested which may let us know if we just need to wait till the S4 shows up on the site.

Edit: if anyone wanted to know: Tried on a stock rooted AT&T S3 w/ 4.1.1 and ran into same issue - I can enable remote controls but device never registers on the samsungdive.com website so maybe there is something more to getting Find My Phone working that just editing features.xml

If someone else tries this, I'd be interested in hearing if you run into the same problem.
 
Last edited:
  • Like
Reactions: Nottach

Nottach

Senior Member
Mar 20, 2008
1,587
3,934
0
New York
So I'm trying to disable the Media Volume Alert by modifying android\media\AudioManager of framework.jar, as shown below, and I'm unable to get the device to fully boot after replacing the original file. It just hangs on the AT&T logo. I can get ADB so I can replace the original and then it boots.

Does my mod look like it should break it? All I did was change the level at which the dialog appears to 16 (0x10) instead of 10 (0xa). I would think that would be OK. I don't get any error recompiling either. I've tried wiping dalvik-cache between replacements, no luck. I've also tried returning false at the beginning of the 'isEarProtectLimitOn' method, no luck. I'm stuck, any ideas?

line 483
Code:
# direct methods
.method static constructor <clinit>()V
    .registers 1

    .prologue
    .line 60
    const-string v0, "AudioManager"

    sput-object v0, Landroid/media/AudioManager;->TAG:Ljava/lang/String;

    .line 269
    const/16 v0, 0xd

    new-array v0, v0, [I

    fill-array-data v0, :array_16

    sput-object v0, Landroid/media/AudioManager;->DEFAULT_STREAM_VOLUME:[I

    .line 2971
    const/16 v0, 0x10

    sput v0, Landroid/media/AudioManager;->EAR_PROTECT_LIMIT_INDEX_DISABLE:I

    .line 2972
[COLOR="Red"]--    const/16 v0, 0xa[/COLOR]
[COLOR="Green"]++    const/16 v0, 0x11[/COLOR]

    sput v0, Landroid/media/AudioManager;->EAR_PROTECT_LIMIT_INDEX_NORMAL:I
EDIT: This is the correct edit to disable the Loud Volume Notification. I guess my tools were out of date. After updating baksmali it worked.

Basically instead of at level 10 it triggers only at the max volume, which I think is triggered someplace else. I'll keep looking for the root.

EDIT2: In addition to the above edit the 'EAR_PROTECT_DEFAULT_INDEX' needs to be changed so it doesn't trigger at Max Volume.
Same file, line 109:
Code:
.field public static final EAR_PROTECT_DEFAULT_INDEX:I = [COLOR="Red"]0x11[/COLOR]
No moar Loudness warnings!!
 
Last edited:
  • Like
Reactions: wdkingery

CPA Poke

Senior Member
Oct 23, 2012
1,515
3,334
0
Tulsa, OK
A few additional places to look at are...
Thanks for this!

This was my first time editing SQL db's, so I didn't want to do anything I wasn't sure about. After making the APN's editable, the APN protocol is still grayed out. Is there a way to change the default value of the APN protocol itself (specifically to "iPv4/iPv6") within the database?
 

howtomen

Senior Member
Jan 10, 2011
2,004
1,207
0
Brea CA
Hey man i see ur postinf mods. I removed the ongoing wifi on s3 and same exact method works on s4 but needs to be using a deodex system which i will push this weekend however i can get u a guide if u wanna try?

sgh-i747(d2att)(sgs3) on latest cm10.1 or ultimatum
 

Nottach

Senior Member
Mar 20, 2008
1,587
3,934
0
New York
Hey man i see ur postinf mods. I removed the ongoing wifi on s3 and same exact method works on s4 but needs to be using a deodex system which i will push this weekend however i can get u a guide if u wanna try?

sgh-i747(d2att)(sgs3) on latest cm10.1 or ultimatum
You mean the WiFi Connected notification?
I found this method. Is yours different?
Mine seems to work well but I'm curious as to what you found too.
 

Nottach

Senior Member
Mar 20, 2008
1,587
3,934
0
New York
  • Like
Reactions: howtomen

howtomen

Senior Member
Jan 10, 2011
2,004
1,207
0
Brea CA
I see, I think my method never calls the NotificationManager because it returns doNotShowNotification while yours still creates the notification but never calls show() on it. which may lead to memory leaks. I think mines cleaner?
i see makes good sense thanks for the work :D
 

jcase

Retired Forum Moderator / Senior Recognized Develo
Feb 20, 2010
6,331
15,767
0
Sequim WA
Why not linking directly to the tools? dex2jar and smali are udpated often, and the current APKTool fails to properly decode some resources in stock firmware of this device.

I have gathered pretty much all the things useful in modding our system.

I ask other developers to post their findings here also.
My aim is to allow people to learn how make their own edits and mods.

Let's fill this Thread with detailed how-tos instead of this Section with crappy themed ROMs.

Happy modding,
As of now our only option for recovery from a screw up is flashing the stock image via Odin, so be careful.

Downloads:
Tool Pack
APK Manager with the newest ApkTool and AAPT (Took me a while to find compatible versions of both due to strange qualifiers in resource APKs)
Dex2Jar with JD-Gui (Useful for checking out JavaCode in order to apply to ByteCode)
Baksmali/Samli Manager for editting jar files
Odin 3.07 for flashing stock firmwares (available in dev thread)

Frameworks Only
Framework files for ApkTool installation (Ready for installation to ApkTool)

Entire Deodexed System With Listed Mods
Entire deodexed system with some mods already installed for a common developer base.
Installable if you know how. Based off romracers deodexing.
- Mod list:



Instruction:
Framework installation using ApkTool
Modding using Apk Manager
Reading source using Dex2Jar

Tips & How-Tos:
http://forum.xda-developers.com/showpost.php?p=40914188&postcount=5
 

geoldr

Senior Member
Feb 4, 2012
902
118
0
SF Bay Area
@howtomen You have experience making all apps multi-window? I was abe to get the all to show in the drawer but their indexes are messed up and the wrong app gets added when dragging.

I think I have to fix or create the adapter?
Very excited to see this happen. Really miss this from my hacked S3.

Sent from my SAMSUNG-SGH-I337 using xda app-developers app
 

akira02rex

Senior Member
Nov 7, 2010
1,564
348
0
That download speed from devhost is PAINFUL! I'm working on porting over cm10.1's MMS.apk for our device once this is finished. I may try to find a you better mirror man lol.