Skip to content

Commit

Permalink
Code improves
Browse files Browse the repository at this point in the history
  • Loading branch information
powenn committed Jul 14, 2022
1 parent a216057 commit 6a2bd7a
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 49 deletions.
Binary file not shown.
18 changes: 9 additions & 9 deletions permasigneriOS/CheckApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,26 @@ class CheckApp: ObservableObject {

static let shared = CheckApp()

@Published var appNameInPayload:String = ""
@Published var payloadPath:URL = URL(fileURLWithPath: "")
var appNameInPayload:String = ""
var payloadPath:URL = URL(fileURLWithPath: "")

@Published var fileName:String = ""
@Published var filePath:String = ""
var filePath:String = ""

var destination = URL(fileURLWithPath: "")
var fileDir = URL(fileURLWithPath: "")

// App Info vars
var config: [String: Any]?
var InfoPlistPath = URL(string: "")
@Published var app_name:String = ""
var app_name:String = ""
@Published var app_bundle:String = ""
@Published var app_version:String = ""
@Published var app_min_ios:String = ""
@Published var app_author:String = ""
var app_version:String = ""
var app_min_ios:String = ""
var app_author:String = ""

@Published var app_executable:String? = nil
@Published var validInfoPlist:Bool = false
var app_executable:String? = nil
var validInfoPlist:Bool = false
// ----------------------------

func extractIpa() {
Expand Down
2 changes: 1 addition & 1 deletion permasigneriOS/PackToDeb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Progress: ObservableObject {
private init() { }
static let shared = Progress()

@Published var OutputDebFilePath = ""
var OutputDebFilePath = ""
// @Published var Percent = 1.0
@Published var ProgressingDescribe = ""
@Published var CustomDebDescription = ""
Expand Down
77 changes: 38 additions & 39 deletions permasigneriOS/Views/SignView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,14 @@ struct SignView: View {
}
.padding()

Button(action: {
ShowCustomInfo.toggle()
}, label: {
Text("Custom Info")
}).sheet(isPresented: $ShowCustomInfo, content: {
CustomInfoView()
}).disabled(checkapp.fileName == "" || progress.ProgressingDescribe != "" || isImporting)
// Button(action: {
// ShowCustomInfo.toggle()
// }, label: {
// Text("Custom Info")
// }).sheet(isPresented: $ShowCustomInfo, content: {
// CustomInfoView()
// }).disabled(checkapp.fileName == "" || progress.ProgressingDescribe != "" || isImporting)

Button(action: {
DispatchQueue.global(qos: .userInitiated).async {
progress.permanentSignButtonFunc()
Expand Down Expand Up @@ -134,42 +134,41 @@ struct SignView: View {
}


struct CustomInfoView: View {
@StateObject var checkapp: CheckApp = .shared
@StateObject var progress: Progress = .shared
@Environment(\.presentationMode) var presentationMode
var body: some View {
VStack{
VStack(alignment: .leading) {
Text("Customize App Bundle")
TextField("App Bundle", text: $checkapp.app_bundle)
.textFieldStyle(.roundedBorder)
Text("Customize deb file description\n( Leave blank to use default )")
TextField("Description", text: $progress.CustomDebDescription)
.textFieldStyle(.roundedBorder)
Text("You can click TextField to dismiss keyboard")
.font(.footnote)
.foregroundColor(.gray)
}.padding()
Button(action: {
self.presentationMode.wrappedValue.dismiss()
}, label: {
Text("Done")
}).padding()
}
.padding()
.onTapGesture {
hideKeyboard()
}
}
}
//struct CustomInfoView: View {
// @StateObject var checkapp: CheckApp = .shared
// @StateObject var progress: Progress = .shared
// @Environment(\.presentationMode) var presentationMode
//
// var body: some View {
// VStack{
// VStack(alignment: .leading) {
// Text("Customize App Bundle")
// TextField("App Bundle", text: $checkapp.app_bundle)
// .textFieldStyle(.roundedBorder)
// Text("Customize deb file description\n( Leave blank to use default )")
// TextField("Description", text: $progress.CustomDebDescription)
// .textFieldStyle(.roundedBorder)
// Text("You can click TextField to dismiss keyboard")
// .font(.footnote)
// .foregroundColor(.gray)
// }.padding()
// Button(action: {
// self.presentationMode.wrappedValue.dismiss()
// }, label: {
// Text("Done")
// }).padding()
// }
// .padding()
// .onTapGesture {
// hideKeyboard()
// }
// }
//}


struct SignView_Previews: PreviewProvider {
static var previews: some View {
SignView()
CustomInfoView()
}
}

0 comments on commit 6a2bd7a

Please sign in to comment.