Spaces:
Sleeping
Sleeping
David Prince
fix: add all missing local module stubs (remote_mcp_registry, mcp_auth, mcp_transport, etc)
cce8120 | from pathlib import Path | |
| PACKAGE="com.dolor3v.app" | |
| APP_NAME="Dolor3v" | |
| ROOT=Path("generated_android") | |
| def write(path,text): | |
| path.parent.mkdir(parents=True,exist_ok=True) | |
| path.write_text(text.strip()+"\n",encoding="utf-8") | |
| def generate(): | |
| write( | |
| ROOT/"AndroidManifest.xml", | |
| f""" | |
| <?xml version="1.0" encoding="utf-8"?> | |
| <manifest | |
| package="{PACKAGE}" | |
| xmlns:android="http://schemas.android.com/apk/res/android"> | |
| <application | |
| android:label="{APP_NAME}" | |
| android:allowBackup="true" | |
| android:supportsRtl="true" | |
| android:theme="@style/Theme.App"> | |
| <activity | |
| android:name=".MainActivity" | |
| android:exported="true"> | |
| <intent-filter> | |
| <action android:name="android.intent.action.MAIN"/> | |
| <category android:name="android.intent.category.LAUNCHER"/> | |
| </intent-filter> | |
| </activity> | |
| </application> | |
| </manifest> | |
| """ | |
| ) | |
| write( | |
| ROOT/"res/values/strings.xml", | |
| """ | |
| <?xml version="1.0" encoding="utf-8"?> | |
| <resources> | |
| <string name="app_name">Dolor3v</string> | |
| </resources> | |
| """ | |
| ) | |
| write( | |
| ROOT/"res/values/colors.xml", | |
| """ | |
| <?xml version="1.0" encoding="utf-8"?> | |
| <resources> | |
| <color name="black">#000000</color> | |
| <color name="white">#FFFFFF</color> | |
| </resources> | |
| """ | |
| ) | |
| write( | |
| ROOT/"res/values/themes.xml", | |
| """ | |
| <?xml version="1.0" encoding="utf-8"?> | |
| <resources> | |
| <style | |
| name="Theme.App" | |
| parent="android:Theme.Material.Light.NoActionBar"/> | |
| </resources> | |
| """ | |
| ) | |
| java_path=ROOT/"src/com/dolor3v/app/MainActivity.java" | |
| write( | |
| java_path, | |
| f""" | |
| package {PACKAGE}; | |
| import android.app.Activity; | |
| import android.os.Bundle; | |
| import android.widget.TextView; | |
| public class MainActivity extends Activity {{ | |
| @Override | |
| protected void onCreate(Bundle state) {{ | |
| super.onCreate(state); | |
| TextView tv=new TextView(this); | |
| tv.setText("Dolor3v APK Builder"); | |
| setContentView(tv); | |
| }} | |
| }} | |
| """ | |
| ) | |
| print(ROOT.resolve()) | |
| if __name__=="__main__": | |
| generate() | |