Add AlertDialog with using smali? - IDEs, Libraries, & Programming Tools

Hi,
I want to add alertdialog (message box) to existing apk. I can decompile my existing apk so how can i add alertdialog to apk with using smali files. Or how can i add alertdialog to apk with using any software. Please help me...

Related

new app: DSM Editor

version 1.5 (some other bugs on dependences and shadows adding!)
added also checkbox to delete realmodules/files into a package,some other little bugs solved!
Hi, another little app, to:
edit or create new dsm;
edit all inside, versions, files & Modules, update dsm into a package folder, delete all files/modules inside;
edit (add, delete remove all) dependencies;
edit (add, delete remove all) shadows;
edit (add, delete remove all) certificates, save certificates, splitting if more than one stored into dsm
and other.....
dsm_editor 1.7 some bugs solved and right files/modules flags read & write
try it (also to build old_style roms to repalce with existing into \tools folder!)
download here:
http://www.sendspace.com/file/c66tlc
P.S.: all suggestions are wellcome
bye!!!
So far - so good, really handy app
- after opening one dsm file "open dsm" button becomes disabled. Why so?
testing further...
OK - it doesn't see hidden|system files - while most of dsm files are
I was trying to remove a module from DSM. Result below...
Code:
System.MissingMemberException: Public member 'name' on type 'teqo04i1ca' not found.
at Microsoft.VisualBasic.CompilerServices.Symbols.Container.GetMembers(String& MemberName, Boolean ReportErrors)
at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack)
at j6mas.x3jsgp3.m4ndb(String )
at BW9xvPg(Z0jR.AOE.kq(Object , EventArgs )
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
version 1.1 at 1st post!
enabled "hidden" files show at runtime (befor eclose program it reset previous value found!)
and for otherproblem, never found, delete modules and files (hidden, protected ecc...) without any kind of problem!
bye!
thanks
How about adding something like "cancel editing" or similar? Now I have to click "save dsm" or exit the app to open another dsm file.
utak3r said:
thanks
How about adding something like "cancel editing" or similar? Now I have to click "save dsm" or exit the app to open another dsm file.
Click to expand...
Click to collapse
only have to open another dsm o create one new while you' re editing another, and a message appear, if you want can save or dismiss all modification made in target dsm if doesn't save it!
bye!
btw version 1.2 (on open dsm while is opened other one yet! and all files/modules remove (it remover really all files and modules into dsm-package if exists, "ATTENCTION"!!!)
Works perfect so far
utak3r said:
Works perfect so far
Click to expand...
Click to collapse
on 1st post version 1.3 some bugs solved on dependences and shadows adding/deleting!
TODO:
add dos prompt command to update packages or packages_groups (or transform no-dsm and app.reg into valid sdm and relative rgu!!!)
after that some of you tell me that all works well
Great app...but only a visualization issue:
texture said:
Great app...but only a visualization issue:
Click to expand...
Click to collapse
well, I'll fix this little iusse
Please add an opportunity to add all files and modules, which contain in a package, not on one, and at once everything, without dsm, initflashfiles.txt, option.xml, etc.
And if it is possible, to make automatic updating of existing dependences.
Thank.
you can just call BuildDSM if you don't want to play with it
UPD:
...or not - it puts all it finds as files, even modules.
UPD2:
When you open "choose directory" dialog (in "add module" or whatever else) could it open in a current directory?...
To me are known different programs for editing dsm (BuildDSM, DSMBuilder, DSMAnalyzer), but after all it is a question of this program, whether not so?
utak3r said:
you can just call BuildDSM if you don't want to play with it
UPD:
...or not - it puts all it finds as files, even modules.
UPD2:
When you open "choose directory" dialog (in "add module" or whatever else) could it open in a current directory?...
Click to expand...
Click to collapse
manually (or with a bat when will be compatible with dos shell!) you can update package and:
if not present dsm, it create new and update, if present and malformed (0 bytes for i.e., delete and create copy and update, if present and good, update it on relative files/modules into package!
great ervius! (like always)
gonna try it now, i'll let you know if i find any bug
thanks!
ervius said:
manually (or with a bat when will be compatible with dos shell!) you can update package and:
if not present dsm, it create new and update, if present and malformed (0 bytes for i.e., delete and create copy and update, if present and good, update it on relative files/modules into package!
Click to expand...
Click to collapse
Well - it's not so easy....
For example:
I have a package of my own... dsm is created by BuildDSM. In this package there're some modules, but they were flagged as files. Now - trying to use any of the update function in DSMEditor raises an exception about file not found. Plus I cannot just remove it from dsm and re-add it as a module, because using "remove" removes a module physically from a disk! I really would like to see turning this option off - so I could remove elements only from dsm, and not from my disk...
Is there any way to fill the entries automatically?.... I've tried it on a package containing modules and every option "update..." fails complaining "file not found".
utak3r said:
Well - it's not so easy....
For example:
I have a package of my own... dsm is created by BuildDSM. In this package there're some modules, but they were flagged as files. Now - trying to use any of the update function in DSMEditor raises an exception about file not found. Plus I cannot just remove it from dsm and re-add it as a module, because using "remove" removes a module physically from a disk! I really would like to see turning this option off - so I could remove elements only from dsm, and not from my disk...
Is there any way to fill the entries automatically?.... I've tried it on a package containing modules and every option "update..." fails complaining "file not found".
Click to expand...
Click to collapse
post the package
!
version 1.5 at 1st post, some improvements:
add checkbox to select if delete real modules/files on a package or not, solved other little bugs on!
bye!

Need help with simple string

Hi @all,
is it possible to use a string from android/frameworks/base/core/res/res/values in systemui app ?
How do i import the Resources?
a import call to
Code:
import android.core.R;
doesnt work
many thanks for help
In XML files it's usually referenced as "@android/string/whatever"
Well, first I suggest you to use an xml file called strings.xml in the folder ...\MyApp\res\values
Your strings.xml should contain the strings you need, in this format:
<string name="app_name">MyApp</string>
Then, you could refer to the string "app_name" from the main app class or from the xml layout.
From the xml layout, I suppose you have a textView or a Button or whatever. In the declaration you should use:
android:text="@string/app_name"
In the main app class (or other class) you should refer to your layout oblect (a button or whatever) and then access to the string value:
myButton.setText(mContext.getResources().getText(R.string.app_name));
I hope it helps

[Tutorial][Xposed] make watchface for Quick Circle

How to create a watchface for Quick Circle
General info
The app that is responsible for the watchface is LGAlarmClock.apk from /system/priv-apps .
This guide will learn you how to create an xposed module to switch those files.
Requirements
To know how to compile source to apk
Android Stuio / gradle project / To know how to reference a jar on a regular project on eclipse
Tutorial:
Create the new watchfaces.
Since we doesn't edit the functionallity of the clock, your image should be compatible with the layout of the original watchface.
The original watchfaces are stored on raw-xxxhdpi folder on the apk. You can decompoile the apk by yourself, or take a look at this.
save the edited image in the same name as the original
Create new android project in your IDE.
add the edited file to raw-xxxhdpi folder inside res folder.
Download the xposed-bridge jar from here.
Reference the jar to your project. In a gradle project you need to add to the dependencies:
Code:
provided files('path to jar')
Note: you don't need to add to jar to the classpath, only reference since it already exists on the firmware.
Create a module class that implements IXposedHookZygoteInit and IXposedHookInitPackageResources. It should look like:
Java:
package com.yoavst.quickcirclemod;
import android.content.res.XModuleResources;
import de.robv.android.xposed.IXposedHookInitPackageResources;
import de.robv.android.xposed.IXposedHookZygoteInit;
import de.robv.android.xposed.callbacks.XC_InitPackageResources;
public class Module implements IXposedHookZygoteInit, IXposedHookInitPackageResources {
// Required for resources
private static String MODULE_PATH = null;
[user=439709]@override[/user]
public void initZygote(StartupParam startupParam) throws Throwable {
MODULE_PATH = startupParam.modulePath;
}
[user=439709]@override[/user]
public void handleInitPackageResources(XC_InitPackageResources.InitPackageResourcesParam resParam) throws Throwable {
// Only if it is the clock package, continue.
if (!resParam.packageName.equals("com.lge.clock")) return;
// Here we will put or modifications.
}
}
Now you need to replace the resources. for example, let's say you edited those files: b2_quickcircle_digital_bg and b2_quickcircle_analog_style01_hour.
Java:
[user=439709]@override[/user]
public void handleInitPackageResources(XC_InitPackageResources.InitPackageResourcesParam resParam) throws Throwable {
// Only if it is the clock package, continue.
if (!resParam.packageName.equals("com.lge.clock")) return;
// Create a reference to our resources
XModuleResources modRes = XModuleResources.createInstance(MODULE_PATH, resParam.res);
// Replace the raw resources with hour resources
resParam.res.setReplacement("com.lge.clock", "raw", "b2_quickcircle_analog_style01_hour", modRes.fwd(R.raw.b2_quickcircle_analog_style01_hour));
resParam.res.setReplacement("com.lge.clock", "raw", "b2_quickcircle_digital_bg", modRes.fwd(R.raw.b2_quickcircle_digital_bg));
}
add an assets folder (in gradle, it is under the "main" folder). add an xposed_init file, this file contain the full classname for your module class. in the example it is: com.yoavst.quickcirclemod.Module
Compile it and see it works (need to be applied in xposed and reboot)
You can check for the source here - https://github.com/yoavst/rolexquickcircle
Awesome thanks!
Nobody is going to take advantage with that?
Gabbyh28 said:
Nobody is going to take advantage with that?
Click to expand...
Click to collapse
http://forum.xda-developers.com/lg-g3/themes-apps/xposed-rolex-watchface-quick-circle-t2862715
Here are the 3 available watchfaces for now (the last one which is a paid one, have more then 1 watchface)

[Q] Android Studio - Extract String Resource - Replace all occurrences?

In Eclipse, when creating a new String resource, there was an option to replace all occurrences of the hardcoded string (throughout the project) with references to the new String resource. Is this option available in Android Studio?

A really simple app ^_^

Hello everyone!
I need help in making a really simple app that can copy a zip i provide in the apk to a folder on the sd card. Im using Android Studio and most of the github repos ive been trying to study and replicate have so far proven unhelpful because of one reason or another. So i would like a small step by step tutorial or just the codes to make that happen.
PS ive got Android Sudio all setup and ready.
I'll be very thankful if someone helps me out :3
Cheers
alicarbovader said:
Hello everyone!
I need help in making a really simple app that can copy a zip i provide in the apk to a folder on the sd card. Im using Android Studio and most of the github repos ive been trying to study and replicate have so far proven unhelpful because of one reason or another. So i would like a small step by step tutorial or just the codes to make that happen.
PS ive got Android Sudio all setup and ready.
I'll be very thankful if someone helps me out :3
Cheers
Click to expand...
Click to collapse
Hi,
you have to be aware that the user needs to open your app before you can start any services to do the copying. And I'm not sure whether extracting files from an apk (even if it's your own) is possible without root (maybe with an expansion file?). I would provide those files over the internet instead. Other than that, where exactly is your problem? If you have no clue of Android development I'd suggest you start reading the developer tutorials.
SimplicityApks said:
Hi,
you have to be aware that the user needs to open your app before you can start any services to do the copying. And I'm not sure whether extracting files from an apk (even if it's your own) is possible without root (maybe with an expansion file?). I would provide those files over the internet instead. Other than that, where exactly is your problem? If you have no clue of Android development I'd suggest you start reading the developer tutorials.
Click to expand...
Click to collapse
Okay about the part of not opening the app, zooper skins are able tp do just exactly that ie getting installed from playstore and bam all the files within the apk get copied to sd card. Im looking for exactly the same thing, but instead of zooper, i intend to have my own zip file being copied to the sdcard.
alicarbovader said:
Okay about the part of not opening the app, zooper skins are able tp do just exactly that ie getting installed from playstore and bam all the files within the apk get copied to sd card. Im looking for exactly the same thing, but instead of zooper, i intend to have my own zip file being copied to the sdcard.
Click to expand...
Click to collapse
Well the zooper apps I tried just now weren't copying something to my storage without me opening them, and I am sure this isn't possible since Android 3.1 (see here). However, something similar might be possible with the app extension files though I am not familiar with how that would work. Is not explicitly starting the app really such an issue?
SimplicityApks said:
Well the zooper apps I tried just now weren't copying something to my storage without me opening them, and I am sure this isn't possible since Android 3.1 (see here). However, something similar might be possible with the app extension files though I am not familiar with how that would work. Is not explicitly starting the app really such an issue?
Click to expand...
Click to collapse
Okay i decided to create a UI for the app, where i can show the screenshot and added a button which you can press to install the theme.
my question now is about this piece of code:
Code:
private void copyAssets() {
AssetManager assetManager = getAssets();
String[] files = null;
try {
files = assetManager.list("");
} catch (IOException e) {
Log.e("tag", "Failed to get asset file list.", e);
}
for(String filename : files) {
InputStream in = null;
OutputStream out = null;
try {
in = assetManager.open(filename);
File outFile = new File(getExternalFilesDir(null), filename);
out = new FileOutputStream(outFile);
copyFile(in, out);
} catch(IOException e) {
Log.e("tag", "Failed to copy asset file: " + filename, e);
}
finally {
if (in != null) {
try {
in.close();
} catch (IOException e) {
// NOOP
}
}
if (out != null) {
try {
out.close();
} catch (IOException e) {
// NOOP
}
}
}
}
}
private void copyFile(InputStream in, OutputStream out) throws IOException {
byte[] buffer = new byte[1024];
int read;
while((read = in.read(buffer)) != -1){
out.write(buffer, 0, read);
}
}
i found it on stackoverflow, and i wanna understand how to use it to copy stuff from my assets folder to /storage/MycolorSCreen/Theme/exported/zip folder

Categories

Resources