fix: Android releasable build

This commit is contained in:
Vanalite 2025-09-26 09:42:00 +07:00
parent 814024982e
commit fdf9f40aef
6 changed files with 22 additions and 19 deletions

View File

@ -26,11 +26,11 @@
"serve:web-app": "yarn workspace @janhq/web-app serve:web",
"build:serve:web-app": "yarn build:web-app && yarn serve:web-app",
"dev:tauri": "yarn build:icon && yarn copy:assets:tauri && cross-env IS_CLEAN=true tauri dev",
"dev:ios": "yarn copy:assets:mobile && RUSTC_WRAPPER= yarn tauri ios dev --features mobile",
"dev:android": "yarn copy:assets:mobile && TAURI_ANDROID_BUILD=true yarn tauri android dev --features mobile",
"build:android": "yarn build && yarn copy:assets:mobile && TAURI_ANDROID_BUILD=true yarn tauri android build --no-default-features --features mobile",
"build:ios": "yarn build && yarn copy:assets:mobile && yarn tauri ios build --no-default-features --features mobile",
"build:ios:device": "yarn build && yarn copy:assets:mobile && yarn tauri ios build --no-default-features --features mobile --export-method debugging",
"dev:ios": "yarn build:extensions-web && yarn copy:assets:mobile && RUSTC_WRAPPER= yarn tauri ios dev --features mobile",
"dev:android": "yarn build:extensions-web && yarn copy:assets:mobile && cross-env IS_CLEAN=true TAURI_ANDROID_BUILD=true yarn tauri android dev --features mobile",
"build:android": "yarn build:icon && yarn copy:assets:mobile && cross-env IS_CLEAN=true TAURI_ANDROID_BUILD=true yarn tauri android build -- --no-default-features --features mobile",
"build:ios": "yarn copy:assets:mobile && yarn tauri ios build -- --no-default-features --features mobile",
"build:ios:device": "yarn build:icon && yarn copy:assets:mobile && yarn tauri ios build -- --no-default-features --features mobile --export-method debugging",
"copy:assets:tauri": "cpx \"pre-install/*.tgz\" \"src-tauri/resources/pre-install/\" && cpx \"LICENSE\" \"src-tauri/resources/\"",
"copy:assets:mobile": "cpx \"pre-install/*.tgz\" \"src-tauri/resources/pre-install/\" && cpx \"LICENSE\" \"src-tauri/resources/\"",
"download:lib": "node ./scripts/download-lib.mjs",

2
src-tauri/tauri Executable file
View File

@ -0,0 +1,2 @@
#!/usr/bin/env node
import('../node_modules/@tauri-apps/cli/tauri.js');

View File

@ -11,7 +11,10 @@
},
"plugins": {},
"bundle": {
"resources": ["resources/LICENSE", "resources/pre-install"],
"externalBin": []
"resources": ["resources/LICENSE"],
"externalBin": [],
"android": {
"minSdkVersion": 24
}
}
}

View File

@ -15,7 +15,7 @@
"iOS": {
"developmentTeam": "<DEVELOPMENT_TEAM_ID>"
},
"resources": ["resources/LICENSE", "resources/pre-install"],
"resources": ["resources/LICENSE"],
"externalBin": []
}
}

View File

@ -69,7 +69,7 @@ const useAuthStore = create<AuthState>()((set, get) => ({
if (!authService) {
return []
}
return authService.getAllProviders()
return (authService as any).getAllProviders()
},
loginWithProvider: async (providerId: ProviderType) => {
@ -78,7 +78,7 @@ const useAuthStore = create<AuthState>()((set, get) => ({
throw new Error('Authentication not available on this platform')
}
await authService.loginWithProvider(providerId)
await (authService as any).loginWithProvider(providerId)
},
handleProviderCallback: async (
@ -91,7 +91,7 @@ const useAuthStore = create<AuthState>()((set, get) => ({
throw new Error('Authentication not available on this platform')
}
await authService.handleProviderCallback(providerId, code, state)
await (authService as any).handleProviderCallback(providerId, code, state)
// Reload auth state after successful callback
await loadAuthState()
},
@ -102,7 +102,7 @@ const useAuthStore = create<AuthState>()((set, get) => ({
return false
}
return authService.isAuthenticatedWithProvider(providerId)
return (authService as any).isAuthenticatedWithProvider(providerId)
},
logout: async () => {
@ -133,7 +133,7 @@ const useAuthStore = create<AuthState>()((set, get) => ({
}
try {
const profile = await authService.getCurrentUser(forceRefresh)
const profile = await (authService as any).getCurrentUser(forceRefresh)
set({
user: profile,
isAuthenticated: profile !== null,
@ -156,11 +156,11 @@ const useAuthStore = create<AuthState>()((set, get) => ({
set({ isLoading: true })
// Check if user is authenticated with any provider
const isAuth = authService.isAuthenticated()
const isAuth = (authService as any).isAuthenticated()
// Load user profile if authenticated
if (isAuth) {
const profile = await authService.getCurrentUser(forceRefresh)
const profile = await (authService as any).getCurrentUser(forceRefresh)
set({
user: profile,
isAuthenticated: profile !== null,
@ -184,12 +184,12 @@ const useAuthStore = create<AuthState>()((set, get) => ({
subscribeToAuthEvents: (callback: (event: MessageEvent) => void) => {
const { authService } = get()
if (!authService || typeof authService.onAuthEvent !== 'function') {
if (!authService || typeof (authService as any).onAuthEvent !== 'function') {
return () => {} // Return no-op cleanup
}
try {
return authService.onAuthEvent(callback)
return (authService as any).onAuthEvent(callback)
} catch (error) {
console.warn('Failed to subscribe to auth events:', error)
return () => {}

View File

@ -16,8 +16,6 @@ import DropdownAssistant from '@/containers/DropdownAssistant'
import { useAssistant } from '@/hooks/useAssistant'
import { useAppearance } from '@/hooks/useAppearance'
import { ContentType, ThreadMessage } from '@janhq/core'
import { useTranslation } from '@/i18n/react-i18next-compat'
import { useChat } from '@/hooks/useChat'
import { useSmallScreen, useMobileScreen } from '@/hooks/useMediaQuery'
import { useTools } from '@/hooks/useTools'
import { PlatformFeatures } from '@/lib/platform/const'