Project Configuration File
In Auto.js Pro, you may run not only single files but also projects. A project is a folder that contains configuration, code files, and resources (images, etc).
You can create a new project on the home page. Multiple project templates are available (Pro 8.7+).
project.json
project.json configures project parameters, such as entry file, splash screen, package name, and more.
| Field | Meaning | Type | Default |
|---|---|---|---|
| androidResources | Android native resources, see androidResources | Object | { "resDir": "res", "manifest": "AndroidManifest.xml" } |
| build | Auto-generated build info (do not modify), see build | Object | |
| assets | Reserved field (currently unused) | string[] | [] |
| encryptLevel | 0 = none, 1 = local, 2 = online (Pro 8.7+) | number | 0 |
| icon | App icon | string | "icons/icon.png" |
| ignore | Ignored files when syncing from VSCode (replaced by .autojs.sync.ignore in Pro 9.3+) | string[] | ["build"] |
| launchConfig | Launch settings, see launchConfig | Object | |
| main | Entry file | string | "main.js" |
| name | App name | string | "" |
| optimization | Optimization settings, see optimization | Object | |
| packageName | Package name (must follow Android rules; must be unique on stores) | string | "" |
| permissionConfig | Permission settings, see permissionConfig | Object | { "manifestPermissions": [], "requestListOnStartup": [] } |
| publish | Publish/store settings, see publish | Object | |
| scripts | Hook scripts executed during build steps, see scripts | Object | |
| useFeatures | Feature flags (e.g. continuation for coroutines) | string[] | [] |
| versionCode | Version code | number | 1 |
| versionName | Version name shown to users | string | "1.0.0" |
Full example:
{
"androidResources": {
"resDir": "res",
"manifest": "AndroidManifest.xml"
},
"assets": [],
"build": {
"build_id": "6F47F367-1",
"build_number": 1,
"build_time": 1615553004812,
"release": true
},
"encryptLevel": 0,
"useFeatures": [],
"icon": "res/icon.png",
"ignore": ["build"],
"launchConfig": {
"displaySplash": true,
"hideLogs": false,
"splashIcon": "res/splashIcon.png",
"splashLayoutXml": "splash.xml",
"splashText": "Powered by Auto.js Pro",
"stableMode": false
},
"main": "main.js",
"name": "Shape3.0",
"optimization": {
"removeOpenCv": true,
"unusedResources": true
},
"packageName": "com.suzy.rippledrawable",
"permissionConfig": {
"manifestPermissions": ["android.permission.WRITE_EXTERNAL_STORAGE"],
"requestListOnStartup": ["android.permission.WRITE_EXTERNAL_STORAGE"]
},
"publish": {
"category": "Other",
"details": "Widget outline / gradient / ripple / text gradient",
"maxAutoJsVersion": -1,
"minAutoJsVersion": -1,
"maxProVersion": 8059999,
"minProVersion": 8050000,
"minSdkVersion": 2,
"permissions": [],
"summary": "Widget outline / gradient / ripple / text gradient",
"tags": []
},
"scripts": {},
"versionCode": 1,
"versionName": "1.0.0"
}Minimal example:
{
"name": "New Project",
"main": "main.js",
"ignore": ["build"],
"packageName": "com.example",
"versionName": "1.0.0",
"versionCode": 1
}androidResources
Configure Android native UI resources. See examples → Complex UI → Android native UI.
| Field | Meaning | Type | Default |
|---|---|---|---|
| resDir | Resource directory | string | "res" |
| manifest | AndroidManifest.xml path | string | "AndroidManifest.xml" |
build
Auto-generated build info (build time, build number, etc). Do not modify.
During packaging, Auto.js Pro uses this info to decide whether to extract and overwrite files in the app’s data directory.
| Field | Meaning | Type | Default |
|---|---|---|---|
| build_id | Build id | string | "" |
| build_number | Auto-increment build number | number | 1 |
| build_time | Last build timestamp | number | current 13-digit timestamp |
| release | Whether it is a packaged project | boolean | false |
launchConfig
Launch settings for packaged apps.
| Field | Meaning | Type | Default |
|---|---|---|---|
| displaySplash | Show splash screen on startup (first launch may still show it) | boolean | true |
| hideLogs | Hide log UI | boolean | false |
| splashIcon | Splash icon | string | "icons/splashIcon.png" |
| splashLayoutXml | Splash XML layout (8.5+) | string | "splash.xml" |
| splashText | Splash text | string | "Powered by Auto.js Pro" |
| stableMode | Run in stable mode | boolean | false |
permissionConfig
Added in Pro 8.8.1
Custom permission settings: declared permissions in manifest and permissions requested on startup.
| Field | Meaning | Type | Default |
|---|---|---|---|
| manifestPermissions | Permissions declared in packaged app | string[] | null |
| requestListOnStartup | Permissions requested on startup (must be included in manifestPermissions) | string[] | ["android.permission.WRITE_EXTERNAL_STORAGE"] |
Android permission list: Manifest.permission
publish
Store publishing settings.
| Field | Meaning | Type | Default |
|---|---|---|---|
| category | Category for store listing | string | "Other" |
| details | Details/description | string | "" |
| permissions | Reserved permissions list (e.g. "root") | string[] | [] |
| summary | Short summary | string | "" |
| tags | Tags (reserved) | string[] | [] |
optimization
Optimization settings to reduce package size.
| Field | Meaning | Type | Default |
|---|---|---|---|
| removeOpenCv | Remove image/color module if not needed | boolean | false |
| unusedResources | Remove built-in icons if not needed | boolean | false |
ignore configuration
ignore works like .gitignore rules to ignore files during packaging/encryption.
Example:
# / means the current directory (relative to this file)
# ignore everything under public/
/public/
# but do not ignore /public/assets
!/public/assets
# ignore specific file
index.js
# ignore all .js files
*.js.autojs.source.ignore
Path: .autojs.source.ignore under the project directory.
Matched files will not be treated as JavaScript source and will not be encrypted (useful for web assets).
.autojs.build.ignore
Path: .autojs.build.ignore under the project directory.
Matched files will not be included in the packaged APK.
.autojs.sync.ignore
Path: .autojs.sync.ignore under the project directory.
Matched files will be ignored by the VSCode plugin during sync/save (Pro 9.3+).
scripts
The scripts field defines shell commands to run at build hooks, e.g.:
{
"scripts": {
"build-apk-pre-prepare": "sh build.sh"
}
}Supported phases include:
build-apk-pre-preparebuild-apk-post-preparebuild-apk-pre-buildbuild-apk-post-buildbuild-apk-pre-optimizebuild-apk-post-optimizebuild-apk-pre-packagebuild-apk-post-package
