I became interested in editing stock apps and removing the "low battery" warning after reading this very helpful post by midnjerry.
However, I ran into a problem which I cannot figure out.
I've downloaded from my Samsung Galaxy S i9000:
- camera.apk
- camera.odex
- framework folder
Using baksmali v1.2.6, I typed in this command:
java -jar baksmali-1.2.6.jar -d framework -x Camera.odex -c seccamera.jar
Unfortunately, I got this error message which is baffling because I would of thought the java Object class would be included in the framework somewhere.
Error occured while loading boot class path files. Aborting.
org.jf.dexlib.Code.Analysis.ClassPath$ClassNotFoundException: Could not find superclass Ljava/lang/Object;
at org.jf.dexlib.Code.Analysis.ClassPath$ClassDef.loadSuperclass(ClassPa
th.java:784)
at org.jf.dexlib.Code.Analysis.ClassPath$ClassDef.<init>(ClassPath.java:
668)
at org.jf.dexlib.Code.Analysis.ClassPath.loadClassDef(ClassPath.java:280
)
at org.jf.dexlib.Code.Analysis.ClassPath.initClassPath(ClassPath.java:16
3)
at org.jf.dexlib.Code.Analysis.ClassPath.InitializeClassPath(ClassPath.j
ava:131)
at org.jf.baksmali.baksmali.disassembleDexFile(baksmali.java:105)
at org.jf.baksmali.main.main(main.java:278)
Error while loading class Lcom/sec/android/seccamera/SecCamera$1; from file framework\seccamera.zip
Error while loading ClassPath class Lcom/sec/android/seccamera/SecCamera$1;
Any help on this issue would be much appreciated.
Hoping to contribute a few edited stock apk's to XDA with the battery warning removed.
Thanks!
koonkii said:
I became interested in editing stock apps and removing the "low battery" warning after reading this very helpful post by midnjerry.
However, I ran into a problem which I cannot figure out.
I've downloaded from my Samsung Galaxy S i9000:- camera.apk
- camera.odex
- framework folderUsing baksmali v1.2.6, I typed in this command:java -jar baksmali-1.2.6.jar -d framework -x Camera.odex -c seccamera.jarUnfortunately, I got this error message which is baffling because I would of thought the java Object class would be included in the framework somewhere.Error occured while loading boot class path files. Aborting.
org.jf.dexlib.Code.Analysis.ClassPath$ClassNotFoundException: Could not find superclass Ljava/lang/Object;
at org.jf.dexlib.Code.Analysis.ClassPath$ClassDef.loadSuperclass(ClassPa
th.java:784)
at org.jf.dexlib.Code.Analysis.ClassPath$ClassDef.<init>(ClassPath.java:
668)
at org.jf.dexlib.Code.Analysis.ClassPath.loadClassDef(ClassPath.java:280
)
at org.jf.dexlib.Code.Analysis.ClassPath.initClassPath(ClassPath.java:16
3)
at org.jf.dexlib.Code.Analysis.ClassPath.InitializeClassPath(ClassPath.j
ava:131)
at org.jf.baksmali.baksmali.disassembleDexFile(baksmali.java:105)
at org.jf.baksmali.main.main(main.java:278)
Error while loading class Lcom/sec/android/seccamera/SecCamera$1; from file framework\seccamera.zip
Error while loading ClassPath class Lcom/sec/android/seccamera/SecCamera$1;Any help on this issue would be much appreciated.
Hoping to contribute a few edited stock apk's to XDA with the battery warning removed.
Thanks!
Click to expand...
Click to collapse
Code:
java -jar baksmali-1.2.6.jar -d framework -c core.jar:framework.jar:ext.jar:seccamera.jar -x Camera.odex
Thanks theleils!
Now I'm getting another error, and a lot of them.
Error occured while disassembling class Lcom.sec.android.app.camera.widget.TwTickerView; - skipping class
java.lang.ClassCastException: org.jf.dexlib.Code.Analysis.AnalyzedInstruction cannot be cast to org.jf.dexlib.Code.OdexedInvokeVirtual
Click to expand...
Click to collapse
Managed to get past that problem by using 1.2.5 instead of the latest 1.2.6.
Deox'ed the classes, extracted files out from the APK and renamed it.
Repacked into a new APK and signed it.
Unfortunately, the app doesn't run properly and crashes straight away.
logcat?asdf
OK I'm unable to get a logcat for this because I can attach a debugger but it won't display the lines of code.
The program will freeze and come up with the "Force close" dialog.
Any tips?
Hi people i was wondering if anyone could help me, i want to use Quick Panel in UBKPD ROM, I pulled the apk from XXKPQ to /system/app but itsn't working, should I have to modify something in UBKPD to make it work?
Thanks and sorry for my bad english.
It's not enough, you have to mod /system/app/SystemUI.apk first and copy another apk. If you want there's a guide made by the creator of this mod: http://forum.xda-developers.com/showthread.php?t=1289896.
I followed the guide to port Quick Panel several times and always with the same result, boot loop at boot logo :'(
also tried to port extended power menu following this guide http://forum.xda-developers.com/showthread.php?t=1169443 and the result are the same, boot loop.
I dont kwnow what i am doing wrong, i follow the guides step by step. For compile/decompile apks i am using apktool in archlinux
Man if I uderstood corect you have need this:http://forum.xda-developers.com/showthread.php?t=633246 and
http://forum.xda-developers.com/showthread.php?t=1427959 and this:
http://forum.xda-developers.com/showthread.php?t=695701
The only problem I had when I modded SystemUI.apk was no statusbar, it always booted.
Bootloops usually happen when you mod framework-res.apk. That's because before you recompile it, you must select as compression level 0, otherwise you'll have bootloops.
If you want I can help you, just give me the files.
I think that I made some advances, because phone is booting now but still not working :'( i will explain:
Quick Panel:
I have status bar working after mod SystemUI.apk, but dont have the toogles.
SytemUI.apk and QuickPanelSettings.apk in /system/app, Permisions rw-,r--,r--
lidroid-res.apk in /system/framework, Permisions rw-,r--,r--
Done several times and allways the same result :'(
Extend Power Menu:
Phone now is booting after mod framework-res.apk
so i made the second phase mod android.policy.jar, compile and decompile is fine, after replace original the phone boot normal but when i long press the power button the phone hangs for a few seconds and then reboots, i make the process several thimes and always same result :'(
I want to learn that is why I am doing this over and over again. I compared the codes with the codes in XXKPQ.10lockscreen.14Toggle and are the same that I moded following the instructions in the previous post. Thanks in advice for the understandig and for the bad english
That's weird.
Try apkmanager instead of apktool (linux: http://apkmultitool.com/downloads/apk_manager_linux_5.0.zip). It's just a console script that makes your work easier. Read this guide that explains how to apply the "1% battery mod", you'll understand how to properly decompile and compile system apks (other than applying the "1% battery mod" ) with apkmanager.
Here what I usually do for android.policy.jar.
First of all you need baksmali.jar and smali.jar (download them from here: http://code.google.com/p/smali/downloads/list):
Exract classes.dex from android.policy.jar (jar = zip)
Decompile classes.dex running this command (of course you need to specify the correct path for baksmali.jar and classes.dex etc):
Code:
java -jar path/to/baksmali.jar -o classout/ classes.dex
Do all the changes to the files as explained in the guide
Recompile:
Code:
java -Xmx512M -jar smali.jar classout/ -o new-classes.dex
Replace classes.dex with new-classes.dex (rename new-classes.dex of course) inside android.policy.jar
I will read the guide for "1% battery mod" it would be usefull too for UBKPD , and also will try apkmanager about smali/baksmali I have allready installed maybe the way to compile was the error, cos i compiled like
Code:
java -jar smali.jar classes.dex
and then replaced in original android.policy.jar
So I tried to compile APKs but this is the error I get :
Code:
--------------------------------------------------------------------------
|Sat 06/02/2012 -- 15:11:27.61|
--------------------------------------------------------------------------
--2012-06-02 15:11:28-- http://update.apkmultitool.com/apkver.txt
Resolving update.apkmultitool.com (update.apkmultitool.com)... 199.59.62.20
Connecting to update.apkmultitool.com (update.apkmultitool.com)|199.59.62.20|:80
... connected.
HTTP request sent, awaiting response... 200 OK
Length: 152 [text/plain]
Saving to: `apkver.txt'
0K 100% 178K=0.001s
2012-06-02 15:11:29 (178 KB/s) - `apkver.txt' saved [152/152]
'java' is not recognized as an internal or external command,
operable program or batch file.
--------------------------------------------------------------------------
|Sat 06/02/2012 -- 15:21:33.26|
--------------------------------------------------------------------------
--2012-06-02 15:21:33-- http://update.apkmultitool.com/apkver.txt
Resolving update.apkmultitool.com (update.apkmultitool.com)... 199.59.62.20
Connecting to update.apkmultitool.com (update.apkmultitool.com)|199.59.62.20|:80
... connected.
HTTP request sent, awaiting response... 200 OK
Length: 152 [text/plain]
Saving to: `apkver.txt'
0K 100% 270K=0.001s
2012-06-02 15:21:34 (270 KB/s) - `apkver.txt' saved [152/152]
A subdirectory or file projects already exists.
A subdirectory or file place-apk-here-for-modding already exists.
A subdirectory or file place-ogg-here already exists.
A subdirectory or file place-apk-here-to-batch-optimize already exists.
A subdirectory or file place-apk-here-for-signing already exists.
'java' is not recognized as an internal or external command,
operable program or batch file.
--------------------------------------------------------------------------
|Sat 06/02/2012 -- 15:25:06.85|
--------------------------------------------------------------------------
--2012-06-02 15:25:06-- http://update.apkmultitool.com/apkver.txt
Resolving update.apkmultitool.com (update.apkmultitool.com)... 199.59.62.20
Connecting to update.apkmultitool.com (update.apkmultitool.com)|199.59.62.20|:80
... connected.
HTTP request sent, awaiting response... 200 OK
Length: 152 [text/plain]
Saving to: `apkver.txt'
0K 100% 341K=0s
2012-06-02 15:25:07 (341 KB/s) - `apkver.txt' saved [152/152]
A subdirectory or file projects already exists.
A subdirectory or file place-apk-here-for-modding already exists.
A subdirectory or file place-ogg-here already exists.
A subdirectory or file place-apk-here-to-batch-optimize already exists.
A subdirectory or file place-apk-here-for-signing already exists.
java version "1.8.0-ea"
Java(TM) SE Runtime Environment (build 1.8.0-ea-b40)
Java HotSpot(TM) Client VM (build 24.0-b11, mixed mode, sharing)
'""platform-tools"\adb.exe"' is not recognized as an internal or external comman
d,
operable program or batch file.
The system cannot find the path specified.
The system cannot find the path specified.
I: Baksmaling...
I: Loading resource table...
I: Loaded.
I: Loading resource table from file: C:\Users\Android\apktool\framework\1.apk
I: Loaded.
I: Decoding file-resources...
I: Decoding values*/* XMLs...
I: Done.
I: Copying assets and libs...
I: Checking whether sources has changed...
I: Smaling...
I: Checking whether resources has changed...
I: Building resources...
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutExce
ption: could not exec command: [aapt, p, -F, C:\Users\Nitish\AppData\Local\Temp\
APKTOOL2900661449421036432.tmp, -I, C:\Users\Nitish\apktool\framework\1.apk, -S,
C:\Program Files (x86)\Android SDK\projects\HoloLauncher_Beta6.apk\res, -M, C:\
Program Files (x86)\Android SDK\projects\HoloLauncher_Beta6.apk\AndroidManifest.
xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:193)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:302)
at brut.androlib.Androlib.buildResources(Androlib.java:249)
at brut.androlib.Androlib.build(Androlib.java:172)
at brut.androlib.Androlib.build(Androlib.java:155)
at brut.apktool.Main.cmdBuild(Main.java:182)
at brut.apktool.Main.main(Main.java:67)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\U
sers\Nitish\AppData\Local\Temp\APKTOOL2900661449421036432.tmp, -I, C:\Users\Niti
sh\apktool\framework\1.apk, -S, C:\Program Files (x86)\Android SDK\projects\Holo
Launcher_Beta6.apk\res, -M, C:\Program Files (x86)\Android SDK\projects\HoloLaun
cher_Beta6.apk\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:87)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:191)
... 6 more
Caused by: java.io.IOException: Cannot run program "aapt": CreateProcess error=2
, The system cannot find the file specified
at java.lang.ProcessBuilder.start(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at brut.util.OS.exec(OS.java:78)
... 7 more
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find th
e file specified
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
... 11 more
Press any key to continue . . .
I have Java Runtime Environment (JRE) 8 (64 - Bit) and Java Development Kit 8 (64 - Bit) installed and am still getting this error...
I have even tried it on previous versions of JRE and JDK, but still got the same error on them
I am using Windows 7 64 - Bit.
What should I do?
What all you modified in decompiled apk?
Burned from my laser torch using pencil cells
varun.chitre15 said:
What all you modified in decompiled apk?
Burned from my laser torch using pencil cells
Click to expand...
Click to collapse
Just to change one string in "/values/strings.xml"
Changed "All" to "Apps"....
That's all I did and tried to compile and got this error......
try apktool might work
as i cant see here any thing whats wrong
modding went good
but maybe the tool isnt updated or anything
CoolCatGetHome said:
try apktool might work
as i cant see here any thing whats wrong
modding went good
but maybe the tool isnt updated or anything
Click to expand...
Click to collapse
Thank you for your reply but I am using the latest version of APK MultiTool download from :
http://www.apkmultitool.com/?q=node/5
Could there be anything wrong apart from this?
Try APK tool 1.4.2 and also try APK Manager
I don't see anything which should object compiling
btw which app is this? Holo launcher?
I will try and let you know
varun.chitre15 said:
Try APK tool 1.4.2 and also try APK Manager
I don't see anything which should object compiling
btw which app is this? Holo launcher?
I will try and let you know
Click to expand...
Click to collapse
Yeah....
Its Holo Launcher....
A friend of mine is a big fan of it and wanted the "All" renamed to "Apps"....
I have tried APK Tool but not Manager....
I will try that and let you know....
I tried compiling with APKTool, APK Manager and APK MultiTool.
All give the same error.
I even decompiled the HoloLauncher APK and compiled it back without and modifications and its still giving the same error....
Any suggestions / solutions?
It looks to me, at a quick scan, that you don't have the aapt tool in your path.
It can't find aapt, at least, that much it says. The computer needs both apktool and aapt to recompile apks. I use linux, where putting both in usr/local/bin suffices.
post link to aapt.exe of android sdk.
mateorod said:
It looks to me, at a quick scan, that you don't have the aapt tool in your path.
It can't find aapt, at least, that much it says. The computer needs both apktool and aapt to recompile apks. I use linux, where putting both in usr/local/bin suffices.
Click to expand...
Click to collapse
please can u post the link of aapt.exe?
Ace King 34 said:
please can u post the link of aapt.exe?
Click to expand...
Click to collapse
Just install the latest Android SDK.
I am going to reinstall Windows 7 x64 tomorrow.....
And this is what I would be installing :
1. Java Runtime Environment (64 - Bit)
2. JDK (64 - Bit)
3. Latest version of Android SDK.
Do I need anything apart from these for my APKTool / Manager to work?
Bump.....
I will be formatting in an hour or so....
Please answer my questions before that....
Bump again....
Gimme the apk
Ive modded holo launcher before
Sent from my GT-Xperia S using xda premium
CoolCatGetHome said:
Gimme the apk
Ive modded holo launcher before
Sent from my GT-Xperia S using xda premium
Click to expand...
Click to collapse
Thank you but its not about the APK but the error....
I would be Modding APKs in the future too and I don't want to be stuck with errors like these.....
Would JRE, JDK and Android SDK be enough for APK Modding or do I need to installing anything more?
holo launcher apk.
CoolCatGetHome said:
Gimme the apk
Ive modded holo launcher before
Sent from my GT-Xperia S using xda premium
Click to expand...
Click to collapse
@CoolCatGetHome here is the apk of holo launcher.
please change 'all' tab to 'apps' tab.
thanks.
Can someone please answer this?
[email protected] said:
I am going to reinstall Windows 7 x64 tomorrow.....
And this is what I would be installing :
1. Java Runtime Environment (64 - Bit)
2. JDK (64 - Bit)
3. Latest version of Android SDK.
Do I need anything apart from these for my APKTool / Manager to work?
Click to expand...
Click to collapse
Hmm weird
Get png prob
Sent from my GT-S5830 using xda premium
CoolCatGetHome said:
Hmm weird
Get png prob
Sent from my GT-S5830 using xda premium
Click to expand...
Click to collapse
"png porblem"?
And what would that be like?
Please help me deodex part of samsung p3100 firmware. My aim is to make tablet view for 4.1.1 android(firmware - vodafone), but I stuck with simple deodex. The only file I need to deodex is android.policy.jar Here is what I do:
1) Installed JDK
2) Copied /system/framework from device(I think that way of copying is not significant, I unpacked tar file of cwm backup) +copied init.rc file
3) Downloaded Smali and Backsmali 1.4.1, renamed them into smali.jar and backsmali.jar,
4) Put them all in the same folder (in my case c:\smali\)
5) Unpacked android.policy.jar with script(BOOTCLASSPATH taken from init.rc):
java -Xmx1024m -jar baksmali.jar -c :core.jar:core-junit.jar:bouncycastle.jar:ext.jar:framework.jar:framework2.jar:android.policy.jar:services.jar:apache-xml.jar:sec_edm.jar:seccamera.jar -x android.policy.odex
Click to expand...
Click to collapse
6) Build classes.dex file with script:
java -Xmx1024m -jar smali.jar out -o classes.dex
Click to expand...
Click to collapse
7) Opened android.policy.jar with 7zip and copied classes.dex there
8) Ready file I put to the device and deleted android.policy.odex file
The only result I receive - stuck on bootlogo. After returning unchanged jar and odex file through cwm it boots normally.
What I'm doing wrong?
Hey there!
I'm having the same problem Did you ever resolve this?
I need to sign an APK using the system keys obtained from Google's source (As an example) using SignApk.jar. However, everytime we try to Sign we get the error below...
This is the command we are using (Please note we are using the Source code downloaded from Google for Android 8.1 for the Pixel).
Besides this method, is there another way to sign an APK with the system key?
java -Xmx2048m -Djava.library.path="out/host/linux-x86/lib64" -jar prebuilts/sdk/tools/lib/signapk.jar -w build/make/target/product/security/platform.x509.pem build/make/target/product/security/platform.pk8 Unsigned-Apk.apk Signed_final_apk.apk
Error: Exception in thread "main" java.lang.ExceptionInInitializerError
at org.conscrypt.OpenSSLBIOInputStream.<init>(OpenSSLBIOInputStream.java:34)
at org.conscrypt.OpenSSLX509Certificate.fromX509PemInputStream(OpenSSLX509Certificate.java:119)
at org.conscrypt.OpenSSLX509CertificateFactory$1.fromX509PemInputStream(OpenSSLX509CertificateFactory.java:220)
at org.conscrypt.OpenSSLX509CertificateFactory$1.fromX509PemInputStream(OpenSSLX509CertificateFactory.java:216)
at org.conscrypt.OpenSSLX509CertificateFactory$Parser.generateItem(OpenSSLX509CertificateFactory.java:94)
at org.conscrypt.OpenSSLX509CertificateFactory.engineGenerateCertificate(OpenSSLX509CertificateFactory.java:272)
at java.security.cert.CertificateFactory.generateCertificate(CertificateFactory.java:339)
at com.android.signapk.SignApk.readPublicKey(SignApk.java:184)
at com.android.signapk.SignApk.main(SignApk.java:1007)
Caused by: java.lang.IllegalArgumentException: Failed to load any of the given libraries: [conscrypt_openjdk_jni-osx-x86_64, conscrypt_openjdk_jni]
at org.conscrypt.NativeLibraryLoader.loadFirstAvailable(NativeLibraryLoader.java:160)
at org.conscrypt.NativeCryptoJni.init(NativeCryptoJni.java:49)
at org.conscrypt.NativeCrypto.<clinit>(NativeCrypto.java:53)
... 9 more