i'm attempting change a background by editing classes.dex of an apk
there doesn't appear to be a resource (jpg/image) for the background so i'm assuming it is set by rgb of some sort.
i found this line but i'm not sure what it refers to.
.field public static final background:I = 0x7f020001
is 0x7f020001 an offset similar to how exe's work? would it be in the resource.arsc file or xml? classes.dex or some other file.
any help appreciated
So .. I'm trying to create an ADW theme.. I've been following the rules that was set by the creator in his theme template (http://github.com/AnderWeb/ADW.Theme-Template)
I keep getting compiler errors though which most of them similar to this:
error: Error: No resource found that matches the given name (at 'drawable' with value '@drawable/box_launcher_top_normal').
the error seems to make sense since there is no box_launcher_top_normal in drawable..
but there is a .png file with that name in drawable-hdpi or something.. I don't get why it keeps doing this anyone care to lend a noobie help? I'm using eclipse btw.
selfless bump:
I seem to fix the 317 errors but these are still bugging me:
error: No resource identifier found for attribute 'installLocation' in package 'android'
error: Error: No resource found that matches the given name (at 'label' with value '@string/theme_title')
and
Java Exception Breakpoints
Unknown
Unknown
The installLocation error is because you are not building the package against Android 2.2.
that's interesting.. i have to use the 2.2 one despite i just want to make it for my eclair phone D: ? mm.. how about the other ones
here's the manifest that's giving me trouble.. only thing i changed were the ones indicated to be changed which is package name and versions
http://github.com/AnderWeb/ADW.Theme-Template/blob/master/AndroidManifest.xml
darkamikaze said:
that's interesting.. i have to use the 2.2 one despite i just want to make it for my eclair phone D: ? mm.. how about the other ones
here's the manifest that's giving me trouble.. only thing i changed were the ones indicated to be changed which is package name and versions
http://github.com/AnderWeb/ADW.Theme-Template/blob/master/AndroidManifest.xml
Click to expand...
Click to collapse
Don't worry, it will work fine (At least the build against 2.2 part).
woo fixed the others.. now these are left:
this next error is the same except for the methods involved are getItem(int), getCount(), getItemId(int) and getView(int)
Description Resource Path Location Type
The method getItem(int) of type main.IconsAdapter must override a superclass method main.java /com.darkamikaze.monster.theme/src/com/darkamikaze/monster/theme line 76 Java Problem
these are some lines involved in the error in main.java
@Override
public int getCount() {
return mThumbs.size();
}
darkamikaze said:
woo fixed the others.. now these are left:
this next error is the same except for the methods involved are getItem(int), getCount(), getItemId(int) and getView(int)
Description Resource Path Location Type
The method getItem(int) of type main.IconsAdapter must override a superclass method main.java /com.darkamikaze.monster.theme/src/com/darkamikaze/monster/theme line 76 Java Problem
these are some lines involved in the error in main.java
@Override
public int getCount() {
return mThumbs.size();
}
Click to expand...
Click to collapse
Have you resolved this? I'm getting these errors :|
Hi,
I want to use sqlite in my xposed module but i don't have any activity or context to send the database constructor.
Is it possible to overcome this?
I tried to send null as a context, but i'm getting nullPointerException when i try to open the database.
Thanks,
Gidi
If you can't get a context from the method you're hooking, you could try the AndroidAppHelper.currentApplication method.
Code:
Context ctx = AndroidAppHelper.currentApplication();
Context myCtx = ctx.createPackageContext("com.developer.app");
pyler said:
Code:
Context ctx = AndroidAppHelper.currentApplication();
Context myCtx = ctx.createPackageContext("com.developer.app");
Click to expand...
Click to collapse
HI Guys,
I tried the AndroidAppHelper.currentApplication() option, but it returns NULL in my case...
shnapsi said:
HI Guys,
I tried the AndroidAppHelper.currentApplication() option, but it returns NULL in my case...
Click to expand...
Click to collapse
If you are editing a database using sqlite and the current process you are hooking as no context reference, you can use root to set the database file to readable, then have your own service running in the background with a file observer tracking changes to a file on the device. Inside xposed module you will write to the file with a command instructing the file observer what to do. Then your service will "hear" the command and execute the changes needed.
I plan on writing up a guide for this. Tomorrow
elesbb said:
If you are editing a database using sqlite and the current process you are hooking as no context reference, you can use root to set the database file to readable, then have your own service running in the background with a file observer tracking changes to a file on the device. Inside xposed module you will write to the file with a command instructing the file observer what to do. Then your service will "hear" the command and execute the changes needed.
I plan on writing up a guide for this. Tomorrow
Click to expand...
Click to collapse
Thanks, I'll be happy to read your guide and learn new stuff
Anyway, I read that it's possible to use Sqlite DB without using SQLiteOpenHelper, this way, i don't need context.
the problem is that when i do it i get exception:
android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 14): Could not open database
this is my code:
database = SQLiteDatabase.openOrCreateDatabase(DB_NAME,null);
database.execSQL(CREATE_TABLE);
Thanks.
shnapsi said:
Thanks, I'll be happy to read your guide and learn new stuff
Anyway, I read that it's possible to use Sqlite DB without using SQLiteOpenHelper, this way, i don't need context.
the problem is that when i do it i get exception:
android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 14): Could not open database
this is my code:
database = SQLiteDatabase.openOrCreateDatabase(DB_NAME,null);
database.execSQL(CREATE_TABLE);
Thanks.
Click to expand...
Click to collapse
You probably don't have the required permissions to read/write to that location.
GermainZ said:
You probably don't have the required permissions to read/write to that location.
Click to expand...
Click to collapse
Thanks GermainZ,
which permissions do i need?
I tried to do it this way too:
Code:
File db = new File("/data/data/com.example.mytest/databases/" + DB_NAME);
db.setReadable(true);
db.setWritable(true);
File path = new File("/data/data/com.example.mytest/databases/");
path.setReadable(true);
path.setWritable(true);
path.mkdirs();
database = SQLiteDatabase.openOrCreateDatabase(db,null);
Still same result...
Thanks!
shnapsi said:
Thanks GermainZ,
which permissions do i need?
I tried to do it this way too:
Code:
File db = new File("/data/data/com.example.mytest/databases/" + DB_NAME);
db.setReadable(true);
db.setWritable(true);
File path = new File("/data/data/com.example.mytest/databases/");
path.setReadable(true);
path.setWritable(true);
path.mkdirs();
database = SQLiteDatabase.openOrCreateDatabase(db,null);
Still same result...
Thanks!
Click to expand...
Click to collapse
Let's differentiate between two things: your module (normal code) and the hooked process (the Xposed code).
Remember that hooked code runs as the hooked process (that is, the app you're hooking — *not* your module), so you won't be able to write to your module's data directory.
I don't know if you can change that. Maybe you could create the database and use Context.MODE_WORLD_WRITABLE (from your module, when it firsts open), but I don't think you'll have any luck creating it from the hooked process directly.
GermainZ said:
Let's differentiate between two things: your module (normal code) and the hooked process (the Xposed code).
Remember that hooked code runs as the hooked process (that is, the app you're hooking — *not* your module), so you won't be able to write to your module's data directory.
I don't know if you can change that. Maybe you could create the database and use Context.MODE_WORLD_WRITABLE (from your module, when it firsts open), but I don't think you'll have any luck creating it from the hooked process directly.
Click to expand...
Click to collapse
So where is the best place to use AndroidAppHelper.currentApplication(); so it won't return null and i will be able to use it in my hooked method?
Hello gays, i read all post's . I've the same problem. I start develop a module for xposed for my thesis the goal of application is return fake data when some aplications want access features that they don't need. I all ready can save in sqlite database the restrictions that the user want to restrict, the package name of application and uid. Now i want to access to the database methods by the main class (with implements IXposedHookLoadPackage) and i allways getting nullPointerException when i try connect to database. Anyone can solve this problem?? I will attach my main class IdentitySpoofing and my DatabaseHelper Best Regards Joao Marques
I have created a screen layout and now I want to generate a java class that is linked to it.
I am familiar with how to do this in Visual Studio C++ with the 'Class Wizard' and I understand how my dialog resource is linked to the class wizard generated class via the IDD = IDD_DIALOG_MYDIALOG.
But I don't yet understand how to do this with android studio.
Can anyone enlighten me please.
I am not sure if you can do it by wizard in Android Studio.
Howewer, you can create both layout and Java class by using New -> Activity -> Blank Activity from context menu in your package. So I think that one option would be to use this wizard, and then copy your layout to created .xml file.
You can also manually create Java class extending Activity and link it by using setContentView(R.layout.your_layout) in onCreate() method.
Hello. I'm new to the forum and to programming aswell. I'm trying to learn how to make an app so I started with a tutorial online, but I'm having a problem. I can't post a link but the tutorial is called "Make Your First Android App: Part 2/3 - Ray Wenderlich". On the section "Accessing Views From Within Java" when I add "android:text= @string/hello_world"" I get an error. On the bottom it says I should be using a @string but when I do the preview window displays the @string/" aswell. What's that about?
Second, I can't rename the string after changing hello_world to something else. Why is the tutorial even saying I should rename it? What will that do?
Lastly, in MainActivity.java above onCreate I have to insert a line of code. The tutorial doesn't explain why I need to do that. Where should the line go, the code is
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
wherever I insert the code and press Alt+Enter I mess up the whole thing...
Sorry that these questions are annoying and basic, I just really want to learn to make apps and I'm trying to figure things out alone.
Thanks.
P.S. one more thing, in "Buttons and Listeners" there is a part saying:
"Then there’s text, for which you need to add a line in strings.xml such as the following:
<string name="button">Update The TextView</string>"
when I do that I get an error in strings.xml
If you are having problems related to Java, the following tips should help you getting things working -
» Download and Install Java
» Use Java
» Test Java
» Remove Old Versions of Java
» Find Java.
basic issues
1) all strings you use needs to be defined in string.xml file, by doing so, you separate messages and names from code and it can be re used in your app from single source, easy to maintain.
2)ALT + ENTER is used to resolve import, when you add code and introduce new class, you need to import it.
3)Oncreate method in activity is used to setup layout for activity and provide content to be displayed on screen for the activity