Skip to content
This repository has been archived by the owner on Apr 10, 2022. It is now read-only.

Commit

Permalink
first release
Browse files Browse the repository at this point in the history
  • Loading branch information
DVDAndroid committed Sep 10, 2015
0 parents commit f9b066f
Show file tree
Hide file tree
Showing 14 changed files with 152 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Auto detect text files and perform LF normalization
* text=auto

# Custom for Visual Studio
*.cs diff=csharp

# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Xposed Module Template for Android Studio
-----------------------------------------

Create a Xposed Module easily with Android Studio

![](https://github.com/DVDAndroid/XposedModuleTemplate/blob/master/screenshot.png)

# How to

- [Download it](http://github.com/dvdandroid/XposedModuleTemplate/archive/master.zip)
- Extract and copy the `XposedModule` folder to the template folder located in:
`{Android Studio installation dir}\plugins\android\lib\templates\other\`

# Usage

If Android Studio is open, restart it.

- Click **File > New > Other > Xposed Module** (or right click in the project)
- Type your Xposed Description and your class name
- Click **Finish** and wait for Gradle sync

![](https://github.com/DVDAndroid/XposedModuleTemplate/blob/master/wizard.png)
7 changes: 7 additions & 0 deletions XposedModule/globals.xml.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0"?>
<globals>
<global id="projectOut" value="."/>
<global id="manifestOut" value="${manifestDir}"/>
<global id="srcOut" value="${srcDir}/${slashedPackageName(packageName)}"/>
<global id="resOut" value="${resDir}"/>
</globals>
27 changes: 27 additions & 0 deletions XposedModule/recipe.xml.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0"?>
<recipe>

<mkdir at="${escapeXmlAttribute(manifestOut)}/assets/"/>
<mkdir at="${escapeXmlAttribute(projectOut)}/libs/"/>

<copy from="root/libs/XposedBridge.jar"
to="${escapeXmlAttribute(projectOut)}/libs/XposedBridge.jar"/>

<merge from="root/AndroidManifest.xml.ftl"
to="${escapeXmlAttribute(manifestOut)}/AndroidManifest.xml"/>

<!-- no build.gradle changes - only a build sync -->
<merge from="root/build.gradle.ftl" to="${escapeXmlAttribute(projectOut)}/build.gradle"/>

<merge from="root/res/values/strings.xml.ftl"
to="${escapeXmlAttribute(resOut)}/values/strings.xml"/>

<instantiate from="root/assets/xposed_init.ftl"
to="${escapeXmlAttribute(manifestOut)}/assets/xposed_init"/>

<instantiate from="root/src/app_package/XposedMod.java.ftl"
to="${escapeXmlAttribute(srcOut)}/${xposedModClass}.java"/>

<open file="${escapeXmlAttribute(srcOut)}/${xposedModClass}.java"/>

</recipe>
18 changes: 18 additions & 0 deletions XposedModule/root/AndroidManifest.xml.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" >

<application>
<meta-data
android:name="xposedmodule"
android:value="true"/>
<meta-data
android:name="xposedminversion"
android:value="42+"/>
<meta-data
android:name="xposeddescription"
android:value="@string/xposedDescription"/>
</application>

<!-- created with androidstudio template by dvdandroid -->
<!-- http://github.com/dvdandroid/XposedModuleTemplate -->

</manifest>
1 change: 1 addition & 0 deletions XposedModule/root/assets/xposed_init.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
${packageName}.${xposedModClass}
1 change: 1 addition & 0 deletions XposedModule/root/build.gradle.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Binary file added XposedModule/root/libs/XposedBridge.jar
Binary file not shown.
3 changes: 3 additions & 0 deletions XposedModule/root/res/values/strings.xml.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<resources>
<string name="xposedDescription">${escapeXmlString(xposedDescription)}</string>
</resources>
15 changes: 15 additions & 0 deletions XposedModule/root/src/app_package/XposedMod.java.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package ${packageName};

import de.robv.android.xposed.IXposedHookLoadPackage;
import de.robv.android.xposed.XposedBridge;
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam;

public class ${xposedModClass} implements IXposedHookLoadPackage {

@Override
public void handleLoadPackage(final LoadPackageParam lpparam)
throws Throwable {
XposedBridge.log("Loaded app: " + lpparam.packageName);
}

}
41 changes: 41 additions & 0 deletions XposedModule/template.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0"?>
<template
name="Xposed Module"
description="Creates a new Xposed Module"
format="3"
minApi="15"
minBuildApi="15"
revision="2">

<category value="Other"/>

<parameter
name="Xposed Mod class"
constraints="nonempty|unique"
default="XposedMod"
help="Class that contains Xposed code"
id="xposedModClass"
type="class "/>

<parameter
name="Xposed Description"
constraints="nonempty"
help="Description of Xposed Module"
id="xposedDescription"
type="string"/>

<parameter
name="Package name"
constraints="package"
default="com.mycompany.myapp.xposed"
id="packageName"
type="string"/>

<thumbs>
<thumb>template_xposed_module.png</thumb>
</thumbs>

<globals file="globals.xml.ftl"/>
<execute file="recipe.xml.ftl"/>

</template>
Binary file added XposedModule/template_xposed_module.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added wizard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f9b066f

Please sign in to comment.