There is an old android apk file which is no longer supported by the manufacturer.
I figured out what could be wrong it is because it is calling a method from java:
In one of the java files (viewed after dex2jar and viewing with jd-gui)
import com.htc.buletoothconfirm;
All I want to do is to change that to
import com.htc.bluetoothconfirm;
Then recompile it into a .class file.
Then reinsert that .class file into a .jar file.
Then I will rebuild the .apk file.
The thing is I can’t change anything with jd-gui.
If I try to compile a single .java file with javac, it will give me import errors (there are a lot of imports in the file).
I have tried using jad to decompile the class file, and this is what I’m working with.
Although it gave a lot of “cannot fully decompile” errors.
What I think I want to do is just copy & paste the entire java file content from jd-gui into notepad, save it as .java, then compile it into .class, and reinsert it into the .jar file.
But its easier said than done. I don’t know how to compile this new .java file into a .class file, because of all the imports. (eg. where do I get import android.content.intent; etc? and do i really need to keep the directory structures and so on?)
Is there an easier way? I am just trying to change a single line. All the rest can be kept the same.
You should decompile apk file with some tools like ASM-Android, or Dedexer. If you want to generate a class, you could generate on-device using sdcard and then create a dex. file and its corresponding .jar. I used BCEL and ASM to generate Bytecode on-device.